diff options
author | vslashg <gfalcon@google.com> | 2019-11-01 20:02:16 (GMT) |
---|---|---|
committer | vslashg <gfalcon@google.com> | 2019-11-01 20:02:16 (GMT) |
commit | e8a82dc7ede61c4af3b9d75aa0e953b8cecfc8bb (patch) | |
tree | 2c85a4c08b20e6ce31a4c5e1f8814d9b837a94bd /googletest/src | |
parent | 057ee5063d00a67fd0a83029e8cf26ea9bc1bb69 (diff) | |
parent | 6e87238c9b14bcd749364e9b7125622a985a8a20 (diff) | |
download | googletest-e8a82dc7ede61c4af3b9d75aa0e953b8cecfc8bb.zip googletest-e8a82dc7ede61c4af3b9d75aa0e953b8cecfc8bb.tar.gz googletest-e8a82dc7ede61c4af3b9d75aa0e953b8cecfc8bb.tar.bz2 |
Merge pull request #2453 from kuzkry:gtest-port-clean-up_kMaxBiggestInt
PiperOrigin-RevId: 277979766
Diffstat (limited to 'googletest/src')
-rw-r--r-- | googletest/src/gtest.cc | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 8afb070..7c1c9ed 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -1442,9 +1442,8 @@ namespace internal { // The helper function for {ASSERT|EXPECT}_EQ with int or enum // arguments. AssertionResult CmpHelperEQ(const char* lhs_expression, - const char* rhs_expression, - BiggestInt lhs, - BiggestInt rhs) { + const char* rhs_expression, std::intmax_t lhs, + std::intmax_t rhs) { if (lhs == rhs) { return AssertionSuccess(); } @@ -1457,20 +1456,20 @@ AssertionResult CmpHelperEQ(const char* lhs_expression, } // A macro for implementing the helper functions needed to implement -// ASSERT_?? and EXPECT_?? with integer or enum arguments. It is here +// ASSERT_?? and EXPECT_?? with integer or enum arguments. It is here // just to avoid copy-and-paste of similar code. -#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ -AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ - BiggestInt val1, BiggestInt val2) {\ - if (val1 op val2) {\ - return AssertionSuccess();\ - } else {\ - return AssertionFailure() \ - << "Expected: (" << expr1 << ") " #op " (" << expr2\ - << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\ - << " vs " << FormatForComparisonFailureMessage(val2, val1);\ - }\ -} +#define GTEST_IMPL_CMP_HELPER_(op_name, op) \ + AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ + std::intmax_t val1, std::intmax_t val2) { \ + if (val1 op val2) { \ + return AssertionSuccess(); \ + } else { \ + return AssertionFailure() \ + << "Expected: (" << expr1 << ") " #op " (" << expr2 \ + << "), actual: " << FormatForComparisonFailureMessage(val1, val2) \ + << " vs " << FormatForComparisonFailureMessage(val2, val1); \ + } \ + } // Implements the helper function for {ASSERT|EXPECT}_NE with int or // enum arguments. |