From 7d3b73c85a42811309eac26e5cbe054c40b64785 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Tue, 9 Oct 2018 14:50:26 -0400 Subject: Unconditionally use std::tuple. Remove all mention of TR1 tuple and our own implementation of tuple. PiperOrigin-RevId: 216395043 --- googlemock/include/gmock/gmock-actions.h | 6 +- googlemock/include/gmock/gmock-generated-actions.h | 366 +++---- .../include/gmock/gmock-generated-actions.h.pump | 34 +- .../gmock/gmock-generated-function-mockers.h | 1035 +++++++++----------- .../gmock/gmock-generated-function-mockers.h.pump | 4 +- .../include/gmock/gmock-generated-matchers.h | 138 +-- .../include/gmock/gmock-generated-matchers.h.pump | 19 +- googlemock/include/gmock/gmock-matchers.h | 92 +- googlemock/include/gmock/gmock-more-actions.h | 16 +- .../internal/gmock-generated-internal-utils.h | 91 +- .../internal/gmock-generated-internal-utils.h.pump | 8 +- .../include/gmock/internal/gmock-internal-utils.h | 11 +- 12 files changed, 887 insertions(+), 933 deletions(-) (limited to 'googlemock/include') diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index e3b3f094..8e7e0e7b 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -439,7 +439,7 @@ class Action { // template // Result Perform(const ArgumentTuple& args) const { // // Processes the arguments and returns a result, using -// // tr1::get(args) to get the N-th (0-based) argument in the tuple. +// // std::get(args) to get the N-th (0-based) argument in the tuple. // } // ... // }; @@ -838,7 +838,7 @@ class SetArgumentPointeeAction { template void Perform(const ArgumentTuple& args) const { CompileAssertTypesEqual(); - *::testing::get(args) = value_; + *::std::get(args) = value_; } private: @@ -861,7 +861,7 @@ class SetArgumentPointeeAction { template void Perform(const ArgumentTuple& args) const { CompileAssertTypesEqual(); - ::testing::get(args)->CopyFrom(*proto_); + ::std::get(args)->CopyFrom(*proto_); } private: diff --git a/googlemock/include/gmock/gmock-generated-actions.h b/googlemock/include/gmock/gmock-generated-actions.h index 260036da..3ea14dde 100644 --- a/googlemock/include/gmock/gmock-generated-actions.h +++ b/googlemock/include/gmock/gmock-generated-actions.h @@ -54,164 +54,167 @@ template class InvokeHelper; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::testing::tuple<>&) { + static R Invoke(Function function, const ::std::tuple<>&) { return function(); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<>&) { + const ::std::tuple<>&) { return (obj_ptr->*method_ptr)(); } template static R InvokeCallback(CallbackType* callback, - const ::testing::tuple<>&) { + const ::std::tuple<>&) { return callback->Run(); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::testing::tuple& args) { - return function(get<0>(args)); + static R Invoke(Function function, const ::std::tuple& args) { + return function(std::get<0>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple& args) { - return (obj_ptr->*method_ptr)(get<0>(args)); + const ::std::tuple& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args)); } template static R InvokeCallback(CallbackType* callback, - const ::testing::tuple& args) { - return callback->Run(get<0>(args)); + const ::std::tuple& args) { + return callback->Run(std::get<0>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::testing::tuple& args) { - return function(get<0>(args), get<1>(args)); + static R Invoke(Function function, const ::std::tuple& args) { + return function(std::get<0>(args), std::get<1>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args)); + const ::std::tuple& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args)); } template static R InvokeCallback(CallbackType* callback, - const ::testing::tuple& args) { - return callback->Run(get<0>(args), get<1>(args)); + const ::std::tuple& args) { + return callback->Run(std::get<0>(args), std::get<1>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::testing::tuple& args) { - return function(get<0>(args), get<1>(args), get<2>(args)); + static R Invoke(Function function, const ::std::tuple& args) { + return function(std::get<0>(args), std::get<1>(args), + std::get<2>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), - get<2>(args)); + const ::std::tuple& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args), + std::get<2>(args)); } template static R InvokeCallback(CallbackType* callback, - const ::testing::tuple& args) { - return callback->Run(get<0>(args), get<1>(args), get<2>(args)); + const ::std::tuple& args) { + return callback->Run(std::get<0>(args), std::get<1>(args), + std::get<2>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::testing::tuple& args) { - return function(get<0>(args), get<1>(args), get<2>(args), - get<3>(args)); + static R Invoke(Function function, const ::std::tuple& args) { + return function(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), - get<2>(args), get<3>(args)); + const ::std::tuple& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args)); } template static R InvokeCallback(CallbackType* callback, - const ::testing::tuple& args) { - return callback->Run(get<0>(args), get<1>(args), get<2>(args), - get<3>(args)); + const ::std::tuple& args) { + return callback->Run(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::testing::tuple& args) { - return function(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args)); + return function(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), - get<2>(args), get<3>(args), get<4>(args)); + const ::std::tuple& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args)); } template static R InvokeCallback(CallbackType* callback, - const ::testing::tuple& args) { - return callback->Run(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args)); + const ::std::tuple& args) { + return callback->Run(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::testing::tuple& args) { - return function(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args), get<5>(args)); + return function(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args), + std::get<5>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), - get<2>(args), get<3>(args), get<4>(args), get<5>(args)); + const ::std::tuple& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args), + std::get<5>(args)); } // There is no InvokeCallback() for 6-tuples @@ -219,23 +222,23 @@ class InvokeHelper > { template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::testing::tuple& args) { - return function(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args), get<5>(args), get<6>(args)); + static R Invoke(Function function, const ::std::tuple& args) { + return function(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)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), - get<2>(args), get<3>(args), get<4>(args), get<5>(args), - get<6>(args)); + const ::std::tuple& args) { + return (obj_ptr->*method_ptr)(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)); } // There is no InvokeCallback() for 7-tuples @@ -243,24 +246,24 @@ class InvokeHelper > { template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::testing::tuple& args) { - return function(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args), get<5>(args), get<6>(args), - get<7>(args)); + static R Invoke(Function function, const ::std::tuple& args) { + return function(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)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), - get<2>(args), get<3>(args), get<4>(args), get<5>(args), - get<6>(args), get<7>(args)); + return (obj_ptr->*method_ptr)(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)); } // There is no InvokeCallback() for 8-tuples @@ -268,24 +271,26 @@ class InvokeHelper > { template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::testing::tuple& args) { - return function(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args), get<5>(args), get<6>(args), - get<7>(args), get<8>(args)); + static R Invoke(Function function, const ::std::tuple& args) { + return function(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)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), - get<2>(args), get<3>(args), get<4>(args), get<5>(args), - get<6>(args), get<7>(args), get<8>(args)); + return (obj_ptr->*method_ptr)(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)); } // There is no InvokeCallback() for 9-tuples @@ -294,25 +299,26 @@ class InvokeHelper > { template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::testing::tuple& args) { - return function(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args), get<5>(args), get<6>(args), - get<7>(args), get<8>(args), get<9>(args)); + static R Invoke(Function function, const ::std::tuple& args) { + return function(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)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), - get<2>(args), get<3>(args), get<4>(args), get<5>(args), - get<6>(args), get<7>(args), get<8>(args), get<9>(args)); + const ::std::tuple& args) { + return (obj_ptr->*method_ptr)(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)); } // There is no InvokeCallback() for 10-tuples @@ -346,20 +352,20 @@ class InvokeCallbackAction { // An INTERNAL macro for extracting the type of a tuple field. It's // subject to change without notice - DO NOT USE IN USER CODE! #define GMOCK_FIELD_(Tuple, N) \ - typename ::testing::tuple_element::type + typename ::std::tuple_element::type // SelectArgs::type is the // type of an n-ary function whose i-th (1-based) argument type is the // k{i}-th (0-based) field of ArgumentTuple, which must be a tuple // type, and whose return type is Result. For example, -// SelectArgs, 0, 3>::type +// SelectArgs, 0, 3>::type // is int(bool, long). // // SelectArgs::Select(args) // returns the selected fields (k1, k2, ..., k_n) of args as a tuple. // For example, -// SelectArgs, 2, 0>::Select( -// ::testing::make_tuple(true, 'a', 2.5)) +// SelectArgs, 2, 0>::Select( +// ::std::make_tuple(true, 'a', 2.5)) // returns tuple (2.5, true). // // The numbers in list k1, k2, ..., k_n must be >= 0, where n can be @@ -378,9 +384,10 @@ class SelectArgs { GMOCK_FIELD_(ArgumentTuple, k10)); typedef typename Function::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get(args), get(args), get(args), - get(args), get(args), get(args), get(args), - get(args), get(args), get(args)); + return SelectedArgs(std::get(args), std::get(args), + std::get(args), std::get(args), std::get(args), + std::get(args), std::get(args), std::get(args), + std::get(args), std::get(args)); } }; @@ -402,7 +409,7 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get(args)); + return SelectedArgs(std::get(args)); } }; @@ -414,7 +421,7 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get(args), get(args)); + return SelectedArgs(std::get(args), std::get(args)); } }; @@ -426,7 +433,8 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get(args), get(args), get(args)); + return SelectedArgs(std::get(args), std::get(args), + std::get(args)); } }; @@ -440,8 +448,8 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get(args), get(args), get(args), - get(args)); + return SelectedArgs(std::get(args), std::get(args), + std::get(args), std::get(args)); } }; @@ -455,8 +463,8 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get(args), get(args), get(args), - get(args), get(args)); + return SelectedArgs(std::get(args), std::get(args), + std::get(args), std::get(args), std::get(args)); } }; @@ -471,8 +479,9 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get(args), get(args), get(args), - get(args), get(args), get(args)); + return SelectedArgs(std::get(args), std::get(args), + std::get(args), std::get(args), std::get(args), + std::get(args)); } }; @@ -487,8 +496,9 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get(args), get(args), get(args), - get(args), get(args), get(args), get(args)); + return SelectedArgs(std::get(args), std::get(args), + std::get(args), std::get(args), std::get(args), + std::get(args), std::get(args)); } }; @@ -504,9 +514,9 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get(args), get(args), get(args), - get(args), get(args), get(args), get(args), - get(args)); + return SelectedArgs(std::get(args), std::get(args), + std::get(args), std::get(args), std::get(args), + std::get(args), std::get(args), std::get(args)); } }; @@ -522,9 +532,10 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get(args), get(args), get(args), - get(args), get(args), get(args), get(args), - get(args), get(args)); + return SelectedArgs(std::get(args), std::get(args), + std::get(args), std::get(args), std::get(args), + std::get(args), std::get(args), std::get(args), + std::get(args)); } }; @@ -587,7 +598,7 @@ struct ExcessiveArg {}; template class ActionHelper { public: - static Result Perform(Impl* impl, const ::testing::tuple<>& args) { + static Result Perform(Impl* impl, const ::std::tuple<>& args) { return impl->template gmock_PerformImpl<>(args, ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), @@ -595,95 +606,96 @@ class ActionHelper { } template - static Result Perform(Impl* impl, const ::testing::tuple& args) { - return impl->template gmock_PerformImpl(args, get<0>(args), + static Result Perform(Impl* impl, const ::std::tuple& args) { + return impl->template gmock_PerformImpl(args, std::get<0>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template - static Result Perform(Impl* impl, const ::testing::tuple& args) { - return impl->template gmock_PerformImpl(args, get<0>(args), - get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + static Result Perform(Impl* impl, const ::std::tuple& args) { + return impl->template gmock_PerformImpl(args, std::get<0>(args), + std::get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template - static Result Perform(Impl* impl, const ::testing::tuple& args) { - return impl->template gmock_PerformImpl(args, get<0>(args), - get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(), + static Result Perform(Impl* impl, const ::std::tuple& args) { + return impl->template gmock_PerformImpl(args, + std::get<0>(args), std::get<1>(args), std::get<2>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); + ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template - static Result Perform(Impl* impl, const ::testing::tuple& args) { - return impl->template gmock_PerformImpl(args, get<0>(args), - get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); + static Result Perform(Impl* impl, const ::std::tuple& args) { + return impl->template gmock_PerformImpl(args, + std::get<0>(args), std::get<1>(args), std::get<2>(args), + std::get<3>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template - static Result Perform(Impl* impl, const ::testing::tuple& args) { return impl->template gmock_PerformImpl(args, - get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); + 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 - static Result Perform(Impl* impl, const ::testing::tuple& args) { return impl->template gmock_PerformImpl(args, - get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), - get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); + 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 - static Result Perform(Impl* impl, const ::testing::tuple& args) { + static Result Perform(Impl* impl, const ::std::tuple& args) { return impl->template gmock_PerformImpl(args, - get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), - get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); + 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 - static Result Perform(Impl* impl, const ::testing::tuple& args) { + static Result Perform(Impl* impl, const ::std::tuple& args) { return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), - get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(), - ExcessiveArg()); + 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 - static Result Perform(Impl* impl, const ::testing::tuple& args) { + static Result Perform(Impl* impl, const ::std::tuple& args) { return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), - get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args), + 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 - static Result Perform(Impl* impl, const ::testing::tuple& args) { + static Result Perform(Impl* impl, const ::std::tuple& args) { return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), - get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args), - get<9>(args)); + 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)); } }; @@ -950,8 +962,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, // // MORE INFORMATION: // -// To learn more about using these macros, please search for 'ACTION' -// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md +// To learn more about using these macros, please search for 'ACTION' on +// https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md // An internal macro needed for implementing ACTION*(). #define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\ @@ -991,7 +1003,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, // ACTION_TEMPLATE(DuplicateArg, // HAS_2_TEMPLATE_PARAMS(int, k, typename, T), // AND_1_VALUE_PARAMS(output)) { -// *output = T(::testing::get(args)); +// *output = T(::std::get(args)); // } // ... // int n; @@ -2389,7 +2401,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl( internal::invoke_argument::AdlTag(), - ::testing::get(args)); + ::std::get(args)); } ACTION_TEMPLATE(InvokeArgument, @@ -2398,7 +2410,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl( internal::invoke_argument::AdlTag(), - ::testing::get(args), p0); + ::std::get(args), p0); } ACTION_TEMPLATE(InvokeArgument, @@ -2407,7 +2419,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl( internal::invoke_argument::AdlTag(), - ::testing::get(args), p0, p1); + ::std::get(args), p0, p1); } ACTION_TEMPLATE(InvokeArgument, @@ -2416,7 +2428,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl( internal::invoke_argument::AdlTag(), - ::testing::get(args), p0, p1, p2); + ::std::get(args), p0, p1, p2); } ACTION_TEMPLATE(InvokeArgument, @@ -2425,7 +2437,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl( internal::invoke_argument::AdlTag(), - ::testing::get(args), p0, p1, p2, p3); + ::std::get(args), p0, p1, p2, p3); } ACTION_TEMPLATE(InvokeArgument, @@ -2434,7 +2446,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl( internal::invoke_argument::AdlTag(), - ::testing::get(args), p0, p1, p2, p3, p4); + ::std::get(args), p0, p1, p2, p3, p4); } ACTION_TEMPLATE(InvokeArgument, @@ -2443,7 +2455,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl( internal::invoke_argument::AdlTag(), - ::testing::get(args), p0, p1, p2, p3, p4, p5); + ::std::get(args), p0, p1, p2, p3, p4, p5); } ACTION_TEMPLATE(InvokeArgument, @@ -2452,7 +2464,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl( internal::invoke_argument::AdlTag(), - ::testing::get(args), p0, p1, p2, p3, p4, p5, p6); + ::std::get(args), p0, p1, p2, p3, p4, p5, p6); } ACTION_TEMPLATE(InvokeArgument, @@ -2461,7 +2473,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl( internal::invoke_argument::AdlTag(), - ::testing::get(args), p0, p1, p2, p3, p4, p5, p6, p7); + ::std::get(args), p0, p1, p2, p3, p4, p5, p6, p7); } ACTION_TEMPLATE(InvokeArgument, @@ -2470,7 +2482,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl( internal::invoke_argument::AdlTag(), - ::testing::get(args), p0, p1, p2, p3, p4, p5, p6, p7, p8); + ::std::get(args), p0, p1, p2, p3, p4, p5, p6, p7, p8); } ACTION_TEMPLATE(InvokeArgument, @@ -2479,7 +2491,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl( internal::invoke_argument::AdlTag(), - ::testing::get(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); + ::std::get(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); } // Various overloads for ReturnNew(). diff --git a/googlemock/include/gmock/gmock-generated-actions.h.pump b/googlemock/include/gmock/gmock-generated-actions.h.pump index f1ee4a61..2794ebb7 100644 --- a/googlemock/include/gmock/gmock-generated-actions.h.pump +++ b/googlemock/include/gmock/gmock-generated-actions.h.pump @@ -63,19 +63,19 @@ $range j 1..i $var types = [[$for j [[, typename A$j]]]] $var as = [[$for j, [[A$j]]]] $var args = [[$if i==0 [[]] $else [[ args]]]] -$var gets = [[$for j, [[get<$(j - 1)>(args)]]]] +$var gets = [[$for j, [[std::get<$(j - 1)>(args)]]]] template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::testing::tuple<$as>&$args) { + static R Invoke(Function function, const ::std::tuple<$as>&$args) { return function($gets); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<$as>&$args) { + const ::std::tuple<$as>&$args) { return (obj_ptr->*method_ptr)($gets); } @@ -83,7 +83,7 @@ class InvokeHelper > { $if i <= max_callback_arity [[ template static R InvokeCallback(CallbackType* callback, - const ::testing::tuple<$as>&$args) { + const ::std::tuple<$as>&$args) { return callback->Run($gets); } ]] $else [[ @@ -122,7 +122,7 @@ class InvokeCallbackAction { // An INTERNAL macro for extracting the type of a tuple field. It's // subject to change without notice - DO NOT USE IN USER CODE! #define GMOCK_FIELD_(Tuple, N) \ - typename ::testing::tuple_element::type + typename ::std::tuple_element::type $range i 1..n @@ -130,14 +130,14 @@ $range i 1..n // type of an n-ary function whose i-th (1-based) argument type is the // k{i}-th (0-based) field of ArgumentTuple, which must be a tuple // type, and whose return type is Result. For example, -// SelectArgs, 0, 3>::type +// SelectArgs, 0, 3>::type // is int(bool, long). // // SelectArgs::Select(args) // returns the selected fields (k1, k2, ..., k_n) of args as a tuple. // For example, -// SelectArgs, 2, 0>::Select( -// ::testing::make_tuple(true, 'a', 2.5)) +// SelectArgs, 2, 0>::Select( +// ::std::make_tuple(true, 'a', 2.5)) // returns tuple (2.5, true). // // The numbers in list k1, k2, ..., k_n must be >= 0, where n can be @@ -150,7 +150,7 @@ class SelectArgs { typedef Result type($for i, [[GMOCK_FIELD_(ArgumentTuple, k$i)]]); typedef typename Function::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs($for i, [[get(args)]]); + return SelectedArgs($for i, [[std::get(args)]]); } }; @@ -166,7 +166,7 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& [[]] $if i == 1 [[/* args */]] $else [[args]]) { - return SelectedArgs($for j1, [[get(args)]]); + return SelectedArgs($for j1, [[std::get(args)]]); } }; @@ -240,12 +240,12 @@ $range j 0..i-1 ]]]] $range j 0..i-1 $var As = [[$for j, [[A$j]]]] -$var as = [[$for j, [[get<$j>(args)]]]] +$var as = [[$for j, [[std::get<$j>(args)]]]] $range k 1..n-i $var eas = [[$for k, [[ExcessiveArg()]]]] $var arg_list = [[$if (i==0) | (i==n) [[$as$eas]] $else [[$as, $eas]]]] $template - static Result Perform(Impl* impl, const ::testing::tuple<$As>& args) { + static Result Perform(Impl* impl, const ::std::tuple<$As>& args) { return impl->template gmock_PerformImpl<$As>(args, $arg_list); } @@ -395,8 +395,8 @@ $range j2 2..i // // MORE INFORMATION: // -// To learn more about using these macros, please search for 'ACTION' -// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md +// To learn more about using these macros, please search for 'ACTION' on +// https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md $range i 0..n $range k 0..n-1 @@ -432,7 +432,7 @@ $for k [[, \ // ACTION_TEMPLATE(DuplicateArg, // HAS_2_TEMPLATE_PARAMS(int, k, typename, T), // AND_1_VALUE_PARAMS(output)) { -// *output = T(::testing::get(args)); +// *output = T(::std::get(args)); // } // ... // int n; @@ -796,7 +796,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl( internal::invoke_argument::AdlTag(), - ::testing::get(args)$for j [[, p$j]]); + ::std::get(args)$for j [[, p$j]]); } ]] diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h b/googlemock/include/gmock/gmock-generated-function-mockers.h index aab45820..98861156 100644 --- a/googlemock/include/gmock/gmock-generated-function-mockers.h +++ b/googlemock/include/gmock/gmock-generated-function-mockers.h @@ -70,7 +70,7 @@ class FunctionMocker : public typedef typename internal::Function::ArgumentTuple ArgumentTuple; MockSpec With() { - return MockSpec(this, ::testing::make_tuple()); + return MockSpec(this, ::std::make_tuple()); } R Invoke() { @@ -90,7 +90,7 @@ class FunctionMocker : public typedef typename internal::Function::ArgumentTuple ArgumentTuple; MockSpec With(const Matcher& m1) { - return MockSpec(this, ::testing::make_tuple(m1)); + return MockSpec(this, ::std::make_tuple(m1)); } R Invoke(A1 a1) { @@ -110,7 +110,7 @@ class FunctionMocker : public typedef typename internal::Function::ArgumentTuple ArgumentTuple; MockSpec With(const Matcher& m1, const Matcher& m2) { - return MockSpec(this, ::testing::make_tuple(m1, m2)); + return MockSpec(this, ::std::make_tuple(m1, m2)); } R Invoke(A1 a1, A2 a2) { @@ -132,7 +132,7 @@ class FunctionMocker : public MockSpec With(const Matcher& m1, const Matcher& m2, const Matcher& m3) { - return MockSpec(this, ::testing::make_tuple(m1, m2, m3)); + return MockSpec(this, ::std::make_tuple(m1, m2, m3)); } R Invoke(A1 a1, A2 a2, A3 a3) { @@ -154,7 +154,7 @@ class FunctionMocker : public MockSpec With(const Matcher& m1, const Matcher& m2, const Matcher& m3, const Matcher& m4) { - return MockSpec(this, ::testing::make_tuple(m1, m2, m3, m4)); + return MockSpec(this, ::std::make_tuple(m1, m2, m3, m4)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) { @@ -178,7 +178,7 @@ class FunctionMocker : public MockSpec With(const Matcher& m1, const Matcher& m2, const Matcher& m3, const Matcher& m4, const Matcher& m5) { - return MockSpec(this, ::testing::make_tuple(m1, m2, m3, m4, m5)); + return MockSpec(this, ::std::make_tuple(m1, m2, m3, m4, m5)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { @@ -203,7 +203,7 @@ class FunctionMocker : public MockSpec With(const Matcher& m1, const Matcher& m2, const Matcher& m3, const Matcher& m4, const Matcher& m5, const Matcher& m6) { - return MockSpec(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6)); + return MockSpec(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { @@ -229,7 +229,7 @@ class FunctionMocker : public MockSpec With(const Matcher& m1, const Matcher& m2, const Matcher& m3, const Matcher& m4, const Matcher& m5, const Matcher& m6, const Matcher& m7) { - return MockSpec(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7)); + return MockSpec(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { @@ -255,8 +255,7 @@ class FunctionMocker : public MockSpec With(const Matcher& m1, const Matcher& m2, const Matcher& m3, const Matcher& m4, const Matcher& m5, const Matcher& m6, const Matcher& m7, const Matcher& m8) { - return MockSpec(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7, - m8)); + return MockSpec(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) { @@ -284,8 +283,8 @@ class FunctionMocker : public const Matcher& m3, const Matcher& m4, const Matcher& m5, const Matcher& m6, const Matcher& m7, const Matcher& m8, const Matcher& m9) { - return MockSpec(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7, - m8, m9)); + return MockSpec(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8, + m9)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { @@ -314,8 +313,8 @@ class FunctionMocker : public const Matcher& m3, const Matcher& m4, const Matcher& m5, const Matcher& m6, const Matcher& m7, const Matcher& m8, const Matcher& m9, const Matcher& m10) { - return MockSpec(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7, - m8, m9, m10)); + return MockSpec(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8, + m9, m10)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, @@ -418,534 +417,478 @@ using internal::FunctionMocker; GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) ct Method() constness { \ - GTEST_COMPILE_ASSERT_( \ - (::testing::tuple_size::ArgumentTuple>::value == 0), \ - this_method_does_not_take_0_arguments); \ - GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(0, constness, Method).Invoke(); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method() constness { \ - GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(0, constness, Method).With(); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(); \ - } \ +#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + ) constness { \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 0), \ + this_method_does_not_take_0_arguments); \ + GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(0, constness, Method).Invoke(); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method() constness { \ + GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(0, constness, Method).With(); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(); \ + } \ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \ - Method) + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ - GTEST_COMPILE_ASSERT_( \ - (::testing::tuple_size::ArgumentTuple>::value == 1), \ - this_method_does_not_take_1_argument); \ - GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(1, constness, Method) \ - .Invoke(::testing::internal::forward( \ - gmock_a1)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ - GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \ - Method) +#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 1), \ + this_method_does_not_take_1_argument); \ + GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(1, constness, \ + Method).Invoke(::testing::internal::forward(gmock_a1)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ + GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ - GTEST_COMPILE_ASSERT_( \ - (::testing::tuple_size::ArgumentTuple>::value == 2), \ - this_method_does_not_take_2_arguments); \ - GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(2, constness, Method) \ - .Invoke(::testing::internal::forward( \ - gmock_a1), \ - ::testing::internal::forward( \ - gmock_a2)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ - GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A(), \ - ::testing::A()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \ - Method) +#define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2) constness { \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 2), \ + this_method_does_not_take_2_arguments); \ + GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(2, constness, \ + Method).Invoke(::testing::internal::forward(gmock_a1), \ + ::testing::internal::forward(gmock_a2)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ + GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A(), \ + ::testing::A()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ - GTEST_COMPILE_ASSERT_( \ - (::testing::tuple_size::ArgumentTuple>::value == 3), \ - this_method_does_not_take_3_arguments); \ - GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(3, constness, Method) \ - .Invoke(::testing::internal::forward( \ - gmock_a1), \ - ::testing::internal::forward( \ - gmock_a2), \ - ::testing::internal::forward( \ - gmock_a3)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ - GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(3, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A(), \ - ::testing::A(), \ - ::testing::A()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \ - Method) +#define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, \ + __VA_ARGS__) gmock_a3) constness { \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 3), \ + this_method_does_not_take_3_arguments); \ + GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(3, constness, \ + Method).Invoke(::testing::internal::forward(gmock_a1), \ + ::testing::internal::forward(gmock_a2), \ + ::testing::internal::forward(gmock_a3)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ + GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A(), \ + ::testing::A(), \ + ::testing::A()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ - GTEST_COMPILE_ASSERT_( \ - (::testing::tuple_size::ArgumentTuple>::value == 4), \ - this_method_does_not_take_4_arguments); \ - GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(4, constness, Method) \ - .Invoke(::testing::internal::forward( \ - gmock_a1), \ - ::testing::internal::forward( \ - gmock_a2), \ - ::testing::internal::forward( \ - gmock_a3), \ - ::testing::internal::forward( \ - gmock_a4)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ - GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(4, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \ - Method) +#define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 4), \ + this_method_does_not_take_4_arguments); \ + GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(4, constness, \ + Method).Invoke(::testing::internal::forward(gmock_a1), \ + ::testing::internal::forward(gmock_a2), \ + ::testing::internal::forward(gmock_a3), \ + ::testing::internal::forward(gmock_a4)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ + GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ - GTEST_COMPILE_ASSERT_( \ - (::testing::tuple_size::ArgumentTuple>::value == 5), \ - this_method_does_not_take_5_arguments); \ - GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(5, constness, Method) \ - .Invoke(::testing::internal::forward( \ - gmock_a1), \ - ::testing::internal::forward( \ - gmock_a2), \ - ::testing::internal::forward( \ - gmock_a3), \ - ::testing::internal::forward( \ - gmock_a4), \ - ::testing::internal::forward( \ - gmock_a5)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ - GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(5, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \ - Method) +#define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \ + __VA_ARGS__) gmock_a5) constness { \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 5), \ + this_method_does_not_take_5_arguments); \ + GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(5, constness, \ + Method).Invoke(::testing::internal::forward(gmock_a1), \ + ::testing::internal::forward(gmock_a2), \ + ::testing::internal::forward(gmock_a3), \ + ::testing::internal::forward(gmock_a4), \ + ::testing::internal::forward(gmock_a5)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ + GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ - GTEST_COMPILE_ASSERT_( \ - (::testing::tuple_size::ArgumentTuple>::value == 6), \ - this_method_does_not_take_6_arguments); \ - GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(6, constness, Method) \ - .Invoke(::testing::internal::forward( \ - gmock_a1), \ - ::testing::internal::forward( \ - gmock_a2), \ - ::testing::internal::forward( \ - gmock_a3), \ - ::testing::internal::forward( \ - gmock_a4), \ - ::testing::internal::forward( \ - gmock_a5), \ - ::testing::internal::forward( \ - gmock_a6)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ - GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(6, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \ - Method) +#define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \ + __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, \ + __VA_ARGS__) gmock_a6) constness { \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 6), \ + this_method_does_not_take_6_arguments); \ + GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(6, constness, \ + Method).Invoke(::testing::internal::forward(gmock_a1), \ + ::testing::internal::forward(gmock_a2), \ + ::testing::internal::forward(gmock_a3), \ + ::testing::internal::forward(gmock_a4), \ + ::testing::internal::forward(gmock_a5), \ + ::testing::internal::forward(gmock_a6)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ + GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ - GTEST_COMPILE_ASSERT_( \ - (::testing::tuple_size::ArgumentTuple>::value == 7), \ - this_method_does_not_take_7_arguments); \ - GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(7, constness, Method) \ - .Invoke(::testing::internal::forward( \ - gmock_a1), \ - ::testing::internal::forward( \ - gmock_a2), \ - ::testing::internal::forward( \ - gmock_a3), \ - ::testing::internal::forward( \ - gmock_a4), \ - ::testing::internal::forward( \ - gmock_a5), \ - ::testing::internal::forward( \ - gmock_a6), \ - ::testing::internal::forward( \ - gmock_a7)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ - GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(7, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \ - gmock_a7); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \ - Method) +#define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \ + __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 7), \ + this_method_does_not_take_7_arguments); \ + GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(7, constness, \ + Method).Invoke(::testing::internal::forward(gmock_a1), \ + ::testing::internal::forward(gmock_a2), \ + ::testing::internal::forward(gmock_a3), \ + ::testing::internal::forward(gmock_a4), \ + ::testing::internal::forward(gmock_a5), \ + ::testing::internal::forward(gmock_a6), \ + ::testing::internal::forward(gmock_a7)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ + GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ - GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ - GTEST_COMPILE_ASSERT_( \ - (::testing::tuple_size::ArgumentTuple>::value == 8), \ - this_method_does_not_take_8_arguments); \ - GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(8, constness, Method) \ - .Invoke(::testing::internal::forward( \ - gmock_a1), \ - ::testing::internal::forward( \ - gmock_a2), \ - ::testing::internal::forward( \ - gmock_a3), \ - ::testing::internal::forward( \ - gmock_a4), \ - ::testing::internal::forward( \ - gmock_a5), \ - ::testing::internal::forward( \ - gmock_a6), \ - ::testing::internal::forward( \ - gmock_a7), \ - ::testing::internal::forward( \ - gmock_a8)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ - GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ - GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(8, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \ - gmock_a7, gmock_a8); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \ - Method) +#define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \ + __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, GMOCK_ARG_(tn, 8, \ + __VA_ARGS__) gmock_a8) constness { \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 8), \ + this_method_does_not_take_8_arguments); \ + GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(8, constness, \ + Method).Invoke(::testing::internal::forward(gmock_a1), \ + ::testing::internal::forward(gmock_a2), \ + ::testing::internal::forward(gmock_a3), \ + ::testing::internal::forward(gmock_a4), \ + ::testing::internal::forward(gmock_a5), \ + ::testing::internal::forward(gmock_a6), \ + ::testing::internal::forward(gmock_a7), \ + ::testing::internal::forward(gmock_a8)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ + GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ + GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ - GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \ - GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ - GTEST_COMPILE_ASSERT_( \ - (::testing::tuple_size::ArgumentTuple>::value == 9), \ - this_method_does_not_take_9_arguments); \ - GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(9, constness, Method) \ - .Invoke(::testing::internal::forward( \ - gmock_a1), \ - ::testing::internal::forward( \ - gmock_a2), \ - ::testing::internal::forward( \ - gmock_a3), \ - ::testing::internal::forward( \ - gmock_a4), \ - ::testing::internal::forward( \ - gmock_a5), \ - ::testing::internal::forward( \ - gmock_a6), \ - ::testing::internal::forward( \ - gmock_a7), \ - ::testing::internal::forward( \ - gmock_a8), \ - ::testing::internal::forward( \ - gmock_a9)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ - GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ - GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ - GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(9, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \ - gmock_a7, gmock_a8, gmock_a9); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \ - Method) +#define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \ + __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, GMOCK_ARG_(tn, 8, \ + __VA_ARGS__) gmock_a8, GMOCK_ARG_(tn, 9, \ + __VA_ARGS__) gmock_a9) constness { \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 9), \ + this_method_does_not_take_9_arguments); \ + GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(9, constness, \ + Method).Invoke(::testing::internal::forward(gmock_a1), \ + ::testing::internal::forward(gmock_a2), \ + ::testing::internal::forward(gmock_a3), \ + ::testing::internal::forward(gmock_a4), \ + ::testing::internal::forward(gmock_a5), \ + ::testing::internal::forward(gmock_a6), \ + ::testing::internal::forward(gmock_a7), \ + ::testing::internal::forward(gmock_a8), \ + ::testing::internal::forward(gmock_a9)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ + GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ + GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ + GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \ + gmock_a9); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ - GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \ - GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \ - GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \ - GTEST_COMPILE_ASSERT_( \ - (::testing::tuple_size::ArgumentTuple>::value == 10), \ - this_method_does_not_take_10_arguments); \ - GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(10, constness, Method) \ - .Invoke(::testing::internal::forward( \ - gmock_a1), \ - ::testing::internal::forward( \ - gmock_a2), \ - ::testing::internal::forward( \ - gmock_a3), \ - ::testing::internal::forward( \ - gmock_a4), \ - ::testing::internal::forward( \ - gmock_a5), \ - ::testing::internal::forward( \ - gmock_a6), \ - ::testing::internal::forward( \ - gmock_a7), \ - ::testing::internal::forward( \ - gmock_a8), \ - ::testing::internal::forward( \ - gmock_a9), \ - ::testing::internal::forward( \ - gmock_a10)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ - GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ - GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \ - GMOCK_MATCHER_(tn, 10, __VA_ARGS__) gmock_a10) constness { \ - GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(10, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \ - gmock_a7, gmock_a8, gmock_a9, gmock_a10); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A(), \ - ::testing::A()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \ - Method) +#define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \ + __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, GMOCK_ARG_(tn, 8, \ + __VA_ARGS__) gmock_a8, GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \ + GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 10), \ + this_method_does_not_take_10_arguments); \ + GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(10, constness, \ + Method).Invoke(::testing::internal::forward(gmock_a1), \ + ::testing::internal::forward(gmock_a2), \ + ::testing::internal::forward(gmock_a3), \ + ::testing::internal::forward(gmock_a4), \ + ::testing::internal::forward(gmock_a5), \ + ::testing::internal::forward(gmock_a6), \ + ::testing::internal::forward(gmock_a7), \ + ::testing::internal::forward(gmock_a8), \ + ::testing::internal::forward(gmock_a9), \ + ::testing::internal::forward(gmock_a10)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ + GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ + GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \ + GMOCK_MATCHER_(tn, 10, \ + __VA_ARGS__) gmock_a10) constness { \ + GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \ + gmock_a10); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A(), \ + ::testing::A()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \ + Method) #define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__) #define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__) @@ -1175,7 +1118,9 @@ class MockFunction { #if GTEST_HAS_STD_FUNCTION_ ::std::function AsStdFunction() { - return [this](A0 a0) -> R { return this->Call(::std::forward(a0)); }; + return [this](A0 a0) -> R { + return this->Call(::std::forward(a0)); + }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1213,7 +1158,7 @@ class MockFunction { ::std::function AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2) -> R { return this->Call(::std::forward(a0), ::std::forward(a1), - ::std::forward(a2)); + ::std::forward(a2)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1233,7 +1178,7 @@ class MockFunction { ::std::function AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2, A3 a3) -> R { return this->Call(::std::forward(a0), ::std::forward(a1), - ::std::forward(a2), ::std::forward(a3)); + ::std::forward(a2), ::std::forward(a3)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1254,8 +1199,8 @@ class MockFunction { ::std::function AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) -> R { return this->Call(::std::forward(a0), ::std::forward(a1), - ::std::forward(a2), ::std::forward(a3), - ::std::forward(a4)); + ::std::forward(a2), ::std::forward(a3), + ::std::forward(a4)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1276,8 +1221,8 @@ class MockFunction { ::std::function AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -> R { return this->Call(::std::forward(a0), ::std::forward(a1), - ::std::forward(a2), ::std::forward(a3), - ::std::forward(a4), ::std::forward(a5)); + ::std::forward(a2), ::std::forward(a3), + ::std::forward(a4), ::std::forward(a5)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1298,9 +1243,9 @@ class MockFunction { ::std::function AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -> R { return this->Call(::std::forward(a0), ::std::forward(a1), - ::std::forward(a2), ::std::forward(a3), - ::std::forward(a4), ::std::forward(a5), - ::std::forward(a6)); + ::std::forward(a2), ::std::forward(a3), + ::std::forward(a4), ::std::forward(a5), + ::std::forward(a6)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1321,9 +1266,9 @@ class MockFunction { ::std::function AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -> R { return this->Call(::std::forward(a0), ::std::forward(a1), - ::std::forward(a2), ::std::forward(a3), - ::std::forward(a4), ::std::forward(a5), - ::std::forward(a6), ::std::forward(a7)); + ::std::forward(a2), ::std::forward(a3), + ::std::forward(a4), ::std::forward(a5), + ::std::forward(a6), ::std::forward(a7)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1343,12 +1288,12 @@ class MockFunction { #if GTEST_HAS_STD_FUNCTION_ ::std::function AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, - A8 a8) -> R { + A8 a8) -> R { return this->Call(::std::forward(a0), ::std::forward(a1), - ::std::forward(a2), ::std::forward(a3), - ::std::forward(a4), ::std::forward(a5), - ::std::forward(a6), ::std::forward(a7), - ::std::forward(a8)); + ::std::forward(a2), ::std::forward(a3), + ::std::forward(a4), ::std::forward(a5), + ::std::forward(a6), ::std::forward(a7), + ::std::forward(a8)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1368,13 +1313,13 @@ class MockFunction { #if GTEST_HAS_STD_FUNCTION_ ::std::function AsStdFunction() { - return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, - A9 a9) -> R { + return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, + A8 a8, A9 a9) -> R { return this->Call(::std::forward(a0), ::std::forward(a1), - ::std::forward(a2), ::std::forward(a3), - ::std::forward(a4), ::std::forward(a5), - ::std::forward(a6), ::std::forward(a7), - ::std::forward(a8), ::std::forward(a9)); + ::std::forward(a2), ::std::forward(a3), + ::std::forward(a4), ::std::forward(a5), + ::std::forward(a6), ::std::forward(a7), + ::std::forward(a8), ::std::forward(a9)); }; } #endif // GTEST_HAS_STD_FUNCTION_ diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump index 106abe84..e05b18db 100644 --- a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +++ b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump @@ -81,7 +81,7 @@ class FunctionMocker : public typedef typename internal::Function::ArgumentTuple ArgumentTuple; MockSpec With($matchers) { - return MockSpec(this, ::testing::make_tuple($ms)); + return MockSpec(this, ::std::make_tuple($ms)); } R Invoke($Aas) { @@ -194,7 +194,7 @@ $var anything_matchers = [[$for j, \ #define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ $arg_as) constness { \ - GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value == $i), \ this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \ GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \ diff --git a/googlemock/include/gmock/gmock-generated-matchers.h b/googlemock/include/gmock/gmock-generated-matchers.h index 61fe66ad..745ee331 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h +++ b/googlemock/include/gmock/gmock-generated-matchers.h @@ -51,7 +51,7 @@ namespace internal { // The type of the i-th (0-based) field of Tuple. #define GMOCK_FIELD_TYPE_(Tuple, i) \ - typename ::testing::tuple_element::type + typename ::std::tuple_element::type // TupleFields is for selecting fields from a // tuple of type Tuple. It has two members: @@ -59,10 +59,11 @@ namespace internal { // type: a tuple type whose i-th field is the ki-th field of Tuple. // GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple. // -// For example, in class TupleFields, 2, 0>, we have: +// For example, in class TupleFields, 2, 0>, +// we have: // -// type is tuple, and -// GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true). +// type is std::tuple, and +// GetSelectedFields(std::make_tuple(true, 'a', 42)) is (42, true). template class TupleFields { public: - typedef ::testing::tuple type; + typedef ::std::tuple type; static type GetSelectedFields(const Tuple& t) { - return type(get(t), get(t), get(t), get(t), get(t), - get(t), get(t), get(t), get(t), get(t)); + return type(std::get(t), std::get(t), std::get(t), + std::get(t), std::get(t), std::get(t), std::get(t), + std::get(t), std::get(t), std::get(t)); } }; @@ -91,7 +92,7 @@ class TupleFields { template class TupleFields { public: - typedef ::testing::tuple<> type; + typedef ::std::tuple<> type; static type GetSelectedFields(const Tuple& /* t */) { return type(); } @@ -100,77 +101,77 @@ class TupleFields { template class TupleFields { public: - typedef ::testing::tuple type; + typedef ::std::tuple type; static type GetSelectedFields(const Tuple& t) { - return type(get(t)); + return type(std::get(t)); } }; template class TupleFields { public: - typedef ::testing::tuple type; + typedef ::std::tuple type; static type GetSelectedFields(const Tuple& t) { - return type(get(t), get(t)); + return type(std::get(t), std::get(t)); } }; template class TupleFields { public: - typedef ::testing::tuple type; + typedef ::std::tuple type; static type GetSelectedFields(const Tuple& t) { - return type(get(t), get(t), get(t)); + return type(std::get(t), std::get(t), std::get(t)); } }; template class TupleFields { public: - typedef ::testing::tuple type; + typedef ::std::tuple type; static type GetSelectedFields(const Tuple& t) { - return type(get(t), get(t), get(t), get(t)); + return type(std::get(t), std::get(t), std::get(t), + std::get(t)); } }; template class TupleFields { public: - typedef ::testing::tuple type; + typedef ::std::tuple type; static type GetSelectedFields(const Tuple& t) { - return type(get(t), get(t), get(t), get(t), get(t)); + return type(std::get(t), std::get(t), std::get(t), + std::get(t), std::get(t)); } }; template class TupleFields { public: - typedef ::testing::tuple type; + typedef ::std::tuple type; static type GetSelectedFields(const Tuple& t) { - return type(get(t), get(t), get(t), get(t), get(t), - get(t)); + return type(std::get(t), std::get(t), std::get(t), + std::get(t), std::get(t), std::get(t)); } }; template class TupleFields { public: - typedef ::testing::tuple type; + typedef ::std::tuple type; static type GetSelectedFields(const Tuple& t) { - return type(get(t), get(t), get(t), get(t), get(t), - get(t), get(t)); + return type(std::get(t), std::get(t), std::get(t), + std::get(t), std::get(t), std::get(t), std::get(t)); } }; @@ -178,14 +179,14 @@ template class TupleFields { public: - typedef ::testing::tuple type; + typedef ::std::tuple type; static type GetSelectedFields(const Tuple& t) { - return type(get(t), get(t), get(t), get(t), get(t), - get(t), get(t), get(t)); + return type(std::get(t), std::get(t), std::get(t), + std::get(t), std::get(t), std::get(t), std::get(t), + std::get(t)); } }; @@ -193,14 +194,15 @@ template class TupleFields { public: - typedef ::testing::tuple type; + typedef ::std::tuple type; static type GetSelectedFields(const Tuple& t) { - return type(get(t), get(t), get(t), get(t), get(t), - get(t), get(t), get(t), get(t)); + return type(std::get(t), std::get(t), std::get(t), + std::get(t), std::get(t), std::get(t), std::get(t), + std::get(t), std::get(t)); } }; @@ -466,6 +468,7 @@ Args(const InnerMatcher& matcher) { } + // AnyOf(m1, m2, ..., mk) matches any value that matches any of the given // sub-matchers. AnyOf is called fully qualified to prevent ADL from firing. @@ -795,7 +798,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple<>()));\ + ::std::tuple<>()));\ }\ };\ template \ @@ -845,7 +848,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple(p0)));\ + ::std::tuple(p0)));\ }\ };\ template \ @@ -901,7 +904,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple(p0, p1)));\ + ::std::tuple(p0, p1)));\ }\ };\ template \ @@ -963,8 +966,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple(p0, p1, \ - p2)));\ + ::std::tuple(p0, p1, p2)));\ }\ };\ template \ @@ -1032,8 +1034,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple(p0, p1, p2, p3)));\ + ::std::tuple(p0, \ + p1, p2, p3)));\ }\ };\ template \ @@ -1110,7 +1112,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple(p0, p1, p2, p3, p4)));\ }\ };\ @@ -1192,7 +1194,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple(p0, p1, p2, p3, p4, p5)));\ }\ };\ @@ -1280,7 +1282,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple(p0, p1, p2, p3, p4, p5, \ p6)));\ }\ @@ -1377,7 +1379,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple(p0, p1, p2, \ p3, p4, p5, p6, p7)));\ }\ @@ -1480,7 +1482,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\ }\ @@ -1590,7 +1592,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\ }\ diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump index ad02ea7f..311e1273 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h.pump +++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump @@ -55,7 +55,7 @@ $range i 0..n-1 // The type of the i-th (0-based) field of Tuple. #define GMOCK_FIELD_TYPE_(Tuple, i) \ - typename ::testing::tuple_element::type + typename ::std::tuple_element::type // TupleFields is for selecting fields from a // tuple of type Tuple. It has two members: @@ -63,10 +63,11 @@ $range i 0..n-1 // type: a tuple type whose i-th field is the ki-th field of Tuple. // GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple. // -// For example, in class TupleFields, 2, 0>, we have: +// For example, in class TupleFields, 2, 0>, +// we have: // -// type is tuple, and -// GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true). +// type is std::tuple, and +// GetSelectedFields(std::make_tuple(true, 'a', 42)) is (42, true). template class TupleFields; @@ -75,9 +76,9 @@ class TupleFields; template class TupleFields { public: - typedef ::testing::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type; + typedef ::std::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type; static type GetSelectedFields(const Tuple& t) { - return type($for i, [[get(t)]]); + return type($for i, [[std::get(t)]]); } }; @@ -91,9 +92,9 @@ $range k 0..n-1 template class TupleFields { public: - typedef ::testing::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type; + typedef ::std::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type; static type GetSelectedFields(const Tuple& $if i==0 [[/* t */]] $else [[t]]) { - return type($for j, [[get(t)]]); + return type($for j, [[std::get(t)]]); } }; @@ -534,7 +535,7 @@ $var param_field_decls2 = [[$for j return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\ + ::std::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\ }\ };\ template \ diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 9d31e5d1..08371f1b 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -905,8 +905,8 @@ class TuplePrefix { template static bool Matches(const MatcherTuple& matcher_tuple, const ValueTuple& value_tuple) { - return TuplePrefix::Matches(matcher_tuple, value_tuple) - && get(matcher_tuple).Matches(get(value_tuple)); + return TuplePrefix::Matches(matcher_tuple, value_tuple) && + std::get(matcher_tuple).Matches(std::get(value_tuple)); } // TuplePrefix::ExplainMatchFailuresTo(matchers, values, os) @@ -922,16 +922,16 @@ class TuplePrefix { // Then describes the failure (if any) in the (N - 1)-th (0-based) // field. - typename tuple_element::type matcher = - get(matchers); - typedef typename tuple_element::type Value; - GTEST_REFERENCE_TO_CONST_(Value) value = get(values); + typename std::tuple_element::type matcher = + std::get(matchers); + typedef typename std::tuple_element::type Value; + GTEST_REFERENCE_TO_CONST_(Value) value = std::get(values); StringMatchResultListener listener; if (!matcher.MatchAndExplain(value, &listener)) { // FIXME: include in the message the name of the parameter // as used in MOCK_METHOD*() when possible. *os << " Expected arg #" << N - 1 << ": "; - get(matchers).DescribeTo(os); + std::get(matchers).DescribeTo(os); *os << "\n Actual: "; // We remove the reference in type Value to prevent the // universal printer from printing the address of value, which @@ -971,11 +971,11 @@ bool TupleMatches(const MatcherTuple& matcher_tuple, const ValueTuple& value_tuple) { // Makes sure that matcher_tuple and value_tuple have the same // number of fields. - GTEST_COMPILE_ASSERT_(tuple_size::value == - tuple_size::value, + GTEST_COMPILE_ASSERT_(std::tuple_size::value == + std::tuple_size::value, matcher_and_value_have_different_numbers_of_fields); - return TuplePrefix::value>:: - Matches(matcher_tuple, value_tuple); + return TuplePrefix::value>::Matches(matcher_tuple, + value_tuple); } // Describes failures in matching matchers against values. If there @@ -984,7 +984,7 @@ template void ExplainMatchFailureTupleTo(const MatcherTuple& matchers, const ValueTuple& values, ::std::ostream* os) { - TuplePrefix::value>::ExplainMatchFailuresTo( + TuplePrefix::value>::ExplainMatchFailuresTo( matchers, values, os); } @@ -995,7 +995,7 @@ void ExplainMatchFailureTupleTo(const MatcherTuple& matchers, template class TransformTupleValuesHelper { private: - typedef ::testing::tuple_size TupleSize; + typedef ::std::tuple_size TupleSize; public: // For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'. @@ -1008,7 +1008,7 @@ class TransformTupleValuesHelper { template struct IterateOverTuple { OutIter operator() (Func f, const Tup& t, OutIter out) const { - *out++ = f(::testing::get(t)); + *out++ = f(::std::get(t)); return IterateOverTuple()(f, t, out); } }; @@ -1597,19 +1597,19 @@ class MatchesRegexMatcher { // compared don't have to have the same type. // // The matcher defined here is polymorphic (for example, Eq() can be -// used to match a tuple, a tuple, +// used to match a std::tuple, a std::tuple, // etc). Therefore we use a template type conversion operator in the // implementation. template class PairMatchBase { public: template - operator Matcher< ::testing::tuple >() const { - return MakeMatcher(new Impl< ::testing::tuple >); + operator Matcher<::std::tuple>() const { + return MakeMatcher(new Impl<::std::tuple>); } template - operator Matcher&>() const { - return MakeMatcher(new Impl&>); + operator Matcher&>() const { + return MakeMatcher(new Impl&>); } private: @@ -1623,7 +1623,7 @@ class PairMatchBase { virtual bool MatchAndExplain( Tuple args, MatchResultListener* /* listener */) const { - return Op()(::testing::get<0>(args), ::testing::get<1>(args)); + return Op()(::std::get<0>(args), ::std::get<1>(args)); } virtual void DescribeTo(::std::ostream* os) const { *os << "are " << GetDesc; @@ -1807,7 +1807,7 @@ class VariadicMatcher { std::vector >*, std::integral_constant) const {} - tuple matchers_; + std::tuple matchers_; GTEST_DISALLOW_ASSIGN_(VariadicMatcher); }; @@ -2220,14 +2220,14 @@ class FloatingEq2Matcher { } template - operator Matcher< ::testing::tuple >() const { + operator Matcher<::std::tuple>() const { return MakeMatcher( - new Impl< ::testing::tuple >(max_abs_error_, nan_eq_nan_)); + new Impl<::std::tuple>(max_abs_error_, nan_eq_nan_)); } template - operator Matcher&>() const { + operator Matcher&>() const { return MakeMatcher( - new Impl&>(max_abs_error_, nan_eq_nan_)); + new Impl&>(max_abs_error_, nan_eq_nan_)); } private: @@ -2245,14 +2245,14 @@ class FloatingEq2Matcher { virtual bool MatchAndExplain(Tuple args, MatchResultListener* listener) const { if (max_abs_error_ == -1) { - FloatingEqMatcher fm(::testing::get<0>(args), nan_eq_nan_); - return static_cast >(fm).MatchAndExplain( - ::testing::get<1>(args), listener); + FloatingEqMatcher fm(::std::get<0>(args), nan_eq_nan_); + return static_cast>(fm).MatchAndExplain( + ::std::get<1>(args), listener); } else { - FloatingEqMatcher fm(::testing::get<0>(args), nan_eq_nan_, + FloatingEqMatcher fm(::std::get<0>(args), nan_eq_nan_, max_abs_error_); - return static_cast >(fm).MatchAndExplain( - ::testing::get<1>(args), listener); + return static_cast>(fm).MatchAndExplain( + ::std::get<1>(args), listener); } } virtual void DescribeTo(::std::ostream* os) const { @@ -2956,7 +2956,7 @@ class WhenSortedByMatcher { }; // Implements Pointwise(tuple_matcher, rhs_container). tuple_matcher -// must be able to be safely cast to Matcher >, where T1 and T2 are the types of elements in the LHS // container and the RHS container respectively. template @@ -3001,7 +3001,7 @@ class PointwiseMatcher { // reference, as they may be expensive to copy. We must use tuple // instead of pair here, as a pair cannot hold references (C++ 98, // 20.2.2 [lib.pairs]). - typedef ::testing::tuple InnerMatcherArg; + typedef ::std::tuple InnerMatcherArg; Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs) // mono_tuple_matcher_ holds a monomorphic version of the tuple matcher. @@ -3800,7 +3800,7 @@ class UnorderedElementsAreMatcher { typedef typename View::value_type Element; typedef ::std::vector > MatcherVec; MatcherVec matchers; - matchers.reserve(::testing::tuple_size::value); + matchers.reserve(::std::tuple_size::value); TransformTupleValues(CastAndAppendTransform(), matchers_, ::std::back_inserter(matchers)); return MakeMatcher(new UnorderedElementsAreMatcherImpl( @@ -3822,7 +3822,7 @@ class ElementsAreMatcher { operator Matcher() const { GTEST_COMPILE_ASSERT_( !IsHashTable::value || - ::testing::tuple_size::value < 2, + ::std::tuple_size::value < 2, use_UnorderedElementsAre_with_hash_tables); typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; @@ -3830,7 +3830,7 @@ class ElementsAreMatcher { typedef typename View::value_type Element; typedef ::std::vector > MatcherVec; MatcherVec matchers; - matchers.reserve(::testing::tuple_size::value); + matchers.reserve(::std::tuple_size::value); TransformTupleValues(CastAndAppendTransform(), matchers_, ::std::back_inserter(matchers)); return MakeMatcher(new ElementsAreMatcherImpl( @@ -3923,7 +3923,7 @@ class BoundSecondMatcher { template class Impl : public MatcherInterface { public: - typedef ::testing::tuple ArgTuple; + typedef ::std::tuple ArgTuple; Impl(const Tuple2Matcher& tm, const Second& second) : mono_tuple2_matcher_(SafeMatcherCast(tm)), @@ -4043,6 +4043,7 @@ class VariantMatcher { template bool MatchAndExplain(const Variant& value, ::testing::MatchResultListener* listener) const { + using std::get; if (!listener->IsInterested()) { return holds_alternative(value) && matcher_.Matches(get(value)); } @@ -4817,7 +4818,7 @@ WhenSorted(const ContainerMatcher& container_matcher) { // Matches an STL-style container or a native array that contains the // same number of elements as in rhs, where its i-th element and rhs's // i-th element (as a pair) satisfy the given pair matcher, for all i. -// TupleMatcher must be able to be safely cast to Matcher >, where T1 and T2 are the types of elements in the // LHS container and the RHS container respectively. template @@ -4848,7 +4849,7 @@ inline internal::PointwiseMatcher > Pointwise( // elements as in rhs, where in some permutation of the container, its // i-th element and rhs's i-th element (as a pair) satisfy the given // pair matcher, for all i. Tuple2Matcher must be able to be safely -// cast to Matcher >, where T1 and T2 are +// cast to Matcher >, where T1 and T2 are // the types of elements in the LHS container and the RHS container // respectively. // @@ -5140,20 +5141,21 @@ std::string DescribeMatcher(const M& matcher, bool negation = false) { } template -internal::ElementsAreMatcher::type...>> +internal::ElementsAreMatcher< + std::tuple::type...>> ElementsAre(const Args&... matchers) { return internal::ElementsAreMatcher< - tuple::type...>>( - make_tuple(matchers...)); + std::tuple::type...>>( + std::make_tuple(matchers...)); } template internal::UnorderedElementsAreMatcher< - tuple::type...>> + std::tuple::type...>> UnorderedElementsAre(const Args&... matchers) { return internal::UnorderedElementsAreMatcher< - tuple::type...>>( - make_tuple(matchers...)); + std::tuple::type...>>( + std::make_tuple(matchers...)); } // Define variadic matcher versions. diff --git a/googlemock/include/gmock/gmock-more-actions.h b/googlemock/include/gmock/gmock-more-actions.h index 4d9a28ea..5c6dc8bb 100644 --- a/googlemock/include/gmock/gmock-more-actions.h +++ b/googlemock/include/gmock/gmock-more-actions.h @@ -162,7 +162,7 @@ WithArg(const InnerAction& action) { ACTION_TEMPLATE(ReturnArg, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS()) { - return ::testing::get(args); + return ::std::get(args); } // Action SaveArg(pointer) saves the k-th (0-based) argument of the @@ -170,7 +170,7 @@ ACTION_TEMPLATE(ReturnArg, ACTION_TEMPLATE(SaveArg, HAS_1_TEMPLATE_PARAMS(int, k), AND_1_VALUE_PARAMS(pointer)) { - *pointer = ::testing::get(args); + *pointer = ::std::get(args); } // Action SaveArgPointee(pointer) saves the value pointed to @@ -178,7 +178,7 @@ ACTION_TEMPLATE(SaveArg, ACTION_TEMPLATE(SaveArgPointee, HAS_1_TEMPLATE_PARAMS(int, k), AND_1_VALUE_PARAMS(pointer)) { - *pointer = *::testing::get(args); + *pointer = *::std::get(args); } // Action SetArgReferee(value) assigns 'value' to the variable @@ -186,13 +186,13 @@ ACTION_TEMPLATE(SaveArgPointee, ACTION_TEMPLATE(SetArgReferee, HAS_1_TEMPLATE_PARAMS(int, k), AND_1_VALUE_PARAMS(value)) { - typedef typename ::testing::tuple_element::type argk_type; + typedef typename ::std::tuple_element::type argk_type; // Ensures that argument #k is a reference. If you get a compiler // error on the next line, you are using SetArgReferee(value) in // a mock function whose k-th (0-based) argument is not a reference. GTEST_COMPILE_ASSERT_(internal::is_reference::value, SetArgReferee_must_be_used_with_a_reference_argument); - ::testing::get(args) = value; + ::std::get(args) = value; } // Action SetArrayArgument(first, last) copies the elements in @@ -205,9 +205,9 @@ ACTION_TEMPLATE(SetArrayArgument, AND_2_VALUE_PARAMS(first, last)) { // Visual Studio deprecates ::std::copy, so we use our own copy in that case. #ifdef _MSC_VER - internal::CopyElements(first, last, ::testing::get(args)); + internal::CopyElements(first, last, ::std::get(args)); #else - ::std::copy(first, last, ::testing::get(args)); + ::std::copy(first, last, ::std::get(args)); #endif } @@ -216,7 +216,7 @@ ACTION_TEMPLATE(SetArrayArgument, ACTION_TEMPLATE(DeleteArg, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS()) { - delete ::testing::get(args); + delete ::std::get(args); } // This action returns the value pointed to by 'pointer'. diff --git a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h index eaa56be9..efa04629 100644 --- a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h @@ -70,79 +70,71 @@ template struct MatcherTuple; template <> -struct MatcherTuple< ::testing::tuple<> > { - typedef ::testing::tuple< > type; +struct MatcherTuple< ::std::tuple<> > { + typedef ::std::tuple< > type; }; template -struct MatcherTuple< ::testing::tuple > { - typedef ::testing::tuple > type; +struct MatcherTuple< ::std::tuple > { + typedef ::std::tuple > type; }; template -struct MatcherTuple< ::testing::tuple > { - typedef ::testing::tuple, Matcher > type; +struct MatcherTuple< ::std::tuple > { + typedef ::std::tuple, Matcher > type; }; template -struct MatcherTuple< ::testing::tuple > { - typedef ::testing::tuple, Matcher, Matcher > type; +struct MatcherTuple< ::std::tuple > { + typedef ::std::tuple, Matcher, Matcher > type; }; template -struct MatcherTuple< ::testing::tuple > { - typedef ::testing::tuple, Matcher, Matcher, Matcher > - type; +struct MatcherTuple< ::std::tuple > { + typedef ::std::tuple, Matcher, Matcher, + Matcher > type; }; template -struct MatcherTuple< ::testing::tuple > { - typedef ::testing::tuple, Matcher, Matcher, Matcher, - Matcher > - type; +struct MatcherTuple< ::std::tuple > { + typedef ::std::tuple, Matcher, Matcher, Matcher, + Matcher > type; }; template -struct MatcherTuple< ::testing::tuple > { - typedef ::testing::tuple, Matcher, Matcher, Matcher, - Matcher, Matcher > - type; +struct MatcherTuple< ::std::tuple > { + typedef ::std::tuple, Matcher, Matcher, Matcher, + Matcher, Matcher > type; }; template -struct MatcherTuple< ::testing::tuple > { - typedef ::testing::tuple, Matcher, Matcher, Matcher, - Matcher, Matcher, Matcher > - type; +struct MatcherTuple< ::std::tuple > { + typedef ::std::tuple, Matcher, Matcher, Matcher, + Matcher, Matcher, Matcher > type; }; template -struct MatcherTuple< ::testing::tuple > { - typedef ::testing::tuple, Matcher, Matcher, Matcher, - Matcher, Matcher, Matcher, Matcher > - type; +struct MatcherTuple< ::std::tuple > { + typedef ::std::tuple, Matcher, Matcher, Matcher, + Matcher, Matcher, Matcher, Matcher > type; }; template -struct MatcherTuple< ::testing::tuple > { - typedef ::testing::tuple, Matcher, Matcher, Matcher, - Matcher, Matcher, Matcher, Matcher, - Matcher > - type; +struct MatcherTuple< ::std::tuple > { + typedef ::std::tuple, Matcher, Matcher, Matcher, + Matcher, Matcher, Matcher, Matcher, Matcher > type; }; template -struct MatcherTuple< ::testing::tuple > { - typedef ::testing::tuple, Matcher, Matcher, Matcher, - Matcher, Matcher, Matcher, Matcher, - Matcher, Matcher > - type; +struct MatcherTuple< ::std::tuple > { + typedef ::std::tuple, Matcher, Matcher, Matcher, + Matcher, Matcher, Matcher, Matcher, Matcher, + Matcher > type; }; // Template struct Function, where F must be a function type, contains @@ -164,7 +156,7 @@ struct Function; template struct Function { typedef R Result; - typedef ::testing::tuple<> ArgumentTuple; + typedef ::std::tuple<> ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(); typedef IgnoredValue MakeResultIgnoredValue(); @@ -174,7 +166,7 @@ template struct Function : Function { typedef A1 Argument1; - typedef ::testing::tuple ArgumentTuple; + typedef ::std::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1); typedef IgnoredValue MakeResultIgnoredValue(A1); @@ -184,7 +176,7 @@ template struct Function : Function { typedef A2 Argument2; - typedef ::testing::tuple ArgumentTuple; + typedef ::std::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2); typedef IgnoredValue MakeResultIgnoredValue(A1, A2); @@ -194,7 +186,7 @@ template struct Function : Function { typedef A3 Argument3; - typedef ::testing::tuple ArgumentTuple; + typedef ::std::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3); @@ -204,7 +196,7 @@ template struct Function : Function { typedef A4 Argument4; - typedef ::testing::tuple ArgumentTuple; + typedef ::std::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4); @@ -215,7 +207,7 @@ template : Function { typedef A5 Argument5; - typedef ::testing::tuple ArgumentTuple; + typedef ::std::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5); @@ -226,7 +218,7 @@ template : Function { typedef A6 Argument6; - typedef ::testing::tuple ArgumentTuple; + typedef ::std::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6); @@ -237,7 +229,7 @@ template : Function { typedef A7 Argument7; - typedef ::testing::tuple ArgumentTuple; + typedef ::std::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7); @@ -248,7 +240,7 @@ template : Function { typedef A8 Argument8; - typedef ::testing::tuple ArgumentTuple; + typedef ::std::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8); @@ -259,7 +251,7 @@ template : Function { typedef A9 Argument9; - typedef ::testing::tuple ArgumentTuple; + typedef ::std::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8, @@ -272,8 +264,7 @@ template : Function { typedef A10 Argument10; - typedef ::testing::tuple ArgumentTuple; + typedef ::std::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8, diff --git a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump index c1032798..9962f6b3 100644 --- a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +++ b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump @@ -78,8 +78,8 @@ $var typename_As = [[$for j, [[typename A$j]]]] $var As = [[$for j, [[A$j]]]] $var matcher_As = [[$for j, [[Matcher]]]] template <$typename_As> -struct MatcherTuple< ::testing::tuple<$As> > { - typedef ::testing::tuple<$matcher_As > type; +struct MatcherTuple< ::std::tuple<$As> > { + typedef ::std::tuple<$matcher_As > type; }; @@ -103,7 +103,7 @@ struct Function; template struct Function { typedef R Result; - typedef ::testing::tuple<> ArgumentTuple; + typedef ::std::tuple<> ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(); typedef IgnoredValue MakeResultIgnoredValue(); @@ -122,7 +122,7 @@ template struct Function : Function { typedef A$i Argument$i; - typedef ::testing::tuple<$As> ArgumentTuple; + typedef ::std::tuple<$As> ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid($As); typedef IgnoredValue MakeResultIgnoredValue($As); diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index db64c65c..fd33c004 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -493,7 +493,7 @@ class StlContainerView { // This specialization is used when RawContainer is a native array // represented as a (pointer, size) tuple. template -class StlContainerView< ::testing::tuple > { +class StlContainerView< ::std::tuple > { public: typedef GTEST_REMOVE_CONST_( typename internal::PointeeOf::type) RawElement; @@ -501,11 +501,12 @@ class StlContainerView< ::testing::tuple > { typedef const type const_reference; static const_reference ConstReference( - const ::testing::tuple& array) { - return type(get<0>(array), get<1>(array), RelationToSourceReference()); + const ::std::tuple& array) { + return type(std::get<0>(array), std::get<1>(array), + RelationToSourceReference()); } - static type Copy(const ::testing::tuple& array) { - return type(get<0>(array), get<1>(array), RelationToSourceCopy()); + static type Copy(const ::std::tuple& array) { + return type(std::get<0>(array), std::get<1>(array), RelationToSourceCopy()); } }; -- cgit v1.2.3