diff options
author | David Sunderland <sunderland@google.com> | 2018-04-18 23:28:56 (GMT) |
---|---|---|
committer | David Sunderland <sunderland@google.com> | 2018-04-18 23:28:56 (GMT) |
commit | f437f8ca0d4d13d6b1b6279ee40dc61121873a94 (patch) | |
tree | b2ebc307c41ed6658d0e1aefa9197e2b4cc5d52d /googlemock/include/gmock/internal/gmock-internal-utils.h | |
parent | 1f605414cc4137f0ad0cde4d0c7366ff2dfac590 (diff) | |
download | googletest-f437f8ca0d4d13d6b1b6279ee40dc61121873a94.zip googletest-f437f8ca0d4d13d6b1b6279ee40dc61121873a94.tar.gz googletest-f437f8ca0d4d13d6b1b6279ee40dc61121873a94.tar.bz2 |
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.h | 15 |
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 20c95c6..c43dac0 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. |