X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=googlemock%2Finclude%2Fgmock%2Fgmock-actions.h;h=bd9ba73ee6341eba38fbb45b56b395eda9a362c6;hb=35012fd0964a1a5455ccd93dd34531ce90728a08;hp=c785ad8abba40f95cc8f0e8aef8c20e2a0f76fb0;hpb=97dde157c1ee3bddda75c6eaf3787507f21e674e;p=platform%2Fupstream%2Fgtest.git diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index c785ad8..bd9ba73 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -122,7 +122,7 @@ // MORE INFORMATION: // // To learn more about using these macros, please search for 'ACTION' on -// https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md +// https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md // IWYU pragma: private, include "gmock/gmock.h" // IWYU pragma: friend gmock/.* @@ -146,10 +146,7 @@ #include "gmock/internal/gmock-port.h" #include "gmock/internal/gmock-pp.h" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4100) -#endif +GTEST_DISABLE_MSC_WARNINGS_PUSH_(4100) namespace testing { @@ -614,7 +611,7 @@ class DefaultValue { private: class ValueProducer { public: - virtual ~ValueProducer() {} + virtual ~ValueProducer() = default; virtual T Produce() = 0; }; @@ -702,8 +699,8 @@ class ActionInterface { typedef typename internal::Function::Result Result; typedef typename internal::Function::ArgumentTuple ArgumentTuple; - ActionInterface() {} - virtual ~ActionInterface() {} + ActionInterface() = default; + virtual ~ActionInterface() = default; // Performs the action. This method is not const, as in general an // action can have side effects and be stateful. For example, a @@ -752,7 +749,7 @@ class Action { // Constructs a null Action. Needed for storing Action objects in // STL containers. - Action() {} + Action() = default; // Construct an Action from a specified callable. // This cannot take std::function directly, because then Action would not be @@ -1276,7 +1273,7 @@ class AssignAction { const T2 value_; }; -#if !GTEST_OS_WINDOWS_MOBILE +#ifndef GTEST_OS_WINDOWS_MOBILE // Implements the SetErrnoAndReturn action to simulate return from // various system calls and libc functions. @@ -1420,17 +1417,19 @@ struct WithArgsAction { // providing a call operator because even with a particular set of arguments // they don't have a fixed return type. - template >::type...)>>::value, - int>::type = 0> + template < + typename R, typename... Args, + typename std::enable_if< + std::is_convertible>...)>>::value, + int>::type = 0> operator OnceAction() && { // NOLINT struct OA { OnceAction> inner_action; @@ -1445,17 +1444,19 @@ struct WithArgsAction { return OA{std::move(inner_action)}; } - template >::type...)>>::value, - int>::type = 0> + template < + typename R, typename... Args, + typename std::enable_if< + std::is_convertible>...)>>::value, + int>::type = 0> operator Action() const { // NOLINT Action> converted(inner_action); @@ -1925,7 +1926,7 @@ PolymorphicAction> Assign(T1* ptr, T2 val) { return MakePolymorphicAction(internal::AssignAction(ptr, val)); } -#if !GTEST_OS_WINDOWS_MOBILE +#ifndef GTEST_OS_WINDOWS_MOBILE // Creates an action that sets errno and returns the appropriate error. template @@ -2291,8 +2292,6 @@ template } // namespace testing -#ifdef _MSC_VER -#pragma warning(pop) -#endif +GTEST_DISABLE_MSC_WARNINGS_POP_() // 4100 #endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_