summaryrefslogtreecommitdiffstats
path: root/googletest/include
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2019-10-10 22:04:20 (GMT)
committerGennadiy Civil <misterg@google.com>2019-10-11 11:07:03 (GMT)
commita4a5a7c768ceaf8fdc79ccf1d9e3bfb9f481efa6 (patch)
tree240f5c8290e2c2f895e95deb35a66bdfe6616083 /googletest/include
parented78e54f38ab10c775e39e5c4d500c6134a60d64 (diff)
downloadgoogletest-a4a5a7c768ceaf8fdc79ccf1d9e3bfb9f481efa6.zip
googletest-a4a5a7c768ceaf8fdc79ccf1d9e3bfb9f481efa6.tar.gz
googletest-a4a5a7c768ceaf8fdc79ccf1d9e3bfb9f481efa6.tar.bz2
Googletest export
- Fix a bug in dealing with paramaterized tests where the name is it self a macro expansion. - Add a compile time check to ensure that the parameters to TEST_P and INSTANTIATE_TEST_SUITE_P are not empty. The above fix causes some compilers to fail in that case and even where it works, it's likely to result in technically invalid code by virtue of creating reserved identifiers: https://en.cppreference.com/w/cpp/language/identifiers PiperOrigin-RevId: 274047249
Diffstat (limited to 'googletest/include')
-rw-r--r--googletest/include/gtest/gtest-param-test.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/googletest/include/gtest/gtest-param-test.h b/googletest/include/gtest/gtest-param-test.h
index 9989765..f61e3c5 100644
--- a/googletest/include/gtest/gtest-param-test.h
+++ b/googletest/include/gtest/gtest-param-test.h
@@ -429,7 +429,7 @@ internal::CartesianProductHolder<Generator...> Combine(const Generator&... g) {
::testing::UnitTest::GetInstance() \
->parameterized_test_registry() \
.GetTestSuitePatternHolder<test_suite_name>( \
- #test_suite_name, \
+ GTEST_STRINGIFY_(test_suite_name), \
::testing::internal::CodeLocation(__FILE__, __LINE__)) \
->AddTestPattern( \
GTEST_STRINGIFY_(test_suite_name), GTEST_STRINGIFY_(test_name), \
@@ -493,10 +493,11 @@ internal::CartesianProductHolder<Generator...> Combine(const Generator&... g) {
::testing::UnitTest::GetInstance() \
->parameterized_test_registry() \
.GetTestSuitePatternHolder<test_suite_name>( \
- #test_suite_name, \
+ GTEST_STRINGIFY_(test_suite_name), \
::testing::internal::CodeLocation(__FILE__, __LINE__)) \
->AddTestSuiteInstantiation( \
- #prefix, &gtest_##prefix##test_suite_name##_EvalGenerator_, \
+ GTEST_STRINGIFY_(prefix), \
+ &gtest_##prefix##test_suite_name##_EvalGenerator_, \
&gtest_##prefix##test_suite_name##_EvalGenerateName_, \
__FILE__, __LINE__)