diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-03-11 18:31:26 (GMT) |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-03-11 18:31:26 (GMT) |
commit | 44a041b711ff4a5b5f341f21127aed46dbfe38ad (patch) | |
tree | 75fea96237260f31783dea6238355501dd6e32fd /test | |
parent | 40e72a8a837b47cbfe2e695068c1845073ab2630 (diff) | |
download | googletest-44a041b711ff4a5b5f341f21127aed46dbfe38ad.zip googletest-44a041b711ff4a5b5f341f21127aed46dbfe38ad.tar.gz googletest-44a041b711ff4a5b5f341f21127aed46dbfe38ad.tar.bz2 |
Fixes death-test-related tests on Windows, by Vlad Losev.
Diffstat (limited to 'test')
-rw-r--r-- | test/gtest-death-test_test.cc | 9 | ||||
-rw-r--r-- | test/gtest-typed-test_test.cc | 8 |
2 files changed, 10 insertions, 7 deletions
diff --git a/test/gtest-death-test_test.cc b/test/gtest-death-test_test.cc index 4151ef0..e794a09 100644 --- a/test/gtest-death-test_test.cc +++ b/test/gtest-death-test_test.cc @@ -46,6 +46,7 @@ #include <limits.h> #include <signal.h> #include <stdio.h> + #include <gtest/gtest-spi.h> // Indicates that this translation unit is part of Google Test's @@ -284,14 +285,16 @@ void DieWithEmbeddedNul() { _exit(1); } +#if GTEST_USES_PCRE // Tests that EXPECT_DEATH and ASSERT_DEATH work when the error // message has a NUL character in it. -TEST_F(TestForDeathTest, DISABLED_EmbeddedNulInMessage) { +TEST_F(TestForDeathTest, EmbeddedNulInMessage) { // TODO(wan@google.com): <regex.h> doesn't support matching strings // with embedded NUL characters - find a way to workaround it. EXPECT_DEATH(DieWithEmbeddedNul(), "w.*ld"); ASSERT_DEATH(DieWithEmbeddedNul(), "w.*ld"); } +#endif // GTEST_USES_PCRE // Tests that death test macros expand to code which interacts well with switch // statements. @@ -594,7 +597,7 @@ void ExpectDebugDeathHelper(bool* aborted) { } #if GTEST_OS_WINDOWS -TEST(TestForPopUps, DoesNotShowPopUpOnAbort) { +TEST(PopUpDeathTest, DoesNotShowPopUpOnAbort) { printf("This test should be considered failing if it shows " "any pop-up dialogs.\n"); fflush(stdout); @@ -605,7 +608,7 @@ TEST(TestForPopUps, DoesNotShowPopUpOnAbort) { }, ""); } -TEST(TestForPopUps, DoesNotShowPopUpOnThrow) { +TEST(PopUpDeathTest, DoesNotShowPopUpOnThrow) { printf("This test should be considered failing if it shows " "any pop-up dialogs.\n"); fflush(stdout); diff --git a/test/gtest-typed-test_test.cc b/test/gtest-typed-test_test.cc index 9ba9675..eb921a0 100644 --- a/test/gtest-typed-test_test.cc +++ b/test/gtest-typed-test_test.cc @@ -205,19 +205,19 @@ typedef TypedTestCasePStateTest TypedTestCasePStateDeathTest; TEST_F(TypedTestCasePStateDeathTest, DetectsDuplicates) { EXPECT_DEATH( state_.VerifyRegisteredTestNames("foo.cc", 1, "A, B, A, C"), - "foo\\.cc:1: Test A is listed more than once\\."); + "foo\\.cc.1.?: Test A is listed more than once\\."); } TEST_F(TypedTestCasePStateDeathTest, DetectsExtraTest) { EXPECT_DEATH( state_.VerifyRegisteredTestNames("foo.cc", 1, "A, B, C, D"), - "foo\\.cc:1: No test named D can be found in this test case\\."); + "foo\\.cc.1.?: No test named D can be found in this test case\\."); } TEST_F(TypedTestCasePStateDeathTest, DetectsMissedTest) { EXPECT_DEATH( state_.VerifyRegisteredTestNames("foo.cc", 1, "A, C"), - "foo\\.cc:1: You forgot to list test B\\."); + "foo\\.cc.1.?: You forgot to list test B\\."); } // Tests that defining a test for a parameterized test case generates @@ -226,7 +226,7 @@ TEST_F(TypedTestCasePStateDeathTest, DetectsTestAfterRegistration) { state_.VerifyRegisteredTestNames("foo.cc", 1, "A, B, C"); EXPECT_DEATH( state_.AddTestName("foo.cc", 2, "FooTest", "D"), - "foo\\.cc:2: Test D must be defined before REGISTER_TYPED_TEST_CASE_P" + "foo\\.cc.2.?: Test D must be defined before REGISTER_TYPED_TEST_CASE_P" "\\(FooTest, \\.\\.\\.\\)\\."); } |