Modifies handling of C++ exceptions in death tests to treat exceptions escaping them as failures.

This commit is contained in:
vladlosev
2010-10-18 22:09:55 +00:00
parent 2c81010523
commit 50f4deb1cf
5 changed files with 160 additions and 15 deletions

View File

@@ -538,15 +538,18 @@ TEST_F(TestForDeathTest, SingleEvaluation) {
}
// Tests that run-away death tests are reported as failures.
TEST_F(TestForDeathTest, Runaway) {
TEST_F(TestForDeathTest, RunawayIsFailure) {
EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(static_cast<void>(0), "Foo"),
"failed to die.");
}
// Tests that death tests report executing 'return' in the statement as
// failure.
TEST_F(TestForDeathTest, ReturnIsFailure) {
EXPECT_FATAL_FAILURE(ASSERT_DEATH(return, "Bar"),
"illegal return in test statement.");
}
// Tests that EXPECT_DEBUG_DEATH works as expected,
// that is, in debug mode, it:
// 1. Asserts on death.