diff options
author | Abseil Team <absl-team@google.com> | 2020-02-03 12:09:02 -0500 |
---|---|---|
committer | Andy Getz <durandal@google.com> | 2020-02-07 13:35:10 -0500 |
commit | d02e2772750f39450eab16c3cf2ec9a609be8980 (patch) | |
tree | b0e0cbef7a3670f6b8b399af500d399b7ea24ecf /googlemock | |
parent | 4f6609129a2ffe83308406655f770352cbbfd6b6 (diff) | |
download | googletest-d02e2772750f39450eab16c3cf2ec9a609be8980.tar.gz googletest-d02e2772750f39450eab16c3cf2ec9a609be8980.tar.bz2 googletest-d02e2772750f39450eab16c3cf2ec9a609be8980.zip |
Googletest export
Pass method's parameters count to internal GMOCK_METHOD* macro.
This will help removing copypaste in every GMOCK_METHOD* macro in future.
PiperOrigin-RevId: 292932554
Diffstat (limited to 'googlemock')
3 files changed, 421 insertions, 471 deletions
diff --git a/googlemock/include/gmock/gmock-function-mocker.h b/googlemock/include/gmock/gmock-function-mocker.h index 77a66330..1af0d935 100644 --- a/googlemock/include/gmock/gmock-function-mocker.h +++ b/googlemock/include/gmock/gmock-function-mocker.h @@ -244,21 +244,19 @@ using identity_t = T; GMOCK_PP_IDENTITY) \ (_elem) -#define GMOCK_INTERNAL_PARAMETER(_i, _Signature, _) \ - GMOCK_PP_COMMA_IF(_i) \ - GMOCK_INTERNAL_ARG_O(typename, GMOCK_PP_INC(_i), \ - GMOCK_PP_REMOVE_PARENS(_Signature)) \ +#define GMOCK_INTERNAL_PARAMETER(_i, _Signature, _) \ + GMOCK_PP_COMMA_IF(_i) \ + GMOCK_INTERNAL_ARG_O(GMOCK_PP_INC(_i), GMOCK_PP_REMOVE_PARENS(_Signature)) \ gmock_a##_i -#define GMOCK_INTERNAL_FORWARD_ARG(_i, _Signature, _) \ - GMOCK_PP_COMMA_IF(_i) \ - ::std::forward<GMOCK_INTERNAL_ARG_O(typename, GMOCK_PP_INC(_i), \ - GMOCK_PP_REMOVE_PARENS(_Signature))>( \ - gmock_a##_i) +#define GMOCK_INTERNAL_FORWARD_ARG(_i, _Signature, _) \ + GMOCK_PP_COMMA_IF(_i) \ + ::std::forward<GMOCK_INTERNAL_ARG_O( \ + GMOCK_PP_INC(_i), GMOCK_PP_REMOVE_PARENS(_Signature))>(gmock_a##_i) #define GMOCK_INTERNAL_MATCHER_PARAMETER(_i, _Signature, _) \ GMOCK_PP_COMMA_IF(_i) \ - GMOCK_INTERNAL_MATCHER_O(typename, GMOCK_PP_INC(_i), \ + GMOCK_INTERNAL_MATCHER_O(GMOCK_PP_INC(_i), \ GMOCK_PP_REMOVE_PARENS(_Signature)) \ gmock_a##_i @@ -266,14 +264,168 @@ using identity_t = T; GMOCK_PP_COMMA_IF(_i) \ gmock_a##_i -#define GMOCK_INTERNAL_A_MATCHER_ARGUMENT(_i, _Signature, _) \ - GMOCK_PP_COMMA_IF(_i) \ - ::testing::A<GMOCK_INTERNAL_ARG_O(typename, GMOCK_PP_INC(_i), \ +#define GMOCK_INTERNAL_A_MATCHER_ARGUMENT(_i, _Signature, _) \ + GMOCK_PP_COMMA_IF(_i) \ + ::testing::A<GMOCK_INTERNAL_ARG_O(GMOCK_PP_INC(_i), \ GMOCK_PP_REMOVE_PARENS(_Signature))>() -#define GMOCK_INTERNAL_ARG_O(_tn, _i, ...) GMOCK_ARG_(_tn, _i, __VA_ARGS__) - -#define GMOCK_INTERNAL_MATCHER_O(_tn, _i, ...) \ - GMOCK_MATCHER_(_tn, _i, __VA_ARGS__) +#define GMOCK_INTERNAL_ARG_O(_i, ...) GMOCK_ARG_(_i, __VA_ARGS__) + +#define GMOCK_INTERNAL_MATCHER_O(_i, ...) GMOCK_MATCHER_(_i, __VA_ARGS__) + +#define MOCK_METHOD0(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 0, __VA_ARGS__) +#define MOCK_METHOD1(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 1, __VA_ARGS__) +#define MOCK_METHOD2(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 2, __VA_ARGS__) +#define MOCK_METHOD3(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 3, __VA_ARGS__) +#define MOCK_METHOD4(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 4, __VA_ARGS__) +#define MOCK_METHOD5(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 5, __VA_ARGS__) +#define MOCK_METHOD6(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 6, __VA_ARGS__) +#define MOCK_METHOD7(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 7, __VA_ARGS__) +#define MOCK_METHOD8(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 8, __VA_ARGS__) +#define MOCK_METHOD9(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 9, __VA_ARGS__) +#define MOCK_METHOD10(m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(, , m, 10, __VA_ARGS__) + +#define MOCK_CONST_METHOD0(m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, , m, 0, __VA_ARGS__) +#define MOCK_CONST_METHOD1(m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, , m, 1, __VA_ARGS__) +#define MOCK_CONST_METHOD2(m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, , m, 2, __VA_ARGS__) +#define MOCK_CONST_METHOD3(m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, , m, 3, __VA_ARGS__) +#define MOCK_CONST_METHOD4(m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, , m, 4, __VA_ARGS__) +#define MOCK_CONST_METHOD5(m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, , m, 5, __VA_ARGS__) +#define MOCK_CONST_METHOD6(m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, , m, 6, __VA_ARGS__) +#define MOCK_CONST_METHOD7(m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, , m, 7, __VA_ARGS__) +#define MOCK_CONST_METHOD8(m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, , m, 8, __VA_ARGS__) +#define MOCK_CONST_METHOD9(m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, , m, 9, __VA_ARGS__) +#define MOCK_CONST_METHOD10(m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, , m, 10, __VA_ARGS__) + +#define MOCK_METHOD0_T(m, ...) MOCK_METHOD0(m, __VA_ARGS__) +#define MOCK_METHOD1_T(m, ...) MOCK_METHOD1(m, __VA_ARGS__) +#define MOCK_METHOD2_T(m, ...) MOCK_METHOD2(m, __VA_ARGS__) +#define MOCK_METHOD3_T(m, ...) MOCK_METHOD3(m, __VA_ARGS__) +#define MOCK_METHOD4_T(m, ...) MOCK_METHOD4(m, __VA_ARGS__) +#define MOCK_METHOD5_T(m, ...) MOCK_METHOD5(m, __VA_ARGS__) +#define MOCK_METHOD6_T(m, ...) MOCK_METHOD6(m, __VA_ARGS__) +#define MOCK_METHOD7_T(m, ...) MOCK_METHOD7(m, __VA_ARGS__) +#define MOCK_METHOD8_T(m, ...) MOCK_METHOD8(m, __VA_ARGS__) +#define MOCK_METHOD9_T(m, ...) MOCK_METHOD9(m, __VA_ARGS__) +#define MOCK_METHOD10_T(m, ...) MOCK_METHOD10(m, __VA_ARGS__) + +#define MOCK_CONST_METHOD0_T(m, ...) MOCK_CONST_METHOD0(m, __VA_ARGS__) +#define MOCK_CONST_METHOD1_T(m, ...) MOCK_CONST_METHOD1(m, __VA_ARGS__) +#define MOCK_CONST_METHOD2_T(m, ...) MOCK_CONST_METHOD2(m, __VA_ARGS__) +#define MOCK_CONST_METHOD3_T(m, ...) MOCK_CONST_METHOD3(m, __VA_ARGS__) +#define MOCK_CONST_METHOD4_T(m, ...) MOCK_CONST_METHOD4(m, __VA_ARGS__) +#define MOCK_CONST_METHOD5_T(m, ...) MOCK_CONST_METHOD5(m, __VA_ARGS__) +#define MOCK_CONST_METHOD6_T(m, ...) MOCK_CONST_METHOD6(m, __VA_ARGS__) +#define MOCK_CONST_METHOD7_T(m, ...) MOCK_CONST_METHOD7(m, __VA_ARGS__) +#define MOCK_CONST_METHOD8_T(m, ...) MOCK_CONST_METHOD8(m, __VA_ARGS__) +#define MOCK_CONST_METHOD9_T(m, ...) MOCK_CONST_METHOD9(m, __VA_ARGS__) +#define MOCK_CONST_METHOD10_T(m, ...) MOCK_CONST_METHOD10(m, __VA_ARGS__) + +#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 0, __VA_ARGS__) +#define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 1, __VA_ARGS__) +#define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 2, __VA_ARGS__) +#define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 3, __VA_ARGS__) +#define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 4, __VA_ARGS__) +#define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 5, __VA_ARGS__) +#define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 6, __VA_ARGS__) +#define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 7, __VA_ARGS__) +#define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 8, __VA_ARGS__) +#define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 9, __VA_ARGS__) +#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 10, __VA_ARGS__) + +#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 0, __VA_ARGS__) +#define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 1, __VA_ARGS__) +#define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 2, __VA_ARGS__) +#define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 3, __VA_ARGS__) +#define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 4, __VA_ARGS__) +#define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 5, __VA_ARGS__) +#define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 6, __VA_ARGS__) +#define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 7, __VA_ARGS__) +#define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 8, __VA_ARGS__) +#define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 9, __VA_ARGS__) +#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \ + GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 10, __VA_ARGS__) + +#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_METHOD0_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_METHOD1_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_METHOD2_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_METHOD3_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_METHOD4_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_METHOD5_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_METHOD6_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_METHOD7_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_METHOD8_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_METHOD9_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_METHOD10_WITH_CALLTYPE(ct, m, __VA_ARGS__) + +#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, __VA_ARGS__) +#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \ + MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, __VA_ARGS__) + +#define GMOCK_INTERNAL_MOCK_METHODN(constness, ct, Method, args_num, ...) \ + GMOCK_METHOD##args_num##_(constness, ct, Method, __VA_ARGS__) #endif // THIRD_PARTY_GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_ diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h b/googlemock/include/gmock/gmock-generated-function-mockers.h index cd957817..e0bd6cd7 100644 --- a/googlemock/include/gmock/gmock-generated-function-mockers.h +++ b/googlemock/include/gmock/gmock-generated-function-mockers.h @@ -115,18 +115,18 @@ using internal::FunctionMocker; // commas (the same reason that we use variadic macros in other places // in this file). // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_RESULT_(tn, ...) \ - tn ::testing::internal::Function<__VA_ARGS__>::Result +#define GMOCK_RESULT_(...) \ + typename ::testing::internal::Function<__VA_ARGS__>::Result // The type of argument N of the given function type. // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_ARG_(tn, N, ...) \ - tn ::testing::internal::Function<__VA_ARGS__>::template Arg<N-1>::type +#define GMOCK_ARG_(N, ...) \ + typename ::testing::internal::Function<__VA_ARGS__>::template Arg<N-1>::type // The matcher type for argument N of the given function type. // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_MATCHER_(tn, N, ...) \ - const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>& +#define GMOCK_MATCHER_(N, ...) \ + const ::testing::Matcher<GMOCK_ARG_(N, __VA_ARGS__)>& // The variable for mocking the given method. // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! @@ -134,11 +134,11 @@ 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, ...) \ +#define GMOCK_METHOD0_(constness, ct, Method, ...) \ static_assert(0 == \ ::testing::internal::Function<__VA_ARGS__>::ArgumentCount, \ "MOCK_METHOD<N> must match argument count.");\ - GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_RESULT_(__VA_ARGS__) ct Method( \ ) constness { \ GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(0, constness, Method).Invoke(); \ @@ -158,19 +158,19 @@ using internal::FunctionMocker; Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \ +#define GMOCK_METHOD1_(constness, ct, Method, ...) \ static_assert(1 == \ ::testing::internal::Function<__VA_ARGS__>::ArgumentCount, \ "MOCK_METHOD<N> must match argument count.");\ - GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ - GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ + GMOCK_RESULT_(__VA_ARGS__) ct Method( \ + GMOCK_ARG_(1, __VA_ARGS__) gmock_a1) constness { \ GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(1, constness, \ - Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ - __VA_ARGS__)>(gmock_a1)); \ + Method).Invoke(::std::forward<GMOCK_ARG_(1, __VA_ARGS__)>(gmock_a1)); \ + \ } \ ::testing::MockSpec<__VA_ARGS__> \ - gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ + gmock_##Method(GMOCK_MATCHER_(1, __VA_ARGS__) gmock_a1) constness { \ GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \ return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \ } \ @@ -178,28 +178,28 @@ using internal::FunctionMocker; const ::testing::internal::WithoutMatchers&, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ return ::testing::internal::AdjustConstness_##constness(this)-> \ - gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>()); \ + gmock_##Method(::testing::A<GMOCK_ARG_(1, __VA_ARGS__)>()); \ } \ 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, ...) \ +#define GMOCK_METHOD2_(constness, ct, Method, ...) \ static_assert(2 == \ ::testing::internal::Function<__VA_ARGS__>::ArgumentCount, \ "MOCK_METHOD<N> must match argument count.");\ - GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ - GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + GMOCK_RESULT_(__VA_ARGS__) ct Method( \ + GMOCK_ARG_(1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(2, \ __VA_ARGS__) gmock_a2) constness { \ GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(2, constness, \ - Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ - __VA_ARGS__)>(gmock_a1), \ - ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2)); \ + Method).Invoke(::std::forward<GMOCK_ARG_(1, __VA_ARGS__)>(gmock_a1), \ + \ + ::std::forward<GMOCK_ARG_(2, __VA_ARGS__)>(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_##Method(GMOCK_MATCHER_(1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(2, __VA_ARGS__) gmock_a2) constness { \ GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \ return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \ } \ @@ -207,32 +207,32 @@ using internal::FunctionMocker; const ::testing::internal::WithoutMatchers&, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ return ::testing::internal::AdjustConstness_##constness(this)-> \ - gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>()); \ + gmock_##Method(::testing::A<GMOCK_ARG_(1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(2, __VA_ARGS__)>()); \ } \ 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, ...) \ +#define GMOCK_METHOD3_(constness, ct, Method, ...) \ static_assert(3 == \ ::testing::internal::Function<__VA_ARGS__>::ArgumentCount, \ "MOCK_METHOD<N> must match argument count.");\ - 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, \ + GMOCK_RESULT_(__VA_ARGS__) ct Method( \ + GMOCK_ARG_(1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(3, \ __VA_ARGS__) gmock_a3) constness { \ GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(3, constness, \ - Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ - __VA_ARGS__)>(gmock_a1), \ - ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ - ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3)); \ + Method).Invoke(::std::forward<GMOCK_ARG_(1, __VA_ARGS__)>(gmock_a1), \ + \ + ::std::forward<GMOCK_ARG_(2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(3, __VA_ARGS__)>(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_##Method(GMOCK_MATCHER_(1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(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); \ @@ -241,35 +241,35 @@ using internal::FunctionMocker; const ::testing::internal::WithoutMatchers&, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ return ::testing::internal::AdjustConstness_##constness(this)-> \ - gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>()); \ + gmock_##Method(::testing::A<GMOCK_ARG_(1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(3, __VA_ARGS__)>()); \ } \ 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, ...) \ +#define GMOCK_METHOD4_(constness, ct, Method, ...) \ static_assert(4 == \ ::testing::internal::Function<__VA_ARGS__>::ArgumentCount, \ "MOCK_METHOD<N> must match argument count.");\ - 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 { \ + GMOCK_RESULT_(__VA_ARGS__) ct Method( \ + GMOCK_ARG_(1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(4, __VA_ARGS__) gmock_a4) constness { \ GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(4, constness, \ - Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ - __VA_ARGS__)>(gmock_a1), \ - ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ - ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ - ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4)); \ + Method).Invoke(::std::forward<GMOCK_ARG_(1, __VA_ARGS__)>(gmock_a1), \ + \ + ::std::forward<GMOCK_ARG_(2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(4, __VA_ARGS__)>(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_##Method(GMOCK_MATCHER_(1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(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); \ @@ -278,39 +278,39 @@ using internal::FunctionMocker; const ::testing::internal::WithoutMatchers&, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ return ::testing::internal::AdjustConstness_##constness(this)-> \ - gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>()); \ + gmock_##Method(::testing::A<GMOCK_ARG_(1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(4, __VA_ARGS__)>()); \ } \ 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, ...) \ +#define GMOCK_METHOD5_(constness, ct, Method, ...) \ static_assert(5 == \ ::testing::internal::Function<__VA_ARGS__>::ArgumentCount, \ "MOCK_METHOD<N> must match argument count.");\ - 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, \ + GMOCK_RESULT_(__VA_ARGS__) ct Method( \ + GMOCK_ARG_(1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(5, \ __VA_ARGS__) gmock_a5) constness { \ GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(5, constness, \ - Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ - __VA_ARGS__)>(gmock_a1), \ - ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ - ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ - ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \ - ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5)); \ + Method).Invoke(::std::forward<GMOCK_ARG_(1, __VA_ARGS__)>(gmock_a1), \ + \ + ::std::forward<GMOCK_ARG_(2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(4, __VA_ARGS__)>(gmock_a4), \ + ::std::forward<GMOCK_ARG_(5, __VA_ARGS__)>(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_##Method(GMOCK_MATCHER_(1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(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); \ @@ -319,43 +319,43 @@ using internal::FunctionMocker; const ::testing::internal::WithoutMatchers&, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ return ::testing::internal::AdjustConstness_##constness(this)-> \ - gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>()); \ + gmock_##Method(::testing::A<GMOCK_ARG_(1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(4, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(5, __VA_ARGS__)>()); \ } \ 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, ...) \ +#define GMOCK_METHOD6_(constness, ct, Method, ...) \ static_assert(6 == \ ::testing::internal::Function<__VA_ARGS__>::ArgumentCount, \ "MOCK_METHOD<N> must match argument count.");\ - 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, \ + GMOCK_RESULT_(__VA_ARGS__) ct Method( \ + GMOCK_ARG_(1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(5, \ + __VA_ARGS__) gmock_a5, GMOCK_ARG_(6, \ __VA_ARGS__) gmock_a6) constness { \ GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(6, constness, \ - Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ - __VA_ARGS__)>(gmock_a1), \ - ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ - ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ - ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \ - ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \ - ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6)); \ + Method).Invoke(::std::forward<GMOCK_ARG_(1, __VA_ARGS__)>(gmock_a1), \ + \ + ::std::forward<GMOCK_ARG_(2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(4, __VA_ARGS__)>(gmock_a4), \ + ::std::forward<GMOCK_ARG_(5, __VA_ARGS__)>(gmock_a5), \ + ::std::forward<GMOCK_ARG_(6, __VA_ARGS__)>(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_##Method(GMOCK_MATCHER_(1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(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); \ @@ -364,46 +364,46 @@ using internal::FunctionMocker; const ::testing::internal::WithoutMatchers&, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ return ::testing::internal::AdjustConstness_##constness(this)-> \ - gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>()); \ + gmock_##Method(::testing::A<GMOCK_ARG_(1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(4, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(5, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(6, __VA_ARGS__)>()); \ } \ 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, ...) \ +#define GMOCK_METHOD7_(constness, ct, Method, ...) \ static_assert(7 == \ ::testing::internal::Function<__VA_ARGS__>::ArgumentCount, \ "MOCK_METHOD<N> must match argument count.");\ - 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 { \ + GMOCK_RESULT_(__VA_ARGS__) ct Method( \ + GMOCK_ARG_(1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(5, \ + __VA_ARGS__) gmock_a5, GMOCK_ARG_(6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(7, __VA_ARGS__) gmock_a7) constness { \ GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(7, constness, \ - Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ - __VA_ARGS__)>(gmock_a1), \ - ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ - ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ - ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \ - ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \ - ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \ - ::std::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7)); \ + Method).Invoke(::std::forward<GMOCK_ARG_(1, __VA_ARGS__)>(gmock_a1), \ + \ + ::std::forward<GMOCK_ARG_(2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(4, __VA_ARGS__)>(gmock_a4), \ + ::std::forward<GMOCK_ARG_(5, __VA_ARGS__)>(gmock_a5), \ + ::std::forward<GMOCK_ARG_(6, __VA_ARGS__)>(gmock_a6), \ + ::std::forward<GMOCK_ARG_(7, __VA_ARGS__)>(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_##Method(GMOCK_MATCHER_(1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(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); \ @@ -412,50 +412,50 @@ using internal::FunctionMocker; const ::testing::internal::WithoutMatchers&, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ return ::testing::internal::AdjustConstness_##constness(this)-> \ - gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>()); \ + gmock_##Method(::testing::A<GMOCK_ARG_(1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(4, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(5, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(6, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(7, __VA_ARGS__)>()); \ } \ 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, ...) \ +#define GMOCK_METHOD8_(constness, ct, Method, ...) \ static_assert(8 == \ ::testing::internal::Function<__VA_ARGS__>::ArgumentCount, \ "MOCK_METHOD<N> must match argument count.");\ - 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, \ + GMOCK_RESULT_(__VA_ARGS__) ct Method( \ + GMOCK_ARG_(1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(5, \ + __VA_ARGS__) gmock_a5, GMOCK_ARG_(6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(7, __VA_ARGS__) gmock_a7, GMOCK_ARG_(8, \ __VA_ARGS__) gmock_a8) constness { \ GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(8, constness, \ - Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ - __VA_ARGS__)>(gmock_a1), \ - ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ - ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ - ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \ - ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \ - ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \ - ::std::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7), \ - ::std::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(gmock_a8)); \ + Method).Invoke(::std::forward<GMOCK_ARG_(1, __VA_ARGS__)>(gmock_a1), \ + \ + ::std::forward<GMOCK_ARG_(2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(4, __VA_ARGS__)>(gmock_a4), \ + ::std::forward<GMOCK_ARG_(5, __VA_ARGS__)>(gmock_a5), \ + ::std::forward<GMOCK_ARG_(6, __VA_ARGS__)>(gmock_a6), \ + ::std::forward<GMOCK_ARG_(7, __VA_ARGS__)>(gmock_a7), \ + ::std::forward<GMOCK_ARG_(8, __VA_ARGS__)>(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_##Method(GMOCK_MATCHER_(1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(7, __VA_ARGS__) gmock_a7, \ + GMOCK_MATCHER_(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); \ @@ -464,54 +464,54 @@ using internal::FunctionMocker; const ::testing::internal::WithoutMatchers&, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ return ::testing::internal::AdjustConstness_##constness(this)-> \ - gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>()); \ + gmock_##Method(::testing::A<GMOCK_ARG_(1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(4, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(5, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(6, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(7, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(8, __VA_ARGS__)>()); \ } \ 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, ...) \ +#define GMOCK_METHOD9_(constness, ct, Method, ...) \ static_assert(9 == \ ::testing::internal::Function<__VA_ARGS__>::ArgumentCount, \ "MOCK_METHOD<N> must match argument count.");\ - 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, \ + GMOCK_RESULT_(__VA_ARGS__) ct Method( \ + GMOCK_ARG_(1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(5, \ + __VA_ARGS__) gmock_a5, GMOCK_ARG_(6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(7, __VA_ARGS__) gmock_a7, GMOCK_ARG_(8, \ + __VA_ARGS__) gmock_a8, GMOCK_ARG_(9, \ __VA_ARGS__) gmock_a9) constness { \ GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(9, constness, \ - Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ - __VA_ARGS__)>(gmock_a1), \ - ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ - ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ - ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \ - ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \ - ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \ - ::std::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7), \ - ::std::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(gmock_a8), \ - ::std::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(gmock_a9)); \ + Method).Invoke(::std::forward<GMOCK_ARG_(1, __VA_ARGS__)>(gmock_a1), \ + \ + ::std::forward<GMOCK_ARG_(2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(4, __VA_ARGS__)>(gmock_a4), \ + ::std::forward<GMOCK_ARG_(5, __VA_ARGS__)>(gmock_a5), \ + ::std::forward<GMOCK_ARG_(6, __VA_ARGS__)>(gmock_a6), \ + ::std::forward<GMOCK_ARG_(7, __VA_ARGS__)>(gmock_a7), \ + ::std::forward<GMOCK_ARG_(8, __VA_ARGS__)>(gmock_a8), \ + ::std::forward<GMOCK_ARG_(9, __VA_ARGS__)>(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_##Method(GMOCK_MATCHER_(1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(7, __VA_ARGS__) gmock_a7, \ + GMOCK_MATCHER_(8, __VA_ARGS__) gmock_a8, \ + GMOCK_MATCHER_(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, \ @@ -521,58 +521,57 @@ using internal::FunctionMocker; const ::testing::internal::WithoutMatchers&, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ return ::testing::internal::AdjustConstness_##constness(this)-> \ - gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>()); \ + gmock_##Method(::testing::A<GMOCK_ARG_(1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(4, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(5, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(6, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(7, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(8, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(9, __VA_ARGS__)>()); \ } \ 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, ...) \ +#define GMOCK_METHOD10_(constness, ct, Method, ...) \ static_assert(10 == \ ::testing::internal::Function<__VA_ARGS__>::ArgumentCount, \ "MOCK_METHOD<N> must match argument count.");\ - 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 { \ + GMOCK_RESULT_(__VA_ARGS__) ct Method( \ + GMOCK_ARG_(1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(5, \ + __VA_ARGS__) gmock_a5, GMOCK_ARG_(6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(7, __VA_ARGS__) gmock_a7, GMOCK_ARG_(8, \ + __VA_ARGS__) gmock_a8, GMOCK_ARG_(9, __VA_ARGS__) gmock_a9, \ + GMOCK_ARG_(10, __VA_ARGS__) gmock_a10) constness { \ GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(10, constness, \ - Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ - __VA_ARGS__)>(gmock_a1), \ - ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ - ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ - ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \ - ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \ - ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \ - ::std::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7), \ - ::std::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(gmock_a8), \ - ::std::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(gmock_a9), \ - ::std::forward<GMOCK_ARG_(tn, 10, __VA_ARGS__)>(gmock_a10)); \ + Method).Invoke(::std::forward<GMOCK_ARG_(1, __VA_ARGS__)>(gmock_a1), \ + \ + ::std::forward<GMOCK_ARG_(2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(4, __VA_ARGS__)>(gmock_a4), \ + ::std::forward<GMOCK_ARG_(5, __VA_ARGS__)>(gmock_a5), \ + ::std::forward<GMOCK_ARG_(6, __VA_ARGS__)>(gmock_a6), \ + ::std::forward<GMOCK_ARG_(7, __VA_ARGS__)>(gmock_a7), \ + ::std::forward<GMOCK_ARG_(8, __VA_ARGS__)>(gmock_a8), \ + ::std::forward<GMOCK_ARG_(9, __VA_ARGS__)>(gmock_a9), \ + ::std::forward<GMOCK_ARG_(10, __VA_ARGS__)>(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_##Method(GMOCK_MATCHER_(1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(7, __VA_ARGS__) gmock_a7, \ + GMOCK_MATCHER_(8, __VA_ARGS__) gmock_a8, \ + GMOCK_MATCHER_(9, __VA_ARGS__) gmock_a9, \ + GMOCK_MATCHER_(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, \ @@ -582,170 +581,20 @@ using internal::FunctionMocker; const ::testing::internal::WithoutMatchers&, \ constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ return ::testing::internal::AdjustConstness_##constness(this)-> \ - gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 10, __VA_ARGS__)>()); \ + gmock_##Method(::testing::A<GMOCK_ARG_(1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(4, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(5, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(6, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(7, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(8, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(9, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(10, __VA_ARGS__)>()); \ } \ 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__) -#define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__) -#define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__) -#define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__) -#define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__) -#define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__) -#define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__) -#define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__) -#define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__) -#define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__) - -#define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__) - -#define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__) -#define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__) -#define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__) -#define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__) -#define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__) -#define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__) -#define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__) -#define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__) -#define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__) -#define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__) -#define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__) - -#define MOCK_CONST_METHOD0_T(m, ...) \ - GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD1_T(m, ...) \ - GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD2_T(m, ...) \ - GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD3_T(m, ...) \ - GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD4_T(m, ...) \ - GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD5_T(m, ...) \ - GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD6_T(m, ...) \ - GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD7_T(m, ...) \ - GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD8_T(m, ...) \ - GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD9_T(m, ...) \ - GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__) -#define MOCK_CONST_METHOD10_T(m, ...) \ - GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__) - -#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD0_(, , ct, m, __VA_ARGS__) -#define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD1_(, , ct, m, __VA_ARGS__) -#define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD2_(, , ct, m, __VA_ARGS__) -#define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD3_(, , ct, m, __VA_ARGS__) -#define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD4_(, , ct, m, __VA_ARGS__) -#define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD5_(, , ct, m, __VA_ARGS__) -#define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD6_(, , ct, m, __VA_ARGS__) -#define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD7_(, , ct, m, __VA_ARGS__) -#define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD8_(, , ct, m, __VA_ARGS__) -#define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD9_(, , ct, m, __VA_ARGS__) -#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD10_(, , ct, m, __VA_ARGS__) - -#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__) - -#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__) -#define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__) -#define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__) -#define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__) -#define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__) -#define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__) -#define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__) -#define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__) -#define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__) -#define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__) -#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__) - -#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__) -#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__) } // namespace testing diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump index a56e132f..d240a89f 100644 --- a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +++ b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump @@ -118,18 +118,18 @@ using internal::FunctionMocker; // commas (the same reason that we use variadic macros in other places // in this file). // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_RESULT_(tn, ...) \ - tn ::testing::internal::Function<__VA_ARGS__>::Result +#define GMOCK_RESULT_(...) \ + typename ::testing::internal::Function<__VA_ARGS__>::Result // The type of argument N of the given function type. // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_ARG_(tn, N, ...) \ - tn ::testing::internal::Function<__VA_ARGS__>::template Arg<N-1>::type +#define GMOCK_ARG_(N, ...) \ + typename ::testing::internal::Function<__VA_ARGS__>::template Arg<N-1>::type // The matcher type for argument N of the given function type. // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_MATCHER_(tn, N, ...) \ - const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>& +#define GMOCK_MATCHER_(N, ...) \ + const ::testing::Matcher<GMOCK_ARG_(N, __VA_ARGS__)>& // The variable for mocking the given method. // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! @@ -139,18 +139,18 @@ using internal::FunctionMocker; $for i [[ $range j 1..i -$var arg_as = [[$for j, [[GMOCK_ARG_(tn, $j, __VA_ARGS__) gmock_a$j]]]] +$var arg_as = [[$for j, [[GMOCK_ARG_($j, __VA_ARGS__) gmock_a$j]]]] $var as = [[$for j, \ - [[::std::forward<GMOCK_ARG_(tn, $j, __VA_ARGS__)>(gmock_a$j)]]]] + [[::std::forward<GMOCK_ARG_($j, __VA_ARGS__)>(gmock_a$j)]]]] $var matcher_arg_as = [[$for j, \ - [[GMOCK_MATCHER_(tn, $j, __VA_ARGS__) gmock_a$j]]]] + [[GMOCK_MATCHER_($j, __VA_ARGS__) gmock_a$j]]]] $var matcher_as = [[$for j, [[gmock_a$j]]]] $var anything_matchers = [[$for j, \ - [[::testing::A<GMOCK_ARG_(tn, $j, __VA_ARGS__)>()]]]] + [[::testing::A<GMOCK_ARG_($j, __VA_ARGS__)>()]]]] // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \ +#define GMOCK_METHOD$i[[]]_(constness, ct, Method, ...) \ static_assert($i == ::testing::internal::Function<__VA_ARGS__>::ArgumentCount, "MOCK_METHOD<N> must match argument count.");\ - GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_RESULT_(__VA_ARGS__) ct Method( \ $arg_as) constness { \ GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_($i, constness, Method).Invoke($as); \ @@ -170,57 +170,6 @@ $var anything_matchers = [[$for j, \ ]] -$for i [[ -#define MOCK_METHOD$i(m, ...) GMOCK_METHOD$i[[]]_(, , , m, __VA_ARGS__) - -]] - - -$for i [[ -#define MOCK_CONST_METHOD$i(m, ...) GMOCK_METHOD$i[[]]_(, const, , m, __VA_ARGS__) - -]] - - -$for i [[ -#define MOCK_METHOD$i[[]]_T(m, ...) GMOCK_METHOD$i[[]]_(typename, , , m, __VA_ARGS__) - -]] - - -$for i [[ -#define MOCK_CONST_METHOD$i[[]]_T(m, ...) \ - GMOCK_METHOD$i[[]]_(typename, const, , m, __VA_ARGS__) - -]] - - -$for i [[ -#define MOCK_METHOD$i[[]]_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD$i[[]]_(, , ct, m, __VA_ARGS__) - -]] - - -$for i [[ -#define MOCK_CONST_METHOD$i[[]]_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD$i[[]]_(, const, ct, m, __VA_ARGS__) - -]] - - -$for i [[ -#define MOCK_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD$i[[]]_(typename, , ct, m, __VA_ARGS__) - -]] - - -$for i [[ -#define MOCK_CONST_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, ...) \ - GMOCK_METHOD$i[[]]_(typename, const, ct, m, __VA_ARGS__) - -]] } // namespace testing |