Modifies handling of C++ exceptions in death tests to treat exceptions escaping them as failures.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user