aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2010-03-05 21:23:23 +0000
committerzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2010-03-05 21:23:23 +0000
commit34b034c21ef4af7c0100194ed6f85910fc99debb (patch)
treee01e2f5130857b6e5b942eec61d45d2f32f35278 /include
parent5905ba00fe78e522f7253e837ded3ddb5b946934 (diff)
downloadgoogletest-34b034c21ef4af7c0100194ed6f85910fc99debb.tar.gz
googletest-34b034c21ef4af7c0100194ed6f85910fc99debb.tar.bz2
googletest-34b034c21ef4af7c0100194ed6f85910fc99debb.zip
Adds a free function MatchAndExplain().
Diffstat (limited to 'include')
-rw-r--r--include/gmock/gmock-matchers.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/gmock/gmock-matchers.h b/include/gmock/gmock-matchers.h
index ae7e131d..50c0d7bf 100644
--- a/include/gmock/gmock-matchers.h
+++ b/include/gmock/gmock-matchers.h
@@ -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()));