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).

This commit is contained in:
zhanyong.wan
2009-09-11 06:59:42 +00:00
parent f6dd67a155
commit b2ee82ebf9
12 changed files with 497 additions and 41 deletions

View File

@@ -146,8 +146,6 @@ TEST_F(TestPartResultArrayTest, ContainsGivenResultsAfterTwoAppends) {
EXPECT_STREQ("Failure 2", results.GetTestPartResult(1).message());
}
#if GTEST_HAS_DEATH_TEST
typedef TestPartResultArrayTest TestPartResultArrayDeathTest;
// Tests that the program dies when GetTestPartResult() is called with
@@ -156,12 +154,10 @@ TEST_F(TestPartResultArrayDeathTest, DiesWhenIndexIsOutOfBound) {
TestPartResultArray results;
results.Append(r1_);
EXPECT_DEATH(results.GetTestPartResult(-1), "");
EXPECT_DEATH(results.GetTestPartResult(1), "");
EXPECT_DEATH_IF_SUPPORTED(results.GetTestPartResult(-1), "");
EXPECT_DEATH_IF_SUPPORTED(results.GetTestPartResult(1), "");
}
#endif // GTEST_HAS_DEATH_TEST
// TODO(mheule@google.com): Add a test for the class HasNewFatalFailureHelper.
} // namespace