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

@@ -65,8 +65,6 @@ TEST(GmockCheckSyntaxTest, WorksWithSwitch) {
GMOCK_CHECK_(true) << "Check failed in switch case";
}
#if GTEST_HAS_DEATH_TEST
TEST(GmockCheckDeathTest, DiesWithCorrectOutputOnFailure) {
const bool a_false_condition = false;
// MSVC and gcc use different formats to print source file locations.
@@ -81,9 +79,12 @@ TEST(GmockCheckDeathTest, DiesWithCorrectOutputOnFailure) {
#endif // _MSC_VER
".*a_false_condition.*Extra info";
EXPECT_DEATH(GMOCK_CHECK_(a_false_condition) << "Extra info", regex);
EXPECT_DEATH_IF_SUPPORTED(GMOCK_CHECK_(a_false_condition) << "Extra info",
regex);
}
#if GTEST_HAS_DEATH_TEST
TEST(GmockCheckDeathTest, LivesSilentlyOnSuccess) {
EXPECT_EXIT({
GMOCK_CHECK_(true) << "Extra info";