aboutsummaryrefslogtreecommitdiffstats
path: root/googletest/test
diff options
context:
space:
mode:
authorKrystian Kuzniarek <krystian.kuzniarek@gmail.com>2019-09-10 12:20:09 +0200
committerKrystian Kuzniarek <krystian.kuzniarek@gmail.com>2019-10-24 08:31:26 +0200
commit6e87238c9b14bcd749364e9b7125622a985a8a20 (patch)
treeec61eb83c0dc6e9981822cf204c0260025476b2e /googletest/test
parent3f05f651ae3621db58468153e32016bc1397800b (diff)
downloadgoogletest-6e87238c9b14bcd749364e9b7125622a985a8a20.tar.gz
googletest-6e87238c9b14bcd749364e9b7125622a985a8a20.tar.bz2
googletest-6e87238c9b14bcd749364e9b7125622a985a8a20.zip
remove BiggestInt
Diffstat (limited to 'googletest/test')
-rw-r--r--googletest/test/googletest-printers-test.cc16
-rw-r--r--googletest/test/gtest_unittest.cc6
2 files changed, 11 insertions, 11 deletions
diff --git a/googletest/test/googletest-printers-test.cc b/googletest/test/googletest-printers-test.cc
index 4bdc9add..06eedbda 100644
--- a/googletest/test/googletest-printers-test.cc
+++ b/googletest/test/googletest-printers-test.cc
@@ -83,10 +83,10 @@ void PrintTo(EnumWithPrintTo e, std::ostream* os) {
*os << (e == kEWPT1 ? "kEWPT1" : "invalid");
}
-// A class implicitly convertible to BiggestInt.
-class BiggestIntConvertible {
+// A class implicitly convertible to std::intmax_t.
+class IntMaxConvertible {
public:
- operator ::testing::internal::BiggestInt() const { return 42; }
+ constexpr operator std::intmax_t() const { return 42; }
};
// A user-defined unprintable class template in the global namespace.
@@ -268,10 +268,10 @@ TEST(PrintEnumTest, EnumWithPrintTo) {
EXPECT_EQ("invalid", Print(static_cast<EnumWithPrintTo>(0)));
}
-// Tests printing a class implicitly convertible to BiggestInt.
+// Tests printing a class implicitly convertible to std::intmax_t.
-TEST(PrintClassTest, BiggestIntConvertible) {
- EXPECT_EQ("42", Print(BiggestIntConvertible()));
+TEST(PrintClassTest, IntMaxConvertible) {
+ EXPECT_EQ("42", Print(IntMaxConvertible()));
}
// Tests printing various char types.
@@ -528,7 +528,7 @@ TEST(PrintPointerTest, NonMemberFunctionPointer) {
// this limitation.
EXPECT_EQ(
PrintPointer(reinterpret_cast<const void*>(
- reinterpret_cast<internal::BiggestInt>(&MyFunction))),
+ reinterpret_cast<std::intptr_t>(&MyFunction))),
Print(&MyFunction));
int (*p)(bool) = NULL; // NOLINT
EXPECT_EQ("NULL", Print(p));
@@ -1122,7 +1122,7 @@ TEST(PrintReferenceTest, HandlesFunctionPointer) {
// pointers to objects, and some compilers (e.g. GCC 3.4) enforce
// this limitation.
const std::string fp_string = PrintPointer(reinterpret_cast<const void*>(
- reinterpret_cast<internal::BiggestInt>(fp)));
+ reinterpret_cast<std::intptr_t>(fp)));
EXPECT_EQ("@" + fp_pointer_string + " " + fp_string,
PrintByRef(fp));
}
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc
index 12c5a871..d90fee91 100644
--- a/googletest/test/gtest_unittest.cc
+++ b/googletest/test/gtest_unittest.cc
@@ -55,11 +55,11 @@ TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
EXPECT_TRUE(dummy || !dummy); // Suppresses warning that dummy is unused.
}
-#include <limits.h> // For INT_MAX.
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <limits>
#include <map>
#include <ostream>
#include <type_traits>
@@ -3953,11 +3953,11 @@ enum {
// On Linux, kCaseB and kCaseA have the same value when truncated to
// int size. We want to test whether this will confuse the
// assertions.
- kCaseB = testing::internal::kMaxBiggestInt,
+ kCaseB = std::numeric_limits<std::intmax_t>::max(),
# else
- kCaseB = INT_MAX,
+ kCaseB = std::numeric_limits<int>::max(),
# endif // GTEST_OS_LINUX