aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/include/gmock/internal/gmock-internal-utils.h
diff options
context:
space:
mode:
authorDavid Sunderland <sunderland@google.com>2018-04-18 19:28:56 -0400
committerDavid Sunderland <sunderland@google.com>2018-04-18 19:28:56 -0400
commitf437f8ca0d4d13d6b1b6279ee40dc61121873a94 (patch)
treeb2ebc307c41ed6658d0e1aefa9197e2b4cc5d52d /googlemock/include/gmock/internal/gmock-internal-utils.h
parent1f605414cc4137f0ad0cde4d0c7366ff2dfac590 (diff)
downloadgoogletest-f437f8ca0d4d13d6b1b6279ee40dc61121873a94.tar.gz
googletest-f437f8ca0d4d13d6b1b6279ee40dc61121873a94.tar.bz2
googletest-f437f8ca0d4d13d6b1b6279ee40dc61121873a94.zip
Clone of unsubmitted cr/176529515. Introduce parameterless expectations.
Diffstat (limited to 'googlemock/include/gmock/internal/gmock-internal-utils.h')
-rw-r--r--googlemock/include/gmock/internal/gmock-internal-utils.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h
index 20c95c6a..c43dac06 100644
--- a/googlemock/include/gmock/internal/gmock-internal-utils.h
+++ b/googlemock/include/gmock/internal/gmock-internal-utils.h
@@ -344,6 +344,21 @@ GTEST_API_ bool LogIsVisible(LogSeverity severity);
GTEST_API_ void Log(LogSeverity severity, const std::string& message,
int stack_frames_to_skip);
+// A marker class that is used to resolve parameterless expectations to the
+// correct overload. This must not be instantiable, to prevent client code from
+// accidentally resolving to the overload; for example:
+//
+// ON_CALL(mock, Method({}, nullptr))…
+//
+class WithoutMatchers {
+ private:
+ WithoutMatchers() {}
+ friend WithoutMatchers GetWithoutMatchers();
+};
+
+// Internal use only: access the singleton instance of WithoutMatchers.
+WithoutMatchers GetWithoutMatchers();
+
// TODO(wan@google.com): group all type utilities together.
// Type traits.