aboutsummaryrefslogtreecommitdiffstats
path: root/include/gmock/gmock-matchers.h
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2009-06-09 06:09:53 +0000
committerzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2009-06-09 06:09:53 +0000
commitbf55085d456e3ee55eb234c98c435e54d0a2d5aa (patch)
tree32d9ace4b2fa991dd2f82f76685cb9eae0b00523 /include/gmock/gmock-matchers.h
parent2661c6821a4d7964697e48747c4d739e1ac3a243 (diff)
downloadgoogletest-bf55085d456e3ee55eb234c98c435e54d0a2d5aa.tar.gz
googletest-bf55085d456e3ee55eb234c98c435e54d0a2d5aa.tar.bz2
googletest-bf55085d456e3ee55eb234c98c435e54d0a2d5aa.zip
Implements .With() as a synonym of .WithArguments(); implements AllArgs(m) as a synonym of m; relies on gtest-port to #include tuple; fixes a compatibility with Symbian.
Diffstat (limited to 'include/gmock/gmock-matchers.h')
-rw-r--r--include/gmock/gmock-matchers.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/gmock/gmock-matchers.h b/include/gmock/gmock-matchers.h
index f4d5b0a6..dc252e3e 100644
--- a/include/gmock/gmock-matchers.h
+++ b/include/gmock/gmock-matchers.h
@@ -2354,6 +2354,16 @@ inline bool Value(const T& value, M matcher) {
return testing::Matches(matcher)(value);
}
+// AllArgs(m) is a synonym of m. This is useful in
+//
+// EXPECT_CALL(foo, Bar(_, _)).With(AllArgs(Eq()));
+//
+// which is easier to read than
+//
+// EXPECT_CALL(foo, Bar(_, _)).With(Eq());
+template <typename InnerMatcher>
+inline InnerMatcher AllArgs(const InnerMatcher& matcher) { return matcher; }
+
// These macros allow using matchers to check values in Google Test
// tests. ASSERT_THAT(value, matcher) and EXPECT_THAT(value, matcher)
// succeed iff the value matches the matcher. If the assertion fails,