summaryrefslogtreecommitdiffstats
path: root/googletest/test
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-08-29 04:09:04 -0400
committerGennadiy Civil <misterg@google.com>2018-08-30 21:32:54 -0400
commit00d1ffc8c85234fb8fe873d1591374289de1356d (patch)
treec5550317141a2b534b7082b1e7bf3b890ecdf588 /googletest/test
parent2cc008538c97189a5130a5598c62574c4972bef4 (diff)
downloadgoogletest-00d1ffc8c85234fb8fe873d1591374289de1356d.tar.gz
googletest-00d1ffc8c85234fb8fe873d1591374289de1356d.zip
Googletest export
Fix the typed test names in the tests for customized typed test parameters. As required by googletest documentation, the names should not contain an underscore. PiperOrigin-RevId: 210678652
Diffstat (limited to 'googletest/test')
-rw-r--r--googletest/test/googletest-output-test_.cc8
-rw-r--r--googletest/test/gtest-typed-test_test.cc16
2 files changed, 12 insertions, 12 deletions
diff --git a/googletest/test/googletest-output-test_.cc b/googletest/test/googletest-output-test_.cc
index d6f7e0ba..df82517a 100644
--- a/googletest/test/googletest-output-test_.cc
+++ b/googletest/test/googletest-output-test_.cc
@@ -811,9 +811,9 @@ class TypedTestNames {
template <typename T>
static std::string GetName(int i) {
if (testing::internal::IsSame<T, char>::value)
- return std::string("char_") + ::testing::PrintToString(i);
+ return std::string("char") + ::testing::PrintToString(i);
if (testing::internal::IsSame<T, int>::value)
- return std::string("int_") + ::testing::PrintToString(i);
+ return std::string("int") + ::testing::PrintToString(i);
}
};
@@ -852,10 +852,10 @@ class TypedTestPNames {
template <typename T>
static std::string GetName(int i) {
if (testing::internal::IsSame<T, unsigned char>::value) {
- return std::string("unsigned_char_") + ::testing::PrintToString(i);
+ return std::string("unsignedChar") + ::testing::PrintToString(i);
}
if (testing::internal::IsSame<T, unsigned int>::value) {
- return std::string("unsigned_int_") + ::testing::PrintToString(i);
+ return std::string("unsignedInt") + ::testing::PrintToString(i);
}
}
};
diff --git a/googletest/test/gtest-typed-test_test.cc b/googletest/test/gtest-typed-test_test.cc
index e9eed639..b2457301 100644
--- a/googletest/test/gtest-typed-test_test.cc
+++ b/googletest/test/gtest-typed-test_test.cc
@@ -174,10 +174,10 @@ class TypedTestNames {
template <typename T>
static std::string GetName(int i) {
if (testing::internal::IsSame<T, char>::value) {
- return std::string("char_") + ::testing::PrintToString(i);
+ return std::string("char") + ::testing::PrintToString(i);
}
if (testing::internal::IsSame<T, int>::value) {
- return std::string("int_") + ::testing::PrintToString(i);
+ return std::string("int") + ::testing::PrintToString(i);
}
}
};
@@ -189,13 +189,13 @@ TYPED_TEST(TypedTestWithNames, TestCaseName) {
EXPECT_STREQ(::testing::UnitTest::GetInstance()
->current_test_info()
->test_case_name(),
- "TypedTestWithNames/char_0");
+ "TypedTestWithNames/char0");
}
if (testing::internal::IsSame<TypeParam, int>::value) {
EXPECT_STREQ(::testing::UnitTest::GetInstance()
->current_test_info()
->test_case_name(),
- "TypedTestWithNames/int_1");
+ "TypedTestWithNames/int1");
}
}
@@ -311,13 +311,13 @@ TYPED_TEST_P(TypeParametrizedTestWithNames, TestCaseName) {
EXPECT_STREQ(::testing::UnitTest::GetInstance()
->current_test_info()
->test_case_name(),
- "CustomName/TypeParametrizedTestWithNames/p_char_0");
+ "CustomName/TypeParametrizedTestWithNames/parChar0");
}
if (testing::internal::IsSame<TypeParam, int>::value) {
EXPECT_STREQ(::testing::UnitTest::GetInstance()
->current_test_info()
->test_case_name(),
- "CustomName/TypeParametrizedTestWithNames/p_int_1");
+ "CustomName/TypeParametrizedTestWithNames/parInt1");
}
}
@@ -328,10 +328,10 @@ class TypeParametrizedTestNames {
template <typename T>
static std::string GetName(int i) {
if (testing::internal::IsSame<T, char>::value) {
- return std::string("p_char_") + ::testing::PrintToString(i);
+ return std::string("parChar") + ::testing::PrintToString(i);
}
if (testing::internal::IsSame<T, int>::value) {
- return std::string("p_int_") + ::testing::PrintToString(i);
+ return std::string("parInt") + ::testing::PrintToString(i);
}
}
};
OpenPOWER on IntegriCloud