From 52ea4f7beaa6e05a52ded6b04a73b7eadbc09996 Mon Sep 17 00:00:00 2001 From: misterg Date: Mon, 4 Feb 2019 11:40:09 -0500 Subject: Googletest export Mark legacy _TEST_CASE_ macros as deprecated PiperOrigin-RevId: 232303251 --- googlemock/test/gmock-matchers_test.cc | 8 ++--- googletest/include/gtest/gtest-param-test.h | 5 ++- googletest/include/gtest/gtest-typed-test.h | 18 +++++++--- googletest/include/gtest/internal/gtest-internal.h | 42 ++++++++++++++-------- googletest/include/gtest/internal/gtest-port.h | 16 +++++++++ googletest/samples/sample6_unittest.cc | 4 +-- 6 files changed, 67 insertions(+), 26 deletions(-) diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc index 932229e..1f14a05 100644 --- a/googlemock/test/gmock-matchers_test.cc +++ b/googlemock/test/gmock-matchers_test.cc @@ -4858,7 +4858,7 @@ typedef testing::Types< list > ContainerEqTestTypes; -TYPED_TEST_CASE(ContainerEqTest, ContainerEqTestTypes); +TYPED_TEST_SUITE(ContainerEqTest, ContainerEqTestTypes); // Tests that the filled container is equal to itself. TYPED_TEST(ContainerEqTest, EqualsSelf) { @@ -6090,7 +6090,7 @@ TEST_P(BipartiteTest, Exhaustive) { } while (graph.NextGraph()); } -INSTANTIATE_TEST_CASE_P(AllGraphs, BipartiteTest, +INSTANTIATE_TEST_SUITE_P(AllGraphs, BipartiteTest, ::testing::Range(0, 5)); // Parameterized by a pair interpreted as (LhsSize, RhsSize). @@ -6133,7 +6133,7 @@ TEST_P(BipartiteNonSquareTest, Exhaustive) { } while (graph.NextGraph()); } -INSTANTIATE_TEST_CASE_P(AllGraphs, BipartiteNonSquareTest, +INSTANTIATE_TEST_SUITE_P(AllGraphs, BipartiteNonSquareTest, testing::Values( std::make_pair(1, 2), std::make_pair(2, 1), @@ -6171,7 +6171,7 @@ TEST_P(BipartiteRandomTest, LargerNets) { } // Test argument is a std::pair representing (nodes, iters). -INSTANTIATE_TEST_CASE_P(Samples, BipartiteRandomTest, +INSTANTIATE_TEST_SUITE_P(Samples, BipartiteRandomTest, testing::Values( std::make_pair(5, 10000), std::make_pair(6, 5000), diff --git a/googletest/include/gtest/gtest-param-test.h b/googletest/include/gtest/gtest-param-test.h index a0eecc6..7a4986c 100644 --- a/googletest/include/gtest/gtest-param-test.h +++ b/googletest/include/gtest/gtest-param-test.h @@ -580,7 +580,10 @@ internal::CartesianProductHolder10); \ void GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::TestBody() -// Internal Macro to mark an API deprecated, for googletest usage only -// Usage: class GTEST_INTERNAL_DEPRECATED(message) MyClass or -// GTEST_INTERNAL_DEPRECATED(message) myFunction(); Every usage of -// a deprecated entity will trigger a warning when compiled with -// `-Wdeprecated-declarations` option (clang, gcc, any __GNUC__ compiler). -// For msvc /W3 option will need to be used -// Note that for 'other' compilers this macro evaluates to nothing to prevent -// compilations errors. -#if defined(_MSC_VER) -#define GTEST_INTERNAL_DEPRECATED(message) __declspec(deprecated(message)) -#elif defined(__GNUC__) -#define GTEST_INTERNAL_DEPRECATED(message) __attribute__((deprecated(message))) -#else -#define GTEST_INTERNAL_DEPRECATED(message) -#endif #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index a77eb72..59f86df 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -2296,4 +2296,20 @@ const char* StringFromGTestEnv(const char* flag, const char* default_val); } // namespace internal } // namespace testing +// Internal Macro to mark an API deprecated, for googletest usage only +// Usage: class GTEST_INTERNAL_DEPRECATED(message) MyClass or +// GTEST_INTERNAL_DEPRECATED(message) myFunction(); Every usage of +// a deprecated entity will trigger a warning when compiled with +// `-Wdeprecated-declarations` option (clang, gcc, any __GNUC__ compiler). +// For msvc /W3 option will need to be used +// Note that for 'other' compilers this macro evaluates to nothing to prevent +// compilations errors. +#if defined(_MSC_VER) +#define GTEST_INTERNAL_DEPRECATED(message) __declspec(deprecated(message)) +#elif defined(__GNUC__) +#define GTEST_INTERNAL_DEPRECATED(message) __attribute__((deprecated(message))) +#else +#define GTEST_INTERNAL_DEPRECATED(message) +#endif + #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ diff --git a/googletest/samples/sample6_unittest.cc b/googletest/samples/sample6_unittest.cc index 9a9d917..0266e27 100644 --- a/googletest/samples/sample6_unittest.cc +++ b/googletest/samples/sample6_unittest.cc @@ -84,7 +84,7 @@ using testing::Types; // To write a typed test case, first use // -// TYPED_TEST_CASE(TestCaseName, TypeList); +// TYPED_TEST_SUITE(TestCaseName, TypeList); // // to declare it and specify the type parameters. As with TEST_F, // TestCaseName must match the test fixture name. @@ -131,7 +131,7 @@ TYPED_TEST(PrimeTableTest, CanGetNextPrime) { } // That's it! Google Test will repeat each TYPED_TEST for each type -// in the type list specified in TYPED_TEST_CASE. Sit back and be +// in the type list specified in TYPED_TEST_SUITE. Sit back and be // happy that you don't have to define them multiple times. #endif // GTEST_HAS_TYPED_TEST -- cgit v0.12