diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2010-09-27 17:42:52 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2010-09-27 17:42:52 +0000 |
commit | 375ce98f43aebcc1bd702cf9fcb860788e5cb820 (patch) | |
tree | 267c18d6dd6ee179748ea46e790f3c32c42a100e /test | |
parent | 0bfb56317785c7960bedee9fda0bb879347e2121 (diff) | |
download | gtest-375ce98f43aebcc1bd702cf9fcb860788e5cb820.tar.gz gtest-375ce98f43aebcc1bd702cf9fcb860788e5cb820.tar.bz2 gtest-375ce98f43aebcc1bd702cf9fcb860788e5cb820.tar.xz |
Allows EXPECT_FATAL_FAILURE() and friends to accept a string object as the second argument.
git-svn-id: http://googletest.googlecode.com/svn/trunk@485 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'test')
-rw-r--r-- | test/gtest_unittest.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc index 8e3e7e6..056064f 100644 --- a/test/gtest_unittest.cc +++ b/test/gtest_unittest.cc @@ -1335,6 +1335,17 @@ TEST_F(ExpectFatalFailureTest, CatchesFatalFaliure) { EXPECT_FATAL_FAILURE(AddFatalFailure(), "Expected fatal failure."); } +#if GTEST_HAS_GLOBAL_STRING +TEST_F(ExpectFatalFailureTest, AcceptsStringObject) { + EXPECT_FATAL_FAILURE(AddFatalFailure(), ::string("Expected fatal failure.")); +} +#endif + +TEST_F(ExpectFatalFailureTest, AcceptsStdStringObject) { + EXPECT_FATAL_FAILURE(AddFatalFailure(), + ::std::string("Expected fatal failure.")); +} + TEST_F(ExpectFatalFailureTest, CatchesFatalFailureOnAllThreads) { // We have another test below to verify that the macro catches fatal // failures generated on another thread. @@ -1412,6 +1423,18 @@ TEST_F(ExpectNonfatalFailureTest, CatchesNonfatalFailure) { "Expected non-fatal failure."); } +#if GTEST_HAS_GLOBAL_STRING +TEST_F(ExpectNonfatalFailureTest, AcceptsStringObject) { + EXPECT_NONFATAL_FAILURE(AddNonfatalFailure(), + ::string("Expected non-fatal failure.")); +} +#endif + +TEST_F(ExpectNonfatalFailureTest, AcceptsStdStringObject) { + EXPECT_NONFATAL_FAILURE(AddNonfatalFailure(), + ::std::string("Expected non-fatal failure.")); +} + TEST_F(ExpectNonfatalFailureTest, CatchesNonfatalFailureOnAllThreads) { // We have another test below to verify that the macro catches // non-fatal failures generated on another thread. |