diff options
author | Mark Mentovai <mark@chromium.org> | 2015-11-11 17:44:12 -0500 |
---|---|---|
committer | Mark Mentovai <mark@chromium.org> | 2015-11-11 17:44:12 -0500 |
commit | cbce23fb86705aff7f9f1294a295027d7ed674ef (patch) | |
tree | a372c523ecfc77d7d52520423ddfc6b2183524dc /googlemock/test | |
parent | 322a4914a309e950c0adb38c22dd44470619b994 (diff) | |
download | googletest-cbce23fb86705aff7f9f1294a295027d7ed674ef.tar.gz googletest-cbce23fb86705aff7f9f1294a295027d7ed674ef.zip |
Leave decltype(max_ulps_) alone and cast, not sure this is better
Diffstat (limited to 'googlemock/test')
-rw-r--r-- | googlemock/test/gmock-matchers_test.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc index 8cc37e72..11b6de2d 100644 --- a/googlemock/test/gmock-matchers_test.cc +++ b/googlemock/test/gmock-matchers_test.cc @@ -2708,19 +2708,21 @@ class FloatingPointTest : public testing::Test { zero_bits_(Floating(0).bits()), one_bits_(Floating(1).bits()), infinity_bits_(Floating(Floating::Infinity()).bits()), - close_to_positive_zero_( - Floating::ReinterpretBits(zero_bits_ + max_ulps_/2)), - close_to_negative_zero_( - -Floating::ReinterpretBits(zero_bits_ + max_ulps_ - max_ulps_/2)), + close_to_positive_zero_(Floating::ReinterpretBits( + static_cast<Bits>(zero_bits_ + max_ulps_/2))), + close_to_negative_zero_(-Floating::ReinterpretBits( + static_cast<Bits>(zero_bits_ + max_ulps_ - max_ulps_/2))), further_from_negative_zero_(-Floating::ReinterpretBits( - zero_bits_ + max_ulps_ + 1 - max_ulps_/2)), - close_to_one_(Floating::ReinterpretBits(one_bits_ + max_ulps_)), - further_from_one_(Floating::ReinterpretBits(one_bits_ + max_ulps_ + 1)), + static_cast<Bits>(zero_bits_ + max_ulps_ + 1 - max_ulps_/2))), + close_to_one_(Floating::ReinterpretBits( + static_cast<Bits>(one_bits_ + max_ulps_))), + further_from_one_(Floating::ReinterpretBits( + static_cast<Bits>(one_bits_ + max_ulps_ + 1))), infinity_(Floating::Infinity()), - close_to_infinity_( - Floating::ReinterpretBits(infinity_bits_ - max_ulps_)), - further_from_infinity_( - Floating::ReinterpretBits(infinity_bits_ - max_ulps_ - 1)), + close_to_infinity_(Floating::ReinterpretBits( + static_cast<Bits>(infinity_bits_ - max_ulps_))), + further_from_infinity_(Floating::ReinterpretBits( + static_cast<Bits>(infinity_bits_ - max_ulps_ - 1))), max_(Floating::Max()), nan1_(Floating::ReinterpretBits(Floating::kExponentBitMask | 1)), nan2_(Floating::ReinterpretBits(Floating::kExponentBitMask | 200)) { @@ -2778,7 +2780,7 @@ class FloatingPointTest : public testing::Test { // Pre-calculated numbers to be used by the tests. - const unsigned int max_ulps_; + const size_t max_ulps_; const Bits zero_bits_; // The bits that represent 0.0. const Bits one_bits_; // The bits that represent 1.0. |