diff options
author | kosak@google.com <kosak@google.com@861a406c-534a-0410-8894-cb66d6ee9925> | 2014-03-24 21:58:25 +0000 |
---|---|---|
committer | kosak@google.com <kosak@google.com@861a406c-534a-0410-8894-cb66d6ee9925> | 2014-03-24 21:58:25 +0000 |
commit | d132283f055f07588d82ad43fbf501645cb39c9d (patch) | |
tree | a761f77d59d13f7dea8e415b4e0d64ad765c6f72 /test/gtest-death-test_test.cc | |
parent | e6d432cb2d1aafd47f205deac6a7c76c321dc4dd (diff) | |
download | googletest-d132283f055f07588d82ad43fbf501645cb39c9d.tar.gz |
Implement threading support for gtest on Windows.
Also, stop using localtime(). Instead, use localtime_r() on most systems, localtime_s() on Windows.
git-svn-id: http://googletest.googlecode.com/svn/trunk@681 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'test/gtest-death-test_test.cc')
-rw-r--r-- | test/gtest-death-test_test.cc | 68 |
1 files changed, 67 insertions, 1 deletions
diff --git a/test/gtest-death-test_test.cc b/test/gtest-death-test_test.cc index c2d26df..da0b84d 100644 --- a/test/gtest-death-test_test.cc +++ b/test/gtest-death-test_test.cc @@ -699,7 +699,10 @@ TEST_F(TestForDeathTest, ExpectDebugDeathDoesNotAbort) { void AssertDebugDeathHelper(bool* aborted) { *aborted = true; - ASSERT_DEBUG_DEATH(return, "") << "This is expected to fail."; + GTEST_LOG_(INFO) << "Before ASSERT_DEBUG_DEATH"; + ASSERT_DEBUG_DEATH(GTEST_LOG_(INFO) << "In ASSERT_DEBUG_DEATH"; return, "") + << "This is expected to fail."; + GTEST_LOG_(INFO) << "After ASSERT_DEBUG_DEATH"; *aborted = false; } @@ -712,6 +715,69 @@ TEST_F(TestForDeathTest, AssertDebugDeathAborts) { EXPECT_TRUE(aborted); } +TEST_F(TestForDeathTest, AssertDebugDeathAborts2) { + static bool aborted; + aborted = false; + EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), ""); + EXPECT_TRUE(aborted); +} + +TEST_F(TestForDeathTest, AssertDebugDeathAborts3) { + static bool aborted; + aborted = false; + EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), ""); + EXPECT_TRUE(aborted); +} + +TEST_F(TestForDeathTest, AssertDebugDeathAborts4) { + static bool aborted; + aborted = false; + EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), ""); + EXPECT_TRUE(aborted); +} + +TEST_F(TestForDeathTest, AssertDebugDeathAborts5) { + static bool aborted; + aborted = false; + EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), ""); + EXPECT_TRUE(aborted); +} + +TEST_F(TestForDeathTest, AssertDebugDeathAborts6) { + static bool aborted; + aborted = false; + EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), ""); + EXPECT_TRUE(aborted); +} + +TEST_F(TestForDeathTest, AssertDebugDeathAborts7) { + static bool aborted; + aborted = false; + EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), ""); + EXPECT_TRUE(aborted); +} + +TEST_F(TestForDeathTest, AssertDebugDeathAborts8) { + static bool aborted; + aborted = false; + EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), ""); + EXPECT_TRUE(aborted); +} + +TEST_F(TestForDeathTest, AssertDebugDeathAborts9) { + static bool aborted; + aborted = false; + EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), ""); + EXPECT_TRUE(aborted); +} + +TEST_F(TestForDeathTest, AssertDebugDeathAborts10) { + static bool aborted; + aborted = false; + EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), ""); + EXPECT_TRUE(aborted); +} + # endif // _NDEBUG // Tests the *_EXIT family of macros, using a variety of predicates. |