diff options
author | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2010-03-24 17:35:11 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2010-03-24 17:35:11 +0000 |
commit | b1c7f93c52d7fbf484f34d01a65cfaec03786564 (patch) | |
tree | 1e506bb6f4bf1e426abac589824a93e06b0146eb /include/gmock/gmock-spec-builders.h | |
parent | 676e8cc6092853c9dbf1eeab2402be0069d8fb7e (diff) | |
download | googletest-b1c7f93c52d7fbf484f34d01a65cfaec03786564.tar.gz googletest-b1c7f93c52d7fbf484f34d01a65cfaec03786564.tar.bz2 googletest-b1c7f93c52d7fbf484f34d01a65cfaec03786564.zip |
Improves matcher messages across the board.
Diffstat (limited to 'include/gmock/gmock-spec-builders.h')
-rw-r--r-- | include/gmock/gmock-spec-builders.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/gmock/gmock-spec-builders.h b/include/gmock/gmock-spec-builders.h index 9b60f692..74a095da 100644 --- a/include/gmock/gmock-spec-builders.h +++ b/include/gmock/gmock-spec-builders.h @@ -993,8 +993,8 @@ class TypedExpectation : public ExpectationBase { // Describes the result of matching the arguments against this // expectation to the given ostream. // L >= g_gmock_mutex - void DescribeMatchResultTo(const ArgumentTuple& args, - ::std::ostream* os) const { + void ExplainMatchResultTo(const ArgumentTuple& args, + ::std::ostream* os) const { g_gmock_mutex.AssertHeld(); if (is_retired()) { @@ -1002,7 +1002,7 @@ class TypedExpectation : public ExpectationBase { << " Actual: it is retired\n"; } else if (!Matches(args)) { if (!TupleMatches(matchers_, args)) { - DescribeMatchFailureTupleTo(matchers_, args, os); + ExplainMatchFailureTupleTo(matchers_, args, os); } StringMatchResultListener listener; if (!extra_matcher_.MatchAndExplain(args, &listener)) { @@ -1010,7 +1010,7 @@ class TypedExpectation : public ExpectationBase { extra_matcher_.DescribeTo(os); *os << "\n Actual: don't match"; - internal::StreamInParensAsNeeded(listener.str(), os); + internal::PrintIfNotEmpty(listener.str(), os); *os << "\n"; } } else if (!AllPrerequisitesAreSatisfied()) { @@ -1028,7 +1028,7 @@ class TypedExpectation : public ExpectationBase { *os << " (end of pre-requisites)\n"; } else { // This line is here just for completeness' sake. It will never - // be executed as currently the DescribeMatchResultTo() function + // be executed as currently the ExplainMatchResultTo() function // is called only when the mock function call does NOT match the // expectation. *os << "The call matches the expectation.\n"; @@ -1618,7 +1618,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { *why << "tried expectation #" << i << ": "; } *why << expectations_[i]->source_text() << "...\n"; - expectations_[i]->DescribeMatchResultTo(args, why); + expectations_[i]->ExplainMatchResultTo(args, why); expectations_[i]->DescribeCallCountTo(why); } } |