BREAKING CHANGE: drops the old matcher API. See http://code.google.com/p/googlemock/wiki/FrequentlyAskedQuestions for details.
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::MakeMatcher;
using testing::Matcher;
using testing::MatcherInterface;
+using testing::MatchResultListener;
using testing::Ne;
using testing::Not;
using testing::Pointee;
@@ -217,21 +218,22 @@
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: