summaryrefslogtreecommitdiff
path: root/test/gtest-typed-test_test.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-11 06:59:42 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-11 06:59:42 +0000
commitd541f0259d2f6857df769f581363f84e8c4b2899 (patch)
treee9ef0e2d46fce05fcdf325c28b21c0c412567eda /test/gtest-typed-test_test.cc
parent6e6850626b2058ee7ec1be7a98b6aebaf403a3aa (diff)
downloadgoogletest-d541f0259d2f6857df769f581363f84e8c4b2899.tar.gz
Improves EXPECT_DEATH_IF_SUPPORTED to allow streaming of messages and enforcing the validity of arguments (by Vlad Losev); adds samples for the event listener API (by Vlad Losev); simplifies the tests using EXPECT_DEATH_IF_SUPPORTED (by Zhanyong Wan).
git-svn-id: http://googletest.googlecode.com/svn/trunk@305 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'test/gtest-typed-test_test.cc')
-rw-r--r--test/gtest-typed-test_test.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/test/gtest-typed-test_test.cc b/test/gtest-typed-test_test.cc
index 8e86ac8..e97598f 100644
--- a/test/gtest-typed-test_test.cc
+++ b/test/gtest-typed-test_test.cc
@@ -198,24 +198,22 @@ TEST_F(TypedTestCasePStateTest, IgnoresOrderAndSpaces) {
state_.VerifyRegisteredTestNames("foo.cc", 1, tests));
}
-#if GTEST_HAS_DEATH_TEST
-
typedef TypedTestCasePStateTest TypedTestCasePStateDeathTest;
TEST_F(TypedTestCasePStateDeathTest, DetectsDuplicates) {
- EXPECT_DEATH(
+ EXPECT_DEATH_IF_SUPPORTED(
state_.VerifyRegisteredTestNames("foo.cc", 1, "A, B, A, C"),
"foo\\.cc.1.?: Test A is listed more than once\\.");
}
TEST_F(TypedTestCasePStateDeathTest, DetectsExtraTest) {
- EXPECT_DEATH(
+ EXPECT_DEATH_IF_SUPPORTED(
state_.VerifyRegisteredTestNames("foo.cc", 1, "A, B, C, D"),
"foo\\.cc.1.?: No test named D can be found in this test case\\.");
}
TEST_F(TypedTestCasePStateDeathTest, DetectsMissedTest) {
- EXPECT_DEATH(
+ EXPECT_DEATH_IF_SUPPORTED(
state_.VerifyRegisteredTestNames("foo.cc", 1, "A, C"),
"foo\\.cc.1.?: You forgot to list test B\\.");
}
@@ -224,14 +222,12 @@ TEST_F(TypedTestCasePStateDeathTest, DetectsMissedTest) {
// a run-time error if the test case has been registered.
TEST_F(TypedTestCasePStateDeathTest, DetectsTestAfterRegistration) {
state_.VerifyRegisteredTestNames("foo.cc", 1, "A, B, C");
- EXPECT_DEATH(
+ EXPECT_DEATH_IF_SUPPORTED(
state_.AddTestName("foo.cc", 2, "FooTest", "D"),
"foo\\.cc.2.?: Test D must be defined before REGISTER_TYPED_TEST_CASE_P"
"\\(FooTest, \\.\\.\\.\\)\\.");
}
-#endif // GTEST_HAS_DEATH_TEST
-
// Tests that SetUpTestCase()/TearDownTestCase(), fixture ctor/dtor,
// and SetUp()/TearDown() work correctly in type-parameterized tests.