diff options
author | Abseil Team <absl-team@google.com> | 2019-10-09 22:14:17 (GMT) |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2019-10-10 13:21:56 (GMT) |
commit | 20b5b8ecc7a81d23b4716e22a2b35fd53379c8c6 (patch) | |
tree | 112322a7b2b59de35e9c48e17b2b6adfce2b3e2d /googletest/test | |
parent | 5395345ca4f0c596110188688ed990e0de5a181c (diff) | |
download | googletest-20b5b8ecc7a81d23b4716e22a2b35fd53379c8c6.zip googletest-20b5b8ecc7a81d23b4716e22a2b35fd53379c8c6.tar.gz googletest-20b5b8ecc7a81d23b4716e22a2b35fd53379c8c6.tar.bz2 |
Googletest export
Add a compile time check to ensure that the parameters to TEST_P and INSTANTIATE_TEST_SUITE_P are not empty. Some compilers already 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: 273832263
Diffstat (limited to 'googletest/test')
-rw-r--r-- | googletest/test/googletest-output-test-golden-lin.txt | 6 | ||||
-rw-r--r-- | googletest/test/googletest-output-test_.cc | 2 | ||||
-rw-r--r-- | googletest/test/gtest_unittest.cc | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/googletest/test/googletest-output-test-golden-lin.txt b/googletest/test/googletest-output-test-golden-lin.txt index 038de92..de777cf 100644 --- a/googletest/test/googletest-output-test-golden-lin.txt +++ b/googletest/test/googletest-output-test-golden-lin.txt @@ -966,9 +966,9 @@ Expected equality of these values: Stack trace: (omitted) [0;31m[ FAILED ] [mPrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2 -[0;32m[----------] [m1 test from EmptyBasenameParamInst -[0;32m[ RUN ] [mEmptyBasenameParamInst.Passes/0 -[0;32m[ OK ] [mEmptyBasenameParamInst.Passes/0 +[0;32m[----------] [m1 test from All/EmptyBasenameParamInst +[0;32m[ RUN ] [mAll/EmptyBasenameParamInst.Passes/0 +[0;32m[ OK ] [mAll/EmptyBasenameParamInst.Passes/0 [0;32m[----------] [m2 tests from PrintingStrings/ParamTest [0;32m[ RUN ] [mPrintingStrings/ParamTest.Success/a [0;32m[ OK ] [mPrintingStrings/ParamTest.Success/a diff --git a/googletest/test/googletest-output-test_.cc b/googletest/test/googletest-output-test_.cc index 4f716d8..8de2bd1 100644 --- a/googletest/test/googletest-output-test_.cc +++ b/googletest/test/googletest-output-test_.cc @@ -102,7 +102,7 @@ class EmptyBasenameParamInst : public testing::TestWithParam<int> {}; TEST_P(EmptyBasenameParamInst, Passes) { EXPECT_EQ(1, GetParam()); } -INSTANTIATE_TEST_SUITE_P(, EmptyBasenameParamInst, testing::Values(1)); +INSTANTIATE_TEST_SUITE_P(All, EmptyBasenameParamInst, testing::Values(1)); static const char kGoldenString[] = "\"Line\0 1\"\nLine 2"; diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index 39749b7..05ee1c7 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -5343,7 +5343,7 @@ TEST_P(CodeLocationForTESTP, Verify) { VERIFY_CODE_LOCATION; } -INSTANTIATE_TEST_SUITE_P(, CodeLocationForTESTP, Values(0)); +INSTANTIATE_TEST_SUITE_P(All, CodeLocationForTESTP, Values(0)); template <typename T> class CodeLocationForTYPEDTEST : public Test { |