aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/include
diff options
context:
space:
mode:
Diffstat (limited to 'googlemock/include')
-rw-r--r--googlemock/include/gmock/gmock-generated-actions.h2
-rw-r--r--googlemock/include/gmock/gmock-generated-actions.h.pump2
-rw-r--r--googlemock/include/gmock/gmock-generated-matchers.h2
-rw-r--r--googlemock/include/gmock/gmock-generated-matchers.h.pump2
-rw-r--r--googlemock/include/gmock/gmock-matchers.h35
-rw-r--r--googlemock/include/gmock/gmock-spec-builders.h1
-rw-r--r--googlemock/include/gmock/gmock.h1
7 files changed, 32 insertions, 13 deletions
diff --git a/googlemock/include/gmock/gmock-generated-actions.h b/googlemock/include/gmock/gmock-generated-actions.h
index b5a889c0..be4ebe4f 100644
--- a/googlemock/include/gmock/gmock-generated-actions.h
+++ b/googlemock/include/gmock/gmock-generated-actions.h
@@ -875,7 +875,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
// MORE INFORMATION:
//
// To learn more about using these macros, please search for 'ACTION'
-// on http://code.google.com/p/googlemock/wiki/CookBook.
+// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
// An internal macro needed for implementing ACTION*().
#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
diff --git a/googlemock/include/gmock/gmock-generated-actions.h.pump b/googlemock/include/gmock/gmock-generated-actions.h.pump
index 66d9f9d5..712f65d6 100644
--- a/googlemock/include/gmock/gmock-generated-actions.h.pump
+++ b/googlemock/include/gmock/gmock-generated-actions.h.pump
@@ -357,7 +357,7 @@ $range j2 2..i
// MORE INFORMATION:
//
// To learn more about using these macros, please search for 'ACTION'
-// on http://code.google.com/p/googlemock/wiki/CookBook.
+// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
$range i 0..n
$range k 0..n-1
diff --git a/googlemock/include/gmock/gmock-generated-matchers.h b/googlemock/include/gmock/gmock-generated-matchers.h
index 57056fd9..525f8a71 100644
--- a/googlemock/include/gmock/gmock-generated-matchers.h
+++ b/googlemock/include/gmock/gmock-generated-matchers.h
@@ -1376,7 +1376,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
// ================
//
// To learn more about using these macros, please search for 'MATCHER'
-// on http://code.google.com/p/googlemock/wiki/CookBook.
+// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
#define MATCHER(name, description)\
class name##Matcher {\
diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump
index de30c2c9..f91b1eab 100644
--- a/googlemock/include/gmock/gmock-generated-matchers.h.pump
+++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump
@@ -587,7 +587,7 @@ $$ // show up in the generated code.
// ================
//
// To learn more about using these macros, please search for 'MATCHER'
-// on http://code.google.com/p/googlemock/wiki/CookBook.
+// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
$range i 0..n
$for i
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h
index 3a97c438..c446bf7d 100644
--- a/googlemock/include/gmock/gmock-matchers.h
+++ b/googlemock/include/gmock/gmock-matchers.h
@@ -2232,7 +2232,10 @@ class FieldMatcher {
// Implements the Property() matcher for matching a property
// (i.e. return value of a getter method) of an object.
-template <typename Class, typename PropertyType>
+//
+// Property is a const-qualified member function of Class returning
+// PropertyType.
+template <typename Class, typename PropertyType, typename Property>
class PropertyMatcher {
public:
// The property may have a reference type, so 'const PropertyType&'
@@ -2241,8 +2244,7 @@ class PropertyMatcher {
// PropertyType being a reference or not.
typedef GTEST_REFERENCE_TO_CONST_(PropertyType) RefToConstProperty;
- PropertyMatcher(PropertyType (Class::*property)() const,
- const Matcher<RefToConstProperty>& matcher)
+ PropertyMatcher(Property property, const Matcher<RefToConstProperty>& matcher)
: property_(property), matcher_(matcher) {}
void DescribeTo(::std::ostream* os) const {
@@ -2295,7 +2297,7 @@ class PropertyMatcher {
return MatchAndExplainImpl(false_type(), *p, listener);
}
- PropertyType (Class::*property_)() const;
+ Property property_;
const Matcher<RefToConstProperty> matcher_;
GTEST_DISALLOW_ASSIGN_(PropertyMatcher);
@@ -3908,11 +3910,13 @@ inline PolymorphicMatcher<
// Property(&Foo::str, StartsWith("hi"))
// matches a Foo object x iff x.str() starts with "hi".
template <typename Class, typename PropertyType, typename PropertyMatcher>
-inline PolymorphicMatcher<
- internal::PropertyMatcher<Class, PropertyType> > Property(
- PropertyType (Class::*property)() const, const PropertyMatcher& matcher) {
+inline PolymorphicMatcher<internal::PropertyMatcher<
+ Class, PropertyType, PropertyType (Class::*)() const> >
+Property(PropertyType (Class::*property)() const,
+ const PropertyMatcher& matcher) {
return MakePolymorphicMatcher(
- internal::PropertyMatcher<Class, PropertyType>(
+ internal::PropertyMatcher<Class, PropertyType,
+ PropertyType (Class::*)() const>(
property,
MatcherCast<GTEST_REFERENCE_TO_CONST_(PropertyType)>(matcher)));
// The call to MatcherCast() is required for supporting inner
@@ -3921,6 +3925,21 @@ inline PolymorphicMatcher<
// to compile where bar() returns an int32 and m is a matcher for int64.
}
+#if GTEST_LANG_CXX11
+// The same as above but for reference-qualified member functions.
+template <typename Class, typename PropertyType, typename PropertyMatcher>
+inline PolymorphicMatcher<internal::PropertyMatcher<
+ Class, PropertyType, PropertyType (Class::*)() const &> >
+Property(PropertyType (Class::*property)() const &,
+ const PropertyMatcher& matcher) {
+ return MakePolymorphicMatcher(
+ internal::PropertyMatcher<Class, PropertyType,
+ PropertyType (Class::*)() const &>(
+ property,
+ MatcherCast<GTEST_REFERENCE_TO_CONST_(PropertyType)>(matcher)));
+}
+#endif
+
// Creates a matcher that matches an object iff the result of applying
// a callable to x matches 'matcher'.
// For example,
diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h
index 39f72129..96802444 100644
--- a/googlemock/include/gmock/gmock-spec-builders.h
+++ b/googlemock/include/gmock/gmock-spec-builders.h
@@ -363,7 +363,6 @@ enum CallReaction {
kAllow,
kWarn,
kFail,
- kDefault = kWarn // By default, warn about uninteresting calls.
};
} // namespace internal
diff --git a/googlemock/include/gmock/gmock.h b/googlemock/include/gmock/gmock.h
index 6735c71b..5764bc85 100644
--- a/googlemock/include/gmock/gmock.h
+++ b/googlemock/include/gmock/gmock.h
@@ -71,6 +71,7 @@ namespace testing {
// Declares Google Mock flags that we want a user to use programmatically.
GMOCK_DECLARE_bool_(catch_leaked_mocks);
GMOCK_DECLARE_string_(verbose);
+GMOCK_DECLARE_int32_(default_mock_behavior);
// Initializes Google Mock. This must be called before running the
// tests. In particular, it parses the command line for the flags