Simplifies the tests using EXPECT_DEATH_IF_SUPPORTED.

This commit is contained in:
zhanyong.wan
2009-09-11 07:01:08 +00:00
parent d6ffd13698
commit 04d6ed817e
5 changed files with 23 additions and 60 deletions

View File

@@ -472,21 +472,17 @@ TEST(AssertTest, SucceedsOnTrue) {
Assert(true, __FILE__, __LINE__); // This should succeed too.
}
#if GTEST_HAS_DEATH_TEST
// Tests that Assert(false, ...) generates a fatal failure.
TEST(AssertTest, FailsFatallyOnFalse) {
EXPECT_DEATH({ // NOLINT
EXPECT_DEATH_IF_SUPPORTED({
Assert(false, __FILE__, __LINE__, "This should fail.");
}, "");
EXPECT_DEATH({ // NOLINT
EXPECT_DEATH_IF_SUPPORTED({
Assert(false, __FILE__, __LINE__);
}, "");
}
#endif // GTEST_HAS_DEATH_TEST
// Tests that Expect(true, ...) succeeds.
TEST(ExpectTest, SucceedsOnTrue) {
Expect(true, __FILE__, __LINE__, "This should succeed.");