summaryrefslogtreecommitdiff
path: root/test/gmock-generated-matchers_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/gmock-generated-matchers_test.cc')
-rw-r--r--test/gmock-generated-matchers_test.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/gmock-generated-matchers_test.cc b/test/gmock-generated-matchers_test.cc
index 40c2367..5e14c42 100644
--- a/test/gmock-generated-matchers_test.cc
+++ b/test/gmock-generated-matchers_test.cc
@@ -68,6 +68,7 @@ using testing::Lt;
using testing::MakeMatcher;
using testing::Matcher;
using testing::MatcherInterface;
+using testing::MatchResultListener;
using testing::Ne;
using testing::Not;
using testing::Pointee;
@@ -217,21 +218,22 @@ class GreaterThanMatcher : public MatcherInterface<int> {
public:
explicit GreaterThanMatcher(int rhs) : rhs_(rhs) {}
- virtual bool Matches(int lhs) const { return lhs > rhs_; }
-
virtual void DescribeTo(::std::ostream* os) const {
*os << "is greater than " << rhs_;
}
- virtual void ExplainMatchResultTo(int lhs, ::std::ostream* os) const {
+ virtual bool MatchAndExplain(int lhs,
+ MatchResultListener* listener) const {
const int diff = lhs - rhs_;
if (diff > 0) {
- *os << "is " << diff << " more than " << rhs_;
+ *listener << "is " << diff << " more than " << rhs_;
} else if (diff == 0) {
- *os << "is the same as " << rhs_;
+ *listener << "is the same as " << rhs_;
} else {
- *os << "is " << -diff << " less than " << rhs_;
+ *listener << "is " << -diff << " less than " << rhs_;
}
+
+ return lhs > rhs_;
}
private: