From f8b268ee86ca74bba3276352f1e7de53d1336c3e Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Wed, 30 Sep 2009 20:23:50 +0000 Subject: Makes gtest compile cleanly with MSVC's /W4 (by Zhanyong Wan). Renames EventListenrs to TestEventListeners (by Zhanyong Wan). Fixes invalid characters in XML report (by Vlad Losev). Refacotrs SConscript (by Vlad Losev). --- test/gtest-death-test_test.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'test/gtest-death-test_test.cc') diff --git a/test/gtest-death-test_test.cc b/test/gtest-death-test_test.cc index 7cc4cafc..7bf6a716 100644 --- a/test/gtest-death-test_test.cc +++ b/test/gtest-death-test_test.cc @@ -35,6 +35,9 @@ #include #include +using testing::internal::AlwaysFalse; +using testing::internal::AlwaysTrue; + #if GTEST_HAS_DEATH_TEST #if GTEST_OS_WINDOWS @@ -271,21 +274,21 @@ TEST(ExitStatusPredicateTest, KilledBySignal) { // be followed by operator<<, and that in either case the complete text // comprises only a single C++ statement. TEST_F(TestForDeathTest, SingleStatement) { - if (false) + if (AlwaysFalse()) // This would fail if executed; this is a compilation test only ASSERT_DEATH(return, ""); - if (true) + if (AlwaysTrue()) EXPECT_DEATH(_exit(1), ""); else // This empty "else" branch is meant to ensure that EXPECT_DEATH // doesn't expand into an "if" statement without an "else" ; - if (false) + if (AlwaysFalse()) ASSERT_DEATH(return, "") << "did not die"; - if (false) + if (AlwaysFalse()) ; else EXPECT_DEATH(_exit(1), "") << 1 << 2 << 3; @@ -1188,21 +1191,21 @@ TEST(ConditionalDeathMacrosTest, AssertDeatDoesNotReturnhIfUnsupported) { // // The syntax should work whether death tests are available or not. TEST(ConditionalDeathMacrosSyntaxDeathTest, SingleStatement) { - if (false) + if (AlwaysFalse()) // This would fail if executed; this is a compilation test only ASSERT_DEATH_IF_SUPPORTED(return, ""); - if (true) + if (AlwaysTrue()) EXPECT_DEATH_IF_SUPPORTED(_exit(1), ""); else // This empty "else" branch is meant to ensure that EXPECT_DEATH // doesn't expand into an "if" statement without an "else" ; // NOLINT - if (false) + if (AlwaysFalse()) ASSERT_DEATH_IF_SUPPORTED(return, "") << "did not die"; - if (false) + if (AlwaysFalse()) ; // NOLINT else EXPECT_DEATH_IF_SUPPORTED(_exit(1), "") << 1 << 2 << 3; -- cgit v1.2.3