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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user