diff options
author | Tanzinul Islam <t_17_7@hotmail.com> | 2018-05-05 19:53:33 +0100 |
---|---|---|
committer | Tanzinul Islam <t_17_7@hotmail.com> | 2018-05-05 19:53:33 +0100 |
commit | 10f05a627c2da8d7de78da1b08f984ce8de398fb (patch) | |
tree | 4f799952ac6fa35647a653cc12caf42efd73e005 /googlemock/include/gmock/internal/gmock-internal-utils.h | |
parent | 5c7c365d5f3e5467de350f2e81a31407a3f52505 (diff) | |
parent | 278aba369c41e90e9e77a6f51443beb3692919cf (diff) | |
download | googletest-10f05a627c2da8d7de78da1b08f984ce8de398fb.tar.gz googletest-10f05a627c2da8d7de78da1b08f984ce8de398fb.tar.bz2 googletest-10f05a627c2da8d7de78da1b08f984ce8de398fb.zip |
Merge branch 'master' into fix_death_test_child_mingw_wer_issue1116
Diffstat (limited to 'googlemock/include/gmock/internal/gmock-internal-utils.h')
-rw-r--r-- | googlemock/include/gmock/internal/gmock-internal-utils.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index 37ceb549..4751788a 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -48,6 +48,14 @@ namespace testing { namespace internal { +// Silence MSVC C4100 (unreferenced formal parameter) and +// C4805('==': unsafe mix of type 'const int' and type 'const bool') +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable:4100) +# pragma warning(disable:4805) +#endif + // Joins a vector of strings as if they are fields of a tuple; returns // the joined string. GTEST_API_ std::string JoinAsTuple(const Strings& fields); @@ -336,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 GTEST_API_ WithoutMatchers GetWithoutMatchers(); +}; + +// Internal use only: access the singleton instance of WithoutMatchers. +GTEST_API_ WithoutMatchers GetWithoutMatchers(); + // TODO(wan@google.com): group all type utilities together. // Type traits. @@ -510,7 +533,7 @@ struct BooleanConstant {}; // Emit an assertion failure due to incorrect DoDefault() usage. Out-of-lined to // reduce code size. -void IllegalDoDefault(const char* file, int line); +GTEST_API_ void IllegalDoDefault(const char* file, int line); #if GTEST_LANG_CXX11 // Helper types for Apply() below. @@ -539,6 +562,12 @@ auto Apply(F&& f, Tuple&& args) make_int_pack<std::tuple_size<Tuple>::value>()); } #endif + + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + } // namespace internal } // namespace testing |