summaryrefslogtreecommitdiffstats
path: root/googletest/test
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2019-10-09 22:14:17 (GMT)
committerGennadiy Civil <misterg@google.com>2019-10-10 13:21:56 (GMT)
commit20b5b8ecc7a81d23b4716e22a2b35fd53379c8c6 (patch)
tree112322a7b2b59de35e9c48e17b2b6adfce2b3e2d /googletest/test
parent5395345ca4f0c596110188688ed990e0de5a181c (diff)
downloadgoogletest-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.txt6
-rw-r--r--googletest/test/googletest-output-test_.cc2
-rw-r--r--googletest/test/gtest_unittest.cc2
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)
[ FAILED ] PrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
-[----------] 1 test from EmptyBasenameParamInst
-[ RUN ] EmptyBasenameParamInst.Passes/0
-[ OK ] EmptyBasenameParamInst.Passes/0
+[----------] 1 test from All/EmptyBasenameParamInst
+[ RUN ] All/EmptyBasenameParamInst.Passes/0
+[ OK ] All/EmptyBasenameParamInst.Passes/0
[----------] 2 tests from PrintingStrings/ParamTest
[ RUN ] PrintingStrings/ParamTest.Success/a
[ OK ] PrintingStrings/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 {