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 | b5d3a17805fe0ed2ccde463412ae1fd206c4df21 (patch) | |
| tree | 267c18d6dd6ee179748ea46e790f3c32c42a100e /src | |
| parent | 345d9ebf30ccc2747c4e4c224b95fd8406093e29 (diff) | |
| download | googletest-b5d3a17805fe0ed2ccde463412ae1fd206c4df21.tar.gz googletest-b5d3a17805fe0ed2ccde463412ae1fd206c4df21.tar.bz2 googletest-b5d3a17805fe0ed2ccde463412ae1fd206c4df21.zip | |
Allows EXPECT_FATAL_FAILURE() and friends to accept a string object as the second argument.
Diffstat (limited to 'src')
| -rw-r--r-- | src/gtest.cc | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/src/gtest.cc b/src/gtest.cc index 34e56d75..3b2238f4 100644 --- a/src/gtest.cc +++ b/src/gtest.cc @@ -607,7 +607,7 @@ AssertionResult HasOneFailure(const char* /* results_expr */,                                const char* /* substr_expr */,                                const TestPartResultArray& results,                                TestPartResult::Type type, -                              const char* substr) { +                              const string& substr) {    const String expected(type == TestPartResult::kFatalFailure ?                          "1 fatal failure" :                          "1 non-fatal failure"); @@ -629,7 +629,7 @@ AssertionResult HasOneFailure(const char* /* results_expr */,      return AssertionFailure(msg);    } -  if (strstr(r.message(), substr) == NULL) { +  if (strstr(r.message(), substr.c_str()) == NULL) {      msg << "Expected: " << expected << " containing \""          << substr << "\"\n"          << "  Actual:\n" @@ -646,7 +646,7 @@ AssertionResult HasOneFailure(const char* /* results_expr */,  SingleFailureChecker:: SingleFailureChecker(      const TestPartResultArray* results,      TestPartResult::Type type, -    const char* substr) +    const string& substr)      : results_(results),        type_(type),        substr_(substr) {} @@ -656,7 +656,7 @@ SingleFailureChecker:: SingleFailureChecker(  // type and contains the given substring.  If that's not the case, a  // non-fatal failure will be generated.  SingleFailureChecker::~SingleFailureChecker() { -  EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_.c_str()); +  EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_);  }  DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter( | 
