aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/include
diff options
context:
space:
mode:
Diffstat (limited to 'googlemock/include')
-rw-r--r--googlemock/include/gmock/gmock-generated-function-mockers.h4
-rw-r--r--googlemock/include/gmock/gmock-generated-function-mockers.h.pump4
-rw-r--r--googlemock/include/gmock/gmock-matchers.h26
-rw-r--r--googlemock/include/gmock/gmock-spec-builders.h36
-rw-r--r--googlemock/include/gmock/internal/gmock-internal-utils.h2
5 files changed, 45 insertions, 27 deletions
diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h b/googlemock/include/gmock/gmock-generated-function-mockers.h
index 126c48c7..d5417106 100644
--- a/googlemock/include/gmock/gmock-generated-function-mockers.h
+++ b/googlemock/include/gmock/gmock-generated-function-mockers.h
@@ -352,7 +352,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
//
// class MockClass {
// // Overload 1
-// MockSpec<string&()> gmock_GetName() { … }
+// MockSpec<string&()> gmock_GetName() { ... }
// // Overload 2. Declared const so that the compiler will generate an
// // error when trying to resolve between this and overload 4 in
// // 'gmock_GetName(WithoutMatchers(), nullptr)'.
@@ -363,7 +363,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
// }
//
// // Overload 3
-// const string& gmock_GetName() const { … }
+// const string& gmock_GetName() const { ... }
// // Overload 4
// MockSpec<const string&()> gmock_GetName(
// const WithoutMatchers&, const Function<const string&()>*) const {
diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump
index efcb3e8c..98659226 100644
--- a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump
+++ b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump
@@ -114,7 +114,7 @@ class FunctionMocker<R($As)> : public
//
// class MockClass {
// // Overload 1
-// MockSpec<string&()> gmock_GetName() { … }
+// MockSpec<string&()> gmock_GetName() { ... }
// // Overload 2. Declared const so that the compiler will generate an
// // error when trying to resolve between this and overload 4 in
// // 'gmock_GetName(WithoutMatchers(), nullptr)'.
@@ -125,7 +125,7 @@ class FunctionMocker<R($As)> : public
// }
//
// // Overload 3
-// const string& gmock_GetName() const { … }
+// const string& gmock_GetName() const { ... }
// // Overload 4
// MockSpec<const string&()> gmock_GetName(
// const WithoutMatchers&, const Function<const string&()>*) const {
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h
index c94f5826..eb096135 100644
--- a/googlemock/include/gmock/gmock-matchers.h
+++ b/googlemock/include/gmock/gmock-matchers.h
@@ -4529,6 +4529,20 @@ Property(PropertyType (Class::*property)() const &,
property,
MatcherCast<GTEST_REFERENCE_TO_CONST_(PropertyType)>(matcher)));
}
+
+// Three-argument form for reference-qualified member functions.
+template <typename Class, typename PropertyType, typename PropertyMatcher>
+inline PolymorphicMatcher<internal::PropertyMatcher<
+ Class, PropertyType, PropertyType (Class::*)() const &> >
+Property(const std::string& property_name,
+ PropertyType (Class::*property)() const &,
+ const PropertyMatcher& matcher) {
+ return MakePolymorphicMatcher(
+ internal::PropertyMatcher<Class, PropertyType,
+ PropertyType (Class::*)() const &>(
+ property_name, property,
+ MatcherCast<GTEST_REFERENCE_TO_CONST_(PropertyType)>(matcher)));
+}
#endif
// Creates a matcher that matches an object iff the result of applying
@@ -5165,13 +5179,17 @@ std::string DescribeMatcher(const M& matcher, bool negation = false) {
// Define variadic matcher versions. They are overloaded in
// gmock-generated-matchers.h for the cases supported by pre C++11 compilers.
template <typename... Args>
-internal::AllOfMatcher<Args...> AllOf(const Args&... matchers) {
- return internal::AllOfMatcher<Args...>(matchers...);
+internal::AllOfMatcher<typename std::decay<const Args&>::type...> AllOf(
+ const Args&... matchers) {
+ return internal::AllOfMatcher<typename std::decay<const Args&>::type...>(
+ matchers...);
}
template <typename... Args>
-internal::AnyOfMatcher<Args...> AnyOf(const Args&... matchers) {
- return internal::AnyOfMatcher<Args...>(matchers...);
+internal::AnyOfMatcher<typename std::decay<const Args&>::type...> AnyOf(
+ const Args&... matchers) {
+ return internal::AnyOfMatcher<typename std::decay<const Args&>::type...>(
+ matchers...);
}
template <typename... Args>
diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h
index cf1e7e23..090cff48 100644
--- a/googlemock/include/gmock/gmock-spec-builders.h
+++ b/googlemock/include/gmock/gmock-spec-builders.h
@@ -1854,22 +1854,22 @@ inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT
// parameter. This technique may only be used for non-overloaded methods.
//
// // These are the same:
-// ON_CALL(mock, NoArgsMethod()).WillByDefault(…);
-// ON_CALL(mock, NoArgsMethod).WillByDefault(…);
+// ON_CALL(mock, NoArgsMethod()).WillByDefault(...);
+// ON_CALL(mock, NoArgsMethod).WillByDefault(...);
//
// // As are these:
-// ON_CALL(mock, TwoArgsMethod(_, _)).WillByDefault(…);
-// ON_CALL(mock, TwoArgsMethod).WillByDefault(…);
+// ON_CALL(mock, TwoArgsMethod(_, _)).WillByDefault(...);
+// ON_CALL(mock, TwoArgsMethod).WillByDefault(...);
//
// // Can also specify args if you want, of course:
-// ON_CALL(mock, TwoArgsMethod(_, 45)).WillByDefault(…);
+// ON_CALL(mock, TwoArgsMethod(_, 45)).WillByDefault(...);
//
// // Overloads work as long as you specify parameters:
-// ON_CALL(mock, OverloadedMethod(_)).WillByDefault(…);
-// ON_CALL(mock, OverloadedMethod(_, _)).WillByDefault(…);
+// ON_CALL(mock, OverloadedMethod(_)).WillByDefault(...);
+// ON_CALL(mock, OverloadedMethod(_, _)).WillByDefault(...);
//
// // Oops! Which overload did you want?
-// ON_CALL(mock, OverloadedMethod).WillByDefault(…);
+// ON_CALL(mock, OverloadedMethod).WillByDefault(...);
// => ERROR: call to member function 'gmock_OverloadedMethod' is ambiguous
//
// How this works: The mock class uses two overloads of the gmock_Method
@@ -1877,28 +1877,28 @@ inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT
// In the matcher list form, the macro expands to:
//
// // This statement:
-// ON_CALL(mock, TwoArgsMethod(_, 45))…
+// ON_CALL(mock, TwoArgsMethod(_, 45))...
//
-// // …expands to:
-// mock.gmock_TwoArgsMethod(_, 45)(WithoutMatchers(), nullptr)…
+// // ...expands to:
+// mock.gmock_TwoArgsMethod(_, 45)(WithoutMatchers(), nullptr)...
// |-------------v---------------||------------v-------------|
// invokes first overload swallowed by operator()
//
-// // …which is essentially:
-// mock.gmock_TwoArgsMethod(_, 45)…
+// // ...which is essentially:
+// mock.gmock_TwoArgsMethod(_, 45)...
//
// Whereas the form without a matcher list:
//
// // This statement:
-// ON_CALL(mock, TwoArgsMethod)…
+// ON_CALL(mock, TwoArgsMethod)...
//
-// // …expands to:
-// mock.gmock_TwoArgsMethod(WithoutMatchers(), nullptr)…
+// // ...expands to:
+// mock.gmock_TwoArgsMethod(WithoutMatchers(), nullptr)...
// |-----------------------v--------------------------|
// invokes second overload
//
-// // …which is essentially:
-// mock.gmock_TwoArgsMethod(_, _)…
+// // ...which is essentially:
+// mock.gmock_TwoArgsMethod(_, _)...
//
// The WithoutMatchers() argument is used to disambiguate overloads and to
// block the caller from accidentally invoking the second overload directly. The
diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h
index 4751788a..c5841aba 100644
--- a/googlemock/include/gmock/internal/gmock-internal-utils.h
+++ b/googlemock/include/gmock/internal/gmock-internal-utils.h
@@ -348,7 +348,7 @@ GTEST_API_ void Log(LogSeverity severity, const std::string& message,
// correct overload. This must not be instantiable, to prevent client code from
// accidentally resolving to the overload; for example:
//
-// ON_CALL(mock, Method({}, nullptr))…
+// ON_CALL(mock, Method({}, nullptr))...
//
class WithoutMatchers {
private: