summaryrefslogtreecommitdiffstats
path: root/googletest/include
diff options
context:
space:
mode:
authorDerek Mauro <dmauro@google.com>2020-08-07 17:08:18 (GMT)
committerDerek Mauro <dmauro@google.com>2020-08-07 17:08:18 (GMT)
commitce654c2ff5cce36a1f7481352be28cc3068fe0f1 (patch)
treeda46a2674fbb5b08b2ad9066c63b4f69ba7782d7 /googletest/include
parentd0de618a58d5dcf1014123fc5e829a307066bf9a (diff)
parentb612003c388e0ad4abb56eeff4c8c825e0a06448 (diff)
downloadgoogletest-ce654c2ff5cce36a1f7481352be28cc3068fe0f1.zip
googletest-ce654c2ff5cce36a1f7481352be28cc3068fe0f1.tar.gz
googletest-ce654c2ff5cce36a1f7481352be28cc3068fe0f1.tar.bz2
Merge pull request #2972 from srz-zumix:fix/remove_legacy_testcase_api_
PiperOrigin-RevId: 325220934
Diffstat (limited to 'googletest/include')
-rw-r--r--googletest/include/gtest/internal/gtest-internal.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h
index 288ff93..233724c 100644
--- a/googletest/include/gtest/internal/gtest-internal.h
+++ b/googletest/include/gtest/internal/gtest-internal.h
@@ -520,6 +520,7 @@ struct SuiteApiResolver : T {
static SetUpTearDownSuiteFuncType GetSetUpCaseOrSuite(const char* filename,
int line_num) {
+#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
SetUpTearDownSuiteFuncType test_case_fp =
GetNotDefaultOrNull(&T::SetUpTestCase, &Test::SetUpTestCase);
SetUpTearDownSuiteFuncType test_suite_fp =
@@ -531,10 +532,16 @@ struct SuiteApiResolver : T {
<< filename << ":" << line_num;
return test_case_fp != nullptr ? test_case_fp : test_suite_fp;
+#else
+ (void)(filename);
+ (void)(line_num);
+ return &T::SetUpTestSuite;
+#endif
}
static SetUpTearDownSuiteFuncType GetTearDownCaseOrSuite(const char* filename,
int line_num) {
+#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
SetUpTearDownSuiteFuncType test_case_fp =
GetNotDefaultOrNull(&T::TearDownTestCase, &Test::TearDownTestCase);
SetUpTearDownSuiteFuncType test_suite_fp =
@@ -546,6 +553,11 @@ struct SuiteApiResolver : T {
<< filename << ":" << line_num;
return test_case_fp != nullptr ? test_case_fp : test_suite_fp;
+#else
+ (void)(filename);
+ (void)(line_num);
+ return &T::TearDownTestSuite;
+#endif
}
};