Adds a free function MatchAndExplain().

This commit is contained in:
zhanyong.wan
2010-03-05 21:23:23 +00:00
parent 5905ba00fe
commit 34b034c21e
2 changed files with 34 additions and 2 deletions

View File

@@ -2850,6 +2850,14 @@ inline bool Value(const T& value, M matcher) {
return testing::Matches(matcher)(value);
}
// Matches the value against the given matcher and explains the match
// result to listener.
template <typename T, typename M>
inline bool MatchAndExplain(
M matcher, const T& value, MatchResultListener* listener) {
return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener);
}
// AllArgs(m) is a synonym of m. This is useful in
//
// EXPECT_CALL(foo, Bar(_, _)).With(AllArgs(Eq()));