summaryrefslogtreecommitdiffstats
path: root/test/gtest-death-test_test.cc
diff options
context:
space:
mode:
authorshiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-08-01 19:04:48 (GMT)
committershiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-08-01 19:04:48 (GMT)
commitbcb12fa0f651f7de3a10f4535ed856e52b1c3f62 (patch)
tree155a3d8bd238349da5c4f883ff100faaeeaf6bfb /test/gtest-death-test_test.cc
parentbf9b4b48dc65adc2edd44175f77b4a7363c59234 (diff)
downloadgoogletest-bcb12fa0f651f7de3a10f4535ed856e52b1c3f62.zip
googletest-bcb12fa0f651f7de3a10f4535ed856e52b1c3f62.tar.gz
googletest-bcb12fa0f651f7de3a10f4535ed856e52b1c3f62.tar.bz2
Fixes the definition of GTEST_ATTRIBUTE_UNUSED and make the tests pass in opt mode.
Diffstat (limited to 'test/gtest-death-test_test.cc')
-rw-r--r--test/gtest-death-test_test.cc29
1 files changed, 2 insertions, 27 deletions
diff --git a/test/gtest-death-test_test.cc b/test/gtest-death-test_test.cc
index 4e4ca1a..4bfd9d6 100644
--- a/test/gtest-death-test_test.cc
+++ b/test/gtest-death-test_test.cc
@@ -467,31 +467,6 @@ TEST_F(TestForDeathTest, TestExpectDebugDeath) {
#endif
}
-// Tests that EXPECT_DEBUG_DEATH works as expected,
-// that is, in debug mode, it:
-// 1. Asserts on death.
-// 2. Has no side effect.
-//
-// And in opt mode, it:
-// 1. Has side effects and returns the expected value (12).
-TEST_F(TestForDeathTest, TestExpectDebugDeathM) {
- int sideeffect = 0;
- EXPECT_DEBUG_DEATH({ // NOLINT
- // Tests that the return value is 12 in opt mode.
- EXPECT_EQ(12, DieInDebugElse12(&sideeffect));
- // Tests that the side effect occurrs in opt mode.
- EXPECT_EQ(12, sideeffect);
- }, "death.*DieInDebugElse12") << "In ExpectDebugDeathM";
-
-#ifdef NDEBUG
- // Checks that the assignment occurs in opt mode (sideeffect).
- EXPECT_EQ(12, sideeffect);
-#else
- // Checks that the assignment does not occur in dbg mode (no sideeffect).
- EXPECT_EQ(0, sideeffect);
-#endif
-}
-
// Tests that ASSERT_DEBUG_DEATH works as expected
// In debug mode:
// 1. Asserts on debug death.
@@ -499,7 +474,7 @@ TEST_F(TestForDeathTest, TestExpectDebugDeathM) {
//
// In opt mode:
// 1. Has side effects and returns the expected value (12).
-TEST_F(TestForDeathTest, TestAssertDebugDeathM) {
+TEST_F(TestForDeathTest, TestAssertDebugDeath) {
int sideeffect = 0;
ASSERT_DEBUG_DEATH({ // NOLINT
@@ -507,7 +482,7 @@ TEST_F(TestForDeathTest, TestAssertDebugDeathM) {
EXPECT_EQ(12, DieInDebugElse12(&sideeffect));
// Tests that the side effect occurred in opt mode.
EXPECT_EQ(12, sideeffect);
- }, "death.*DieInDebugElse12") << "In AssertDebugDeathM";
+ }, "death.*DieInDebugElse12");
#ifdef NDEBUG
// Checks that the assignment occurs in opt mode (sideeffect).