From d1143988003cad7be2f22cd2d9cc73ed2f256da4 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Tue, 26 Jan 2021 13:24:04 -0800 Subject: Googletest export Remove uses of GTEST_HAS_TYPED_TEST_P and GTEST_HAS_TYPED_TEST. PiperOrigin-RevId: 353935996 --- googlemock/include/gmock/gmock-function-mocker.h | 6 +-- googlemock/include/gmock/internal/gmock-pp.h | 6 +-- googlemock/test/gmock-function-mocker_nc.cc | 16 -------- googlemock/test/gmock-function-mocker_nc_test.py | 43 ---------------------- googletest/include/gtest/gtest-typed-test.h | 8 ---- googletest/include/gtest/internal/gtest-internal.h | 4 -- .../include/gtest/internal/gtest-type-util.h | 4 -- googletest/samples/sample6_unittest.cc | 7 ---- googletest/src/gtest-typed-test.cc | 4 -- googletest/test/googletest-output-test_.cc | 18 --------- googletest/test/googletest-port-test.cc | 4 -- googletest/test/gtest-typed-test2_test.cc | 4 -- googletest/test/gtest-typed-test_test.cc | 25 ------------- googletest/test/gtest-typed-test_test.h | 4 -- googletest/test/gtest-unittest-api_test.cc | 13 ------- googletest/test/gtest_list_output_unittest.py | 32 ++++++++-------- googletest/test/gtest_list_output_unittest_.cc | 4 -- googletest/test/gtest_unittest.cc | 8 ---- googletest/test/gtest_xml_output_unittest_.cc | 4 -- 19 files changed, 22 insertions(+), 192 deletions(-) delete mode 100644 googlemock/test/gmock-function-mocker_nc.cc delete mode 100644 googlemock/test/gmock-function-mocker_nc_test.py diff --git a/googlemock/include/gmock/gmock-function-mocker.h b/googlemock/include/gmock/gmock-function-mocker.h index f592d86..29543f3 100644 --- a/googlemock/include/gmock/gmock-function-mocker.h +++ b/googlemock/include/gmock/gmock-function-mocker.h @@ -33,8 +33,8 @@ // GOOGLETEST_CM0002 DO NOT DELETE -#ifndef THIRD_PARTY_GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_ // NOLINT -#define THIRD_PARTY_GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_ // NOLINT +#ifndef GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_ // NOLINT +#define GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_ // NOLINT #include // IWYU pragma: keep #include // IWYU pragma: keep @@ -476,4 +476,4 @@ using internal::FunctionMocker; #define GMOCK_MOCKER_(arity, constness, Method) \ GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__) -#endif // THIRD_PARTY_GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_ +#endif // GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_ diff --git a/googlemock/include/gmock/internal/gmock-pp.h b/googlemock/include/gmock/internal/gmock-pp.h index 23615c5..81541ed 100644 --- a/googlemock/include/gmock/internal/gmock-pp.h +++ b/googlemock/include/gmock/internal/gmock-pp.h @@ -1,5 +1,5 @@ -#ifndef THIRD_PARTY_GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_PP_H_ -#define THIRD_PARTY_GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_PP_H_ +#ifndef GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_PP_H_ +#define GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_PP_H_ // Expands and concatenates the arguments. Constructed macros reevaluate. #define GMOCK_PP_CAT(_1, _2) GMOCK_PP_INTERNAL_CAT(_1, _2) @@ -276,4 +276,4 @@ GMOCK_PP_INTERNAL_FOR_EACH_IMPL_14(GMOCK_PP_INC(_i), _Macro, _Data, \ (GMOCK_PP_TAIL _Tuple)) -#endif // THIRD_PARTY_GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PP_H_ +#endif // GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PP_H_ diff --git a/googlemock/test/gmock-function-mocker_nc.cc b/googlemock/test/gmock-function-mocker_nc.cc deleted file mode 100644 index d38fe85..0000000 --- a/googlemock/test/gmock-function-mocker_nc.cc +++ /dev/null @@ -1,16 +0,0 @@ -#include "gmock/gmock.h" - -#include -#include - -#if defined(TEST_MOCK_METHOD_INVALID_CONST_SPEC) - -struct Base { - MOCK_METHOD(int, F, (), (onst)); -}; - -#else - -// Sanity check - this should compile. - -#endif diff --git a/googlemock/test/gmock-function-mocker_nc_test.py b/googlemock/test/gmock-function-mocker_nc_test.py deleted file mode 100644 index 8ef6e09..0000000 --- a/googlemock/test/gmock-function-mocker_nc_test.py +++ /dev/null @@ -1,43 +0,0 @@ -"""Negative compilation tests for Google Mock macro MOCK_METHOD.""" - -import os -import sys - -IS_LINUX = os.name == "posix" and os.uname()[0] == "Linux" -if not IS_LINUX: - sys.stderr.write( - "WARNING: Negative compilation tests are not supported on this platform") - sys.exit(0) - -# Suppresses the 'Import not at the top of the file' lint complaint. -# pylint: disable-msg=C6204 -from google3.testing.pybase import fake_target_util -from google3.testing.pybase import googletest - -# pylint: enable-msg=C6204 - - -class GMockMethodNCTest(googletest.TestCase): - """Negative compilation tests for MOCK_METHOD.""" - - # The class body is intentionally empty. The actual test*() methods - # will be defined at run time by a call to - # DefineNegativeCompilationTests() later. - pass - - -# Defines a list of test specs, where each element is a tuple -# (test name, list of regexes for matching the compiler errors). -TEST_SPECS = [ - ("MOCK_METHOD_INVALID_CONST_SPEC", - [r"onst cannot be recognized as a valid specification modifier"]), -] - -# Define a test method in GMockNCTest for each element in TEST_SPECS. -fake_target_util.DefineNegativeCompilationTests( - GMockMethodNCTest, - "google3/third_party/googletest/googlemock/test/gmock-function-mocker_nc", - "gmock-function-mocker_nc.o", TEST_SPECS) - -if __name__ == "__main__": - googletest.main() diff --git a/googletest/include/gtest/gtest-typed-test.h b/googletest/include/gtest/gtest-typed-test.h index 3ffa50b..49fa4e3 100644 --- a/googletest/include/gtest/gtest-typed-test.h +++ b/googletest/include/gtest/gtest-typed-test.h @@ -175,8 +175,6 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); // Implements typed tests. -#if GTEST_HAS_TYPED_TEST - // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the name of the typedef for the type parameters of the @@ -230,12 +228,8 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); TYPED_TEST_SUITE #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ -#endif // GTEST_HAS_TYPED_TEST - // Implements type-parameterized tests. -#if GTEST_HAS_TYPED_TEST_P - // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Expands to the namespace name that the type-parameterized tests for @@ -332,6 +326,4 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); INSTANTIATE_TYPED_TEST_SUITE_P #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ -#endif // GTEST_HAS_TYPED_TEST_P - #endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index 8dc74bb..fd70a22 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -590,8 +590,6 @@ GTEST_API_ TestInfo* MakeAndRegisterTestInfo( // and returns false. None of pstr, *pstr, and prefix can be NULL. GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr); -#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ /* class A needs to have dll-interface to be used by clients of class B */) @@ -823,8 +821,6 @@ class TypeParameterizedTestSuite { } }; -#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - // Returns the current OS stack trace as an std::string. // // The maximum number of stack frames to be included is specified by diff --git a/googletest/include/gtest/internal/gtest-type-util.h b/googletest/include/gtest/internal/gtest-type-util.h index c3326f2..5a6ca8d 100644 --- a/googletest/include/gtest/internal/gtest-type-util.h +++ b/googletest/include/gtest/internal/gtest-type-util.h @@ -98,8 +98,6 @@ std::string GetTypeName() { #endif // GTEST_HAS_RTTI } -#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - // A unique type indicating an empty node struct None {}; @@ -175,8 +173,6 @@ struct GenerateTypeList { using type = typename proxy::type; }; -#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - } // namespace internal template diff --git a/googletest/samples/sample6_unittest.cc b/googletest/samples/sample6_unittest.cc index 0266e27..da317ee 100644 --- a/googletest/samples/sample6_unittest.cc +++ b/googletest/samples/sample6_unittest.cc @@ -73,8 +73,6 @@ class PrimeTableTest : public testing::Test { PrimeTable* const table_; }; -#if GTEST_HAS_TYPED_TEST - using testing::Types; // Google Test offers two ways for reusing tests for different types. @@ -134,10 +132,6 @@ TYPED_TEST(PrimeTableTest, CanGetNextPrime) { // 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 - -#if GTEST_HAS_TYPED_TEST_P - using testing::Types; // Sometimes, however, you don't yet know all the types that you want @@ -220,5 +214,4 @@ INSTANTIATE_TYPED_TEST_SUITE_P(OnTheFlyAndPreCalculated, // Instance name PrimeTableTest2, // Test case name PrimeTableImplementations); // Type list -#endif // GTEST_HAS_TYPED_TEST_P } // namespace diff --git a/googletest/src/gtest-typed-test.cc b/googletest/src/gtest-typed-test.cc index 722c7b1..c02c3df 100644 --- a/googletest/src/gtest-typed-test.cc +++ b/googletest/src/gtest-typed-test.cc @@ -35,8 +35,6 @@ namespace testing { namespace internal { -#if GTEST_HAS_TYPED_TEST_P - // Skips to the first non-space char in str. Returns an empty string if str // contains only whitespace characters. static const char* SkipSpaces(const char* str) { @@ -105,7 +103,5 @@ const char* TypedTestSuitePState::VerifyRegisteredTestNames( return registered_tests; } -#endif // GTEST_HAS_TYPED_TEST_P - } // namespace internal } // namespace testing diff --git a/googletest/test/googletest-output-test_.cc b/googletest/test/googletest-output-test_.cc index b32b8f3..97009b5 100644 --- a/googletest/test/googletest-output-test_.cc +++ b/googletest/test/googletest-output-test_.cc @@ -744,9 +744,6 @@ TEST_P(DetectNotInstantiatedTest, Used) { } // This would make the test failure from the above go away. // INSTANTIATE_TEST_SUITE_P(Fix, DetectNotInstantiatedTest, testing::Values(1)); -// This #ifdef block tests the output of typed tests. -#if GTEST_HAS_TYPED_TEST - template class TypedTest : public testing::Test { }; @@ -783,11 +780,6 @@ TYPED_TEST(TypedTestWithNames, Success) {} TYPED_TEST(TypedTestWithNames, Failure) { FAIL(); } -#endif // GTEST_HAS_TYPED_TEST - -// This #ifdef block tests the output of type-parameterized tests. -#if GTEST_HAS_TYPED_TEST_P - template class TypedTestP : public testing::Test { }; @@ -838,8 +830,6 @@ REGISTER_TYPED_TEST_SUITE_P(DetectNotInstantiatedTypesTest, Used); // typedef ::testing::Types MyTypes; // INSTANTIATE_TYPED_TEST_SUITE_P(All, DetectNotInstantiatedTypesTest, MyTypes); -#endif // GTEST_HAS_TYPED_TEST_P - #if GTEST_HAS_DEATH_TEST // We rely on the golden file to verify that tests whose test case @@ -848,8 +838,6 @@ REGISTER_TYPED_TEST_SUITE_P(DetectNotInstantiatedTypesTest, Used); TEST(ADeathTest, ShouldRunFirst) { } -# if GTEST_HAS_TYPED_TEST - // We rely on the golden file to verify that typed tests whose test // case name ends with DeathTest are run first. @@ -863,10 +851,6 @@ TYPED_TEST_SUITE(ATypedDeathTest, NumericTypes); TYPED_TEST(ATypedDeathTest, ShouldRunFirst) { } -# endif // GTEST_HAS_TYPED_TEST - -# if GTEST_HAS_TYPED_TEST_P - // We rely on the golden file to verify that type-parameterized tests // whose test case name ends with DeathTest are run first. @@ -884,8 +868,6 @@ REGISTER_TYPED_TEST_SUITE_P(ATypeParamDeathTest, ShouldRunFirst); INSTANTIATE_TYPED_TEST_SUITE_P(My, ATypeParamDeathTest, NumericTypes); -# endif // GTEST_HAS_TYPED_TEST_P - #endif // GTEST_HAS_DEATH_TEST // Tests various failure conditions of diff --git a/googletest/test/googletest-port-test.cc b/googletest/test/googletest-port-test.cc index 4a87df0..1e0c861 100644 --- a/googletest/test/googletest-port-test.cc +++ b/googletest/test/googletest-port-test.cc @@ -373,8 +373,6 @@ TEST(RegexEngineSelectionTest, SelectsCorrectRegexEngine) { #if GTEST_USES_POSIX_RE -# if GTEST_HAS_TYPED_TEST - template class RETest : public ::testing::Test {}; @@ -430,8 +428,6 @@ TYPED_TEST(RETest, PartialMatchWorks) { EXPECT_FALSE(RE::PartialMatch(TypeParam("zza"), re)); } -# endif // GTEST_HAS_TYPED_TEST - #elif GTEST_USES_SIMPLE_RE TEST(IsInSetTest, NulCharIsNotInAnySet) { diff --git a/googletest/test/gtest-typed-test2_test.cc b/googletest/test/gtest-typed-test2_test.cc index 7000160..e83ca2e 100644 --- a/googletest/test/gtest-typed-test2_test.cc +++ b/googletest/test/gtest-typed-test2_test.cc @@ -33,12 +33,8 @@ #include "test/gtest-typed-test_test.h" #include "gtest/gtest.h" -#if GTEST_HAS_TYPED_TEST_P - // Tests that the same type-parameterized test case can be // instantiated in different translation units linked together. // (ContainerTest is also instantiated in gtest-typed-test_test.cc.) INSTANTIATE_TYPED_TEST_SUITE_P(Vector, ContainerTest, testing::Types >); - -#endif // GTEST_HAS_TYPED_TEST_P diff --git a/googletest/test/gtest-typed-test_test.cc b/googletest/test/gtest-typed-test_test.cc index de1db0c..5fc678c 100644 --- a/googletest/test/gtest-typed-test_test.cc +++ b/googletest/test/gtest-typed-test_test.cc @@ -88,9 +88,6 @@ class CommonTest : public Test { template T* CommonTest::shared_ = nullptr; -// This #ifdef block tests typed tests. -#if GTEST_HAS_TYPED_TEST - using testing::Types; // Tests that SetUpTestSuite()/TearDownTestSuite(), fixture ctor/dtor, @@ -204,11 +201,6 @@ TYPED_TEST(TypedTestWithNames, TestSuiteName) { } } -#endif // GTEST_HAS_TYPED_TEST - -// This #ifdef block tests type-parameterized tests. -#if GTEST_HAS_TYPED_TEST_P - using testing::Types; using testing::internal::TypedTestSuitePState; @@ -443,20 +435,3 @@ INSTANTIATE_TYPED_TEST_SUITE_P(My, TrimmedTest, TrimTypes); } // namespace library2 -#endif // GTEST_HAS_TYPED_TEST_P - -#if !defined(GTEST_HAS_TYPED_TEST) && !defined(GTEST_HAS_TYPED_TEST_P) - -// Google Test may not support type-parameterized tests with some -// compilers. If we use conditional compilation to compile out all -// code referring to the gtest_main library, MSVC linker will not link -// that library at all and consequently complain about missing entry -// point defined in that library (fatal error LNK1561: entry point -// must be defined). This dummy test keeps gtest_main linked in. -TEST(DummyTest, TypedTestsAreNotSupportedOnThisPlatform) {} - -#if _MSC_VER -GTEST_DISABLE_MSC_WARNINGS_POP_() // 4127 -#endif // _MSC_VER - -#endif // #if !defined(GTEST_HAS_TYPED_TEST) && !defined(GTEST_HAS_TYPED_TEST_P) diff --git a/googletest/test/gtest-typed-test_test.h b/googletest/test/gtest-typed-test_test.h index 23137b7..079b152 100644 --- a/googletest/test/gtest-typed-test_test.h +++ b/googletest/test/gtest-typed-test_test.h @@ -33,8 +33,6 @@ #include "gtest/gtest.h" -#if GTEST_HAS_TYPED_TEST_P - using testing::Test; // For testing that the same type-parameterized test case can be @@ -60,6 +58,4 @@ TYPED_TEST_P(ContainerTest, InitialSizeIsZero) { REGISTER_TYPED_TEST_SUITE_P(ContainerTest, CanBeDefaultConstructed, InitialSizeIsZero); -#endif // GTEST_HAS_TYPED_TEST_P - #endif // GTEST_TEST_GTEST_TYPED_TEST_TEST_H_ diff --git a/googletest/test/gtest-unittest-api_test.cc b/googletest/test/gtest-unittest-api_test.cc index 25a8afb..8ef5058 100644 --- a/googletest/test/gtest-unittest-api_test.cc +++ b/googletest/test/gtest-unittest-api_test.cc @@ -95,17 +95,12 @@ class UnitTestHelper { } }; -#if GTEST_HAS_TYPED_TEST template class TestSuiteWithCommentTest : public Test {}; TYPED_TEST_SUITE(TestSuiteWithCommentTest, Types); TYPED_TEST(TestSuiteWithCommentTest, Dummy) {} const int kTypedTestSuites = 1; const int kTypedTests = 1; -#else -const int kTypedTestSuites = 0; -const int kTypedTests = 0; -#endif // GTEST_HAS_TYPED_TEST // We can only test the accessors that do not change value while tests run. // Since tests can be run in any order, the values the accessors that track @@ -123,9 +118,7 @@ TEST(ApiTest, UnitTestImmutableAccessorsWork) { EXPECT_STREQ("ApiTest", test_suites[0]->name()); EXPECT_STREQ("DISABLED_Test", test_suites[1]->name()); -#if GTEST_HAS_TYPED_TEST EXPECT_STREQ("TestSuiteWithCommentTest/0", test_suites[2]->name()); -#endif // GTEST_HAS_TYPED_TEST delete[] test_suites; @@ -183,7 +176,6 @@ TEST(ApiTest, TestSuiteImmutableAccessorsWork) { delete[] tests; tests = nullptr; -#if GTEST_HAS_TYPED_TEST test_suite = UnitTestHelper::FindTestSuite("TestSuiteWithCommentTest/0"); ASSERT_TRUE(test_suite != nullptr); @@ -203,7 +195,6 @@ TEST(ApiTest, TestSuiteImmutableAccessorsWork) { EXPECT_TRUE(tests[0]->should_run()); delete[] tests; -#endif // GTEST_HAS_TYPED_TEST } TEST(ApiTest, TestSuiteDisabledAccessorsWork) { @@ -263,7 +254,6 @@ class FinalSuccessChecker : public Environment { EXPECT_EQ(0, test_suites[1]->successful_test_count()); EXPECT_EQ(0, test_suites[1]->failed_test_count()); -#if GTEST_HAS_TYPED_TEST EXPECT_STREQ("TestSuiteWithCommentTest/0", test_suites[2]->name()); EXPECT_STREQ(GetTypeName>().c_str(), test_suites[2]->type_param()); @@ -274,7 +264,6 @@ class FinalSuccessChecker : public Environment { EXPECT_EQ(0, test_suites[2]->failed_test_count()); EXPECT_TRUE(test_suites[2]->Passed()); EXPECT_FALSE(test_suites[2]->Failed()); -#endif // GTEST_HAS_TYPED_TEST const TestSuite* test_suite = UnitTestHelper::FindTestSuite("ApiTest"); const TestInfo** tests = UnitTestHelper::GetSortedTests(test_suite); @@ -311,7 +300,6 @@ class FinalSuccessChecker : public Environment { delete[] tests; -#if GTEST_HAS_TYPED_TEST test_suite = UnitTestHelper::FindTestSuite("TestSuiteWithCommentTest/0"); tests = UnitTestHelper::GetSortedTests(test_suite); @@ -324,7 +312,6 @@ class FinalSuccessChecker : public Environment { EXPECT_EQ(0, tests[0]->result()->test_property_count()); delete[] tests; -#endif // GTEST_HAS_TYPED_TEST delete[] test_suites; } }; diff --git a/googletest/test/gtest_list_output_unittest.py b/googletest/test/gtest_list_output_unittest.py index b882126..a442fc1 100644 --- a/googletest/test/gtest_list_output_unittest.py +++ b/googletest/test/gtest_list_output_unittest.py @@ -56,20 +56,20 @@ EXPECTED_XML = """<\?xml version="1.0" encoding="UTF-8"\?> - - + + - - + + - - + + - - + + @@ -124,13 +124,13 @@ EXPECTED_JSON = """{ "name": "Test7", "type_param": "int", "file": ".*gtest_list_output_unittest_.cc", - "line": 61 + "line": 60 }, { "name": "Test8", "type_param": "int", "file": ".*gtest_list_output_unittest_.cc", - "line": 62 + "line": 61 } \] }, @@ -142,13 +142,13 @@ EXPECTED_JSON = """{ "name": "Test7", "type_param": "bool", "file": ".*gtest_list_output_unittest_.cc", - "line": 61 + "line": 60 }, { "name": "Test8", "type_param": "bool", "file": ".*gtest_list_output_unittest_.cc", - "line": 62 + "line": 61 } \] }, @@ -160,13 +160,13 @@ EXPECTED_JSON = """{ "name": "Test9", "type_param": "int", "file": ".*gtest_list_output_unittest_.cc", - "line": 69 + "line": 66 }, { "name": "Test10", "type_param": "int", "file": ".*gtest_list_output_unittest_.cc", - "line": 70 + "line": 67 } \] }, @@ -178,13 +178,13 @@ EXPECTED_JSON = """{ "name": "Test9", "type_param": "bool", "file": ".*gtest_list_output_unittest_.cc", - "line": 69 + "line": 66 }, { "name": "Test10", "type_param": "bool", "file": ".*gtest_list_output_unittest_.cc", - "line": 70 + "line": 67 } \] }, diff --git a/googletest/test/gtest_list_output_unittest_.cc b/googletest/test/gtest_list_output_unittest_.cc index 2eea3eb..92b9d4f 100644 --- a/googletest/test/gtest_list_output_unittest_.cc +++ b/googletest/test/gtest_list_output_unittest_.cc @@ -53,16 +53,13 @@ TEST_P(ValueParamTest, Test5) {} TEST_P(ValueParamTest, Test6) {} INSTANTIATE_TEST_SUITE_P(ValueParam, ValueParamTest, ::testing::Values(33, 42)); -#if GTEST_HAS_TYPED_TEST template class TypedTest : public ::testing::Test {}; typedef testing::Types TypedTestTypes; TYPED_TEST_SUITE(TypedTest, TypedTestTypes); TYPED_TEST(TypedTest, Test7) {} TYPED_TEST(TypedTest, Test8) {} -#endif -#if GTEST_HAS_TYPED_TEST_P template class TypeParameterizedTestSuite : public ::testing::Test {}; TYPED_TEST_SUITE_P(TypeParameterizedTestSuite); @@ -72,7 +69,6 @@ REGISTER_TYPED_TEST_SUITE_P(TypeParameterizedTestSuite, Test9, Test10); typedef testing::Types TypeParameterizedTestSuiteTypes; // NOLINT INSTANTIATE_TYPED_TEST_SUITE_P(Single, TypeParameterizedTestSuite, TypeParameterizedTestSuiteTypes); -#endif int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index ac0f179..1730e8b 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -3187,8 +3187,6 @@ TEST_F(DisabledTestsTest, DISABLED_TestShouldNotRun_2) { // Tests that disabled typed tests aren't run. -#if GTEST_HAS_TYPED_TEST - template class TypedTest : public Test { }; @@ -3210,12 +3208,8 @@ TYPED_TEST(DISABLED_TypedTest, ShouldNotRun) { FAIL() << "Unexpected failure: Disabled typed test should not run."; } -#endif // GTEST_HAS_TYPED_TEST - // Tests that disabled type-parameterized tests aren't run. -#if GTEST_HAS_TYPED_TEST_P - template class TypedTestP : public Test { }; @@ -3246,8 +3240,6 @@ REGISTER_TYPED_TEST_SUITE_P(DISABLED_TypedTestP, ShouldNotRun); INSTANTIATE_TYPED_TEST_SUITE_P(My, DISABLED_TypedTestP, NumericTypes); -#endif // GTEST_HAS_TYPED_TEST_P - // Tests that assertion macros evaluate their arguments exactly once. class SingleEvaluationTest : public Test { diff --git a/googletest/test/gtest_xml_output_unittest_.cc b/googletest/test/gtest_xml_output_unittest_.cc index 2b6634b..c0036aa 100644 --- a/googletest/test/gtest_xml_output_unittest_.cc +++ b/googletest/test/gtest_xml_output_unittest_.cc @@ -163,16 +163,13 @@ TEST_P(ValueParamTest, HasValueParamAttribute) {} TEST_P(ValueParamTest, AnotherTestThatHasValueParamAttribute) {} INSTANTIATE_TEST_SUITE_P(Single, ValueParamTest, Values(33, 42)); -#if GTEST_HAS_TYPED_TEST // Verifies that the type parameter name is output in the 'type_param' // XML attribute for typed tests. template class TypedTest : public Test {}; typedef testing::Types TypedTestTypes; TYPED_TEST_SUITE(TypedTest, TypedTestTypes); TYPED_TEST(TypedTest, HasTypeParamAttribute) {} -#endif -#if GTEST_HAS_TYPED_TEST_P // Verifies that the type parameter name is output in the 'type_param' // XML attribute for type-parameterized tests. template @@ -183,7 +180,6 @@ REGISTER_TYPED_TEST_SUITE_P(TypeParameterizedTestSuite, HasTypeParamAttribute); typedef testing::Types TypeParameterizedTestSuiteTypes; // NOLINT INSTANTIATE_TYPED_TEST_SUITE_P(Single, TypeParameterizedTestSuite, TypeParameterizedTestSuiteTypes); -#endif int main(int argc, char** argv) { InitGoogleTest(&argc, argv); -- cgit v0.12