diff options
author | Derek Mauro <dmauro@google.com> | 2023-01-24 16:40:51 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-01-24 16:41:35 (GMT) |
commit | 544c96ed5b0fb97ef867c38fbe204df2eaa02d2b (patch) | |
tree | fa87f8efdceda982c4d48399e33646f06875913e /googlemock/test | |
parent | ec25eea8f8237cf86c30703f59747e42f34b6f75 (diff) | |
download | googletest-544c96ed5b0fb97ef867c38fbe204df2eaa02d2b.zip googletest-544c96ed5b0fb97ef867c38fbe204df2eaa02d2b.tar.gz googletest-544c96ed5b0fb97ef867c38fbe204df2eaa02d2b.tar.bz2 |
Remove FloatingPoint::Max() in favor of std::numeric_limits::max()
In #4113 a user says Max clashes with a macro. Since it is only used in
a test, use std::numeric_limits::max() instead.
Note that in headers, the macro issue can be mitigated with
parenthesis like this: `(std::numeric_limits<T>::max)()`
PiperOrigin-RevId: 504284906
Change-Id: Ibf430caec1a6afdf6b303534fec6a4fd00a6373f
Diffstat (limited to 'googlemock/test')
-rw-r--r-- | googlemock/test/gmock-matchers-arithmetic_test.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/googlemock/test/gmock-matchers-arithmetic_test.cc b/googlemock/test/gmock-matchers-arithmetic_test.cc index a4c1def..36c2bf0 100644 --- a/googlemock/test/gmock-matchers-arithmetic_test.cc +++ b/googlemock/test/gmock-matchers-arithmetic_test.cc @@ -41,6 +41,8 @@ #include "test/gmock-matchers_test.h" +#include <limits> + namespace testing { namespace gmock_matchers_test { namespace { @@ -1037,7 +1039,7 @@ class FloatingPointTest : public testing::Test { Floating::ReinterpretBits(infinity_bits_ - max_ulps_)), further_from_infinity_( Floating::ReinterpretBits(infinity_bits_ - max_ulps_ - 1)), - max_(Floating::Max()), + max_(std::numeric_limits<RawType>::max()), nan1_(Floating::ReinterpretBits(Floating::kExponentBitMask | 1)), nan2_(Floating::ReinterpretBits(Floating::kExponentBitMask | 200)) {} |