Clone of unsubmitted cr/176529515. Introduce parameterless expectations.

This commit is contained in:
David Sunderland
2018-04-18 19:28:56 -04:00
parent 1f605414cc
commit f437f8ca0d
7 changed files with 425 additions and 12 deletions

View File

@@ -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.