From 3ea06317cd8b7e76596bdf84e591ae9414dc8d82 Mon Sep 17 00:00:00 2001 From: Bryan Zimmerman Date: Mon, 11 Dec 2017 12:19:56 -0500 Subject: [PATCH] remove implicit casts --- googlemock/test/gmock-generated-matchers_test.cc | 9 ++++----- googletest/CMakeLists.txt | 1 - googletest/include/gtest/internal/gtest-port.h | 2 +- googletest/test/gtest-printers_test.cc | 6 +++--- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/googlemock/test/gmock-generated-matchers_test.cc b/googlemock/test/gmock-generated-matchers_test.cc index 9eb4b258..6cba726d 100644 --- a/googlemock/test/gmock-generated-matchers_test.cc +++ b/googlemock/test/gmock-generated-matchers_test.cc @@ -64,7 +64,6 @@ using testing::ElementsAreArray; using testing::Eq; using testing::Ge; using testing::Gt; -using testing::internal::ImplicitCast_; using testing::Le; using testing::Lt; using testing::MakeMatcher; @@ -121,7 +120,7 @@ TEST(ArgsTest, AcceptsOneTemplateArg) { } TEST(ArgsTest, AcceptsTwoTemplateArgs) { - const tuple t(ImplicitCast_(4), 5, 6L); // NOLINT + const tuple t(static_cast(4), 5, 6L); // NOLINT EXPECT_THAT(t, (Args<0, 1>(Lt()))); EXPECT_THAT(t, (Args<1, 2>(Lt()))); @@ -129,13 +128,13 @@ TEST(ArgsTest, AcceptsTwoTemplateArgs) { } TEST(ArgsTest, AcceptsRepeatedTemplateArgs) { - const tuple t(ImplicitCast_(4), 5, 6L); // NOLINT + const tuple t(static_cast(4), 5, 6L); // NOLINT EXPECT_THAT(t, (Args<0, 0>(Eq()))); EXPECT_THAT(t, Not(Args<1, 1>(Ne()))); } TEST(ArgsTest, AcceptsDecreasingTemplateArgs) { - const tuple t(ImplicitCast_(4), 5, 6L); // NOLINT + const tuple t(static_cast(4), 5, 6L); // NOLINT EXPECT_THAT(t, (Args<2, 0>(Gt()))); EXPECT_THAT(t, Not(Args<2, 1>(Lt()))); } @@ -160,7 +159,7 @@ TEST(ArgsTest, AcceptsMoreTemplateArgsThanArityOfOriginalTuple) { } TEST(ArgsTest, CanBeNested) { - const tuple t(ImplicitCast_(4), 5, 6L, 6); // NOLINT + const tuple t(static_cast(4), 5, 6L, 6); // NOLINT EXPECT_THAT(t, (Args<1, 2, 3>(Args<1, 2>(Eq())))); EXPECT_THAT(t, (Args<0, 1, 3>(Args<0, 2>(Lt())))); } diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt index cb2cbaed..77b55cae 100644 --- a/googletest/CMakeLists.txt +++ b/googletest/CMakeLists.txt @@ -85,7 +85,6 @@ include_directories( # VS 2013 12 1800 std::tr1::tuple # VS 2015 14 1900 std::tuple # VS 2017 15 >= 1910 std::tuple - if (MSVC AND MSVC_VERSION EQUAL 1700) add_definitions(/D _VARIADIC_MAX=10) endif() diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index 704dc022..0a0cd1d7 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -646,7 +646,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; // Prevent `warning C4996: 'std::tr1': warning STL4002: The non-Standard std::tr1 namespace and TR1-only machinery are deprecated and will be REMOVED.` # define GTEST_HAS_TR1_TUPLE 0 # else - // The user didn't tell us not to do it, so we assume it's OK. +// The user didn't tell us not to do it, so we assume it's OK. # define GTEST_HAS_TR1_TUPLE 1 # endif #endif // GTEST_HAS_TR1_TUPLE diff --git a/googletest/test/gtest-printers_test.cc b/googletest/test/gtest-printers_test.cc index a48489c0..2a6c017e 100644 --- a/googletest/test/gtest-printers_test.cc +++ b/googletest/test/gtest-printers_test.cc @@ -1092,8 +1092,8 @@ TEST(PrintTr1TupleTest, VariousSizes) { ::std::tr1::tuple - t10(false, 'a', ImplicitCast_(3), 4, 5, 1.5F, -2.5, str, ImplicitCast_(NULL), - "10"); + t10(false, 'a', static_cast(3), 4, 5, 1.5F, -2.5, str, + ImplicitCast_(NULL), "10"); EXPECT_EQ("(false, 'a' (97, 0x61), 3, 4, 5, 1.5, -2.5, " + PrintPointer(str) + " pointing to \"8\", NULL, \"10\")", Print(t10)); @@ -1152,7 +1152,7 @@ TEST(PrintStdTupleTest, VariousSizes) { ::std::tuple - t10(false, 'a', ImplicitCast_(3), 4, 5, 1.5F, -2.5, str, + t10(false, 'a', static_cast(3), 4, 5, 1.5F, -2.5, str, ImplicitCast_(NULL), "10"); EXPECT_EQ("(false, 'a' (97, 0x61), 3, 4, 5, 1.5, -2.5, " + PrintPointer(str) + " pointing to \"8\", NULL, \"10\")",