diff options
Diffstat (limited to 'googlemock/include/gmock/gmock-generated-actions.h')
-rw-r--r-- | googlemock/include/gmock/gmock-generated-actions.h | 129 |
1 files changed, 1 insertions, 128 deletions
diff --git a/googlemock/include/gmock/gmock-generated-actions.h b/googlemock/include/gmock/gmock-generated-actions.h index cee96dae..20b78cd4 100644 --- a/googlemock/include/gmock/gmock-generated-actions.h +++ b/googlemock/include/gmock/gmock-generated-actions.h @@ -47,133 +47,6 @@ #include "gmock/gmock-actions.h" #include "gmock/internal/gmock-port.h" -namespace testing { -namespace internal { - -// A macro from the ACTION* family (defined later in this file) -// defines an action that can be used in a mock function. Typically, -// these actions only care about a subset of the arguments of the mock -// function. For example, if such an action only uses the second -// argument, it can be used in any mock function that takes >= 2 -// arguments where the type of the second argument is compatible. -// -// Therefore, the action implementation must be prepared to take more -// arguments than it needs. The ExcessiveArg type is used to -// represent those excessive arguments. In order to keep the compiler -// error messages tractable, we define it in the testing namespace -// instead of testing::internal. However, this is an INTERNAL TYPE -// and subject to change without notice, so a user MUST NOT USE THIS -// TYPE DIRECTLY. -struct ExcessiveArg {}; - -// A helper class needed for implementing the ACTION* macros. -template <typename Result, class Impl> -class ActionHelper { - public: - static Result Perform(Impl* impl, const ::std::tuple<>& args) { - return impl->template gmock_PerformImpl<>(args, ExcessiveArg(), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); - } - - template <typename A0> - static Result Perform(Impl* impl, const ::std::tuple<A0>& args) { - return impl->template gmock_PerformImpl<A0>(args, std::get<0>(args), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); - } - - template <typename A0, typename A1> - static Result Perform(Impl* impl, const ::std::tuple<A0, A1>& args) { - return impl->template gmock_PerformImpl<A0, A1>(args, std::get<0>(args), - std::get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); - } - - template <typename A0, typename A1, typename A2> - static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2>& args) { - return impl->template gmock_PerformImpl<A0, A1, A2>(args, - std::get<0>(args), std::get<1>(args), std::get<2>(args), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); - } - - template <typename A0, typename A1, typename A2, typename A3> - static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3>& args) { - return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, - std::get<0>(args), std::get<1>(args), std::get<2>(args), - std::get<3>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); - } - - template <typename A0, typename A1, typename A2, typename A3, typename A4> - static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, - A4>& args) { - return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(args, - std::get<0>(args), std::get<1>(args), std::get<2>(args), - std::get<3>(args), std::get<4>(args), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); - } - - template <typename A0, typename A1, typename A2, typename A3, typename A4, - typename A5> - static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, - A5>& args) { - return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(args, - std::get<0>(args), std::get<1>(args), std::get<2>(args), - std::get<3>(args), std::get<4>(args), std::get<5>(args), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); - } - - template <typename A0, typename A1, typename A2, typename A3, typename A4, - typename A5, typename A6> - static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5, - A6>& args) { - return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(args, - std::get<0>(args), std::get<1>(args), std::get<2>(args), - std::get<3>(args), std::get<4>(args), std::get<5>(args), - std::get<6>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); - } - - template <typename A0, typename A1, typename A2, typename A3, typename A4, - typename A5, typename A6, typename A7> - static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5, - A6, A7>& args) { - return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, - A7>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args), - std::get<3>(args), std::get<4>(args), std::get<5>(args), - std::get<6>(args), std::get<7>(args), ExcessiveArg(), ExcessiveArg()); - } - - template <typename A0, typename A1, typename A2, typename A3, typename A4, - typename A5, typename A6, typename A7, typename A8> - static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5, - A6, A7, A8>& args) { - return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, - A8>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args), - std::get<3>(args), std::get<4>(args), std::get<5>(args), - std::get<6>(args), std::get<7>(args), std::get<8>(args), - ExcessiveArg()); - } - - template <typename A0, typename A1, typename A2, typename A3, typename A4, - typename A5, typename A6, typename A7, typename A8, typename A9> - static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5, - A6, A7, A8, A9>& args) { - return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8, - A9>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args), - std::get<3>(args), std::get<4>(args), std::get<5>(args), - std::get<6>(args), std::get<7>(args), std::get<8>(args), - std::get<9>(args)); - } -}; - -} // namespace internal -} // namespace testing - // The ACTION* family of macros can be used in a namespace scope to // define custom actions easily. The syntax: // @@ -1638,7 +1511,7 @@ struct AdlTag {}; // InvokeArgumentAdl - a helper for InvokeArgument. // The basic overloads are provided here for generic functors. // Overloads for other custom-callables are provided in the -// internal/custom/callback-actions.h header. +// internal/custom/gmock-generated-actions.h header. template <typename R, typename F> R InvokeArgumentAdl(AdlTag, F f) { |