aboutsummaryrefslogtreecommitdiffstats
path: root/test/gtest-param-test_test.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2011-02-02 00:49:33 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2011-02-02 00:49:33 +0000
commit9bcf4d0a654b27732e2fa901fe98c09aba71773a (patch)
treed2072cc7bdd2f9df2f35f85258d8c0e10e80691a /test/gtest-param-test_test.cc
parentc8efea670544c86a169f920c567a9dae86227e95 (diff)
downloadgoogletest-9bcf4d0a654b27732e2fa901fe98c09aba71773a.tar.gz
googletest-9bcf4d0a654b27732e2fa901fe98c09aba71773a.tar.bz2
googletest-9bcf4d0a654b27732e2fa901fe98c09aba71773a.zip
Adds type_param and value_param as <testcase> attributes to the XML
report; also removes the comment() and test_case_comment() fields of TestInfo. Proposed and initally implemented by Joey Oravec. Re-implemented by Vlad Losev.
Diffstat (limited to 'test/gtest-param-test_test.cc')
-rw-r--r--test/gtest-param-test_test.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/gtest-param-test_test.cc b/test/gtest-param-test_test.cc
index acd269bc..5a681d83 100644
--- a/test/gtest-param-test_test.cc
+++ b/test/gtest-param-test_test.cc
@@ -792,19 +792,17 @@ INSTANTIATE_TEST_CASE_P(FourElemSequence, SeparateInstanceTest, Range(1, 4));
// sequence element used to instantiate the test.
class NamingTest : public TestWithParam<int> {};
-TEST_P(NamingTest, TestsAreNamedAndCommentedCorrectly) {
+TEST_P(NamingTest, TestsReportCorrectNamesAndParameters) {
const ::testing::TestInfo* const test_info =
::testing::UnitTest::GetInstance()->current_test_info();
EXPECT_STREQ("ZeroToFiveSequence/NamingTest", test_info->test_case_name());
Message index_stream;
- index_stream << "TestsAreNamedAndCommentedCorrectly/" << GetParam();
+ index_stream << "TestsReportCorrectNamesAndParameters/" << GetParam();
EXPECT_STREQ(index_stream.GetString().c_str(), test_info->name());
- const ::std::string comment =
- "GetParam() = " + ::testing::PrintToString(GetParam());
- EXPECT_EQ(comment, test_info->comment());
+ EXPECT_EQ(::testing::PrintToString(GetParam()), test_info->value_param());
}
INSTANTIATE_TEST_CASE_P(ZeroToFiveSequence, NamingTest, Range(0, 5));
@@ -823,13 +821,11 @@ class Unstreamable {
class CommentTest : public TestWithParam<Unstreamable> {};
-TEST_P(CommentTest, TestsWithUnstreamableParamsCommentedCorrectly) {
+TEST_P(CommentTest, TestsCorrectlyReportUnstreamableParams) {
const ::testing::TestInfo* const test_info =
::testing::UnitTest::GetInstance()->current_test_info();
- const ::std::string comment =
- "GetParam() = " + ::testing::PrintToString(GetParam());
- EXPECT_EQ(comment, test_info->comment());
+ EXPECT_EQ(::testing::PrintToString(GetParam()), test_info->value_param());
}
INSTANTIATE_TEST_CASE_P(InstantiationWithComments,