Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-07 08:19:50

0001 // This file was GENERATED by command:
0002 //     pump.py gmock-generated-function-mockers.h.pump
0003 // DO NOT EDIT BY HAND!!!
0004 
0005 // Copyright 2007, Google Inc.
0006 // All rights reserved.
0007 //
0008 // Redistribution and use in source and binary forms, with or without
0009 // modification, are permitted provided that the following conditions are
0010 // met:
0011 //
0012 //     * Redistributions of source code must retain the above copyright
0013 // notice, this list of conditions and the following disclaimer.
0014 //     * Redistributions in binary form must reproduce the above
0015 // copyright notice, this list of conditions and the following disclaimer
0016 // in the documentation and/or other materials provided with the
0017 // distribution.
0018 //     * Neither the name of Google Inc. nor the names of its
0019 // contributors may be used to endorse or promote products derived from
0020 // this software without specific prior written permission.
0021 //
0022 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0023 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0024 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0025 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0026 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0027 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0028 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0029 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0030 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0031 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0032 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0033 //
0034 // Author: wan@google.com (Zhanyong Wan)
0035 
0036 // Google Mock - a framework for writing C++ mock classes.
0037 //
0038 // This file implements function mockers of various arities.
0039 
0040 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
0041 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
0042 
0043 #include "gmock/gmock-spec-builders.h"
0044 #include "gmock/internal/gmock-internal-utils.h"
0045 
0046 #if GTEST_HAS_STD_FUNCTION_
0047 # include <functional>
0048 #endif
0049 
0050 namespace testing {
0051 namespace internal {
0052 
0053 template <typename F>
0054 class FunctionMockerBase;
0055 
0056 // Note: class FunctionMocker really belongs to the ::testing
0057 // namespace.  However if we define it in ::testing, MSVC will
0058 // complain when classes in ::testing::internal declare it as a
0059 // friend class template.  To workaround this compiler bug, we define
0060 // FunctionMocker in ::testing::internal and import it into ::testing.
0061 template <typename F>
0062 class FunctionMocker;
0063 
0064 template <typename R>
0065 class FunctionMocker<R()> : public
0066     internal::FunctionMockerBase<R()> {
0067  public:
0068   typedef R F();
0069   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
0070 
0071   MockSpec<F>& With() {
0072     return this->current_spec();
0073   }
0074 
0075   R Invoke() {
0076     // Even though gcc and MSVC don't enforce it, 'this->' is required
0077     // by the C++ standard [14.6.4] here, as the base class type is
0078     // dependent on the template argument (and thus shouldn't be
0079     // looked into when resolving InvokeWith).
0080     return this->InvokeWith(ArgumentTuple());
0081   }
0082 };
0083 
0084 template <typename R, typename A1>
0085 class FunctionMocker<R(A1)> : public
0086     internal::FunctionMockerBase<R(A1)> {
0087  public:
0088   typedef R F(A1);
0089   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
0090 
0091   MockSpec<F>& With(const Matcher<A1>& m1) {
0092     this->current_spec().SetMatchers(::testing::make_tuple(m1));
0093     return this->current_spec();
0094   }
0095 
0096   R Invoke(A1 a1) {
0097     // Even though gcc and MSVC don't enforce it, 'this->' is required
0098     // by the C++ standard [14.6.4] here, as the base class type is
0099     // dependent on the template argument (and thus shouldn't be
0100     // looked into when resolving InvokeWith).
0101     return this->InvokeWith(ArgumentTuple(a1));
0102   }
0103 };
0104 
0105 template <typename R, typename A1, typename A2>
0106 class FunctionMocker<R(A1, A2)> : public
0107     internal::FunctionMockerBase<R(A1, A2)> {
0108  public:
0109   typedef R F(A1, A2);
0110   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
0111 
0112   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2) {
0113     this->current_spec().SetMatchers(::testing::make_tuple(m1, m2));
0114     return this->current_spec();
0115   }
0116 
0117   R Invoke(A1 a1, A2 a2) {
0118     // Even though gcc and MSVC don't enforce it, 'this->' is required
0119     // by the C++ standard [14.6.4] here, as the base class type is
0120     // dependent on the template argument (and thus shouldn't be
0121     // looked into when resolving InvokeWith).
0122     return this->InvokeWith(ArgumentTuple(a1, a2));
0123   }
0124 };
0125 
0126 template <typename R, typename A1, typename A2, typename A3>
0127 class FunctionMocker<R(A1, A2, A3)> : public
0128     internal::FunctionMockerBase<R(A1, A2, A3)> {
0129  public:
0130   typedef R F(A1, A2, A3);
0131   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
0132 
0133   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
0134       const Matcher<A3>& m3) {
0135     this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3));
0136     return this->current_spec();
0137   }
0138 
0139   R Invoke(A1 a1, A2 a2, A3 a3) {
0140     // Even though gcc and MSVC don't enforce it, 'this->' is required
0141     // by the C++ standard [14.6.4] here, as the base class type is
0142     // dependent on the template argument (and thus shouldn't be
0143     // looked into when resolving InvokeWith).
0144     return this->InvokeWith(ArgumentTuple(a1, a2, a3));
0145   }
0146 };
0147 
0148 template <typename R, typename A1, typename A2, typename A3, typename A4>
0149 class FunctionMocker<R(A1, A2, A3, A4)> : public
0150     internal::FunctionMockerBase<R(A1, A2, A3, A4)> {
0151  public:
0152   typedef R F(A1, A2, A3, A4);
0153   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
0154 
0155   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
0156       const Matcher<A3>& m3, const Matcher<A4>& m4) {
0157     this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4));
0158     return this->current_spec();
0159   }
0160 
0161   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) {
0162     // Even though gcc and MSVC don't enforce it, 'this->' is required
0163     // by the C++ standard [14.6.4] here, as the base class type is
0164     // dependent on the template argument (and thus shouldn't be
0165     // looked into when resolving InvokeWith).
0166     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4));
0167   }
0168 };
0169 
0170 template <typename R, typename A1, typename A2, typename A3, typename A4,
0171     typename A5>
0172 class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
0173     internal::FunctionMockerBase<R(A1, A2, A3, A4, A5)> {
0174  public:
0175   typedef R F(A1, A2, A3, A4, A5);
0176   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
0177 
0178   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
0179       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5) {
0180     this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5));
0181     return this->current_spec();
0182   }
0183 
0184   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
0185     // Even though gcc and MSVC don't enforce it, 'this->' is required
0186     // by the C++ standard [14.6.4] here, as the base class type is
0187     // dependent on the template argument (and thus shouldn't be
0188     // looked into when resolving InvokeWith).
0189     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5));
0190   }
0191 };
0192 
0193 template <typename R, typename A1, typename A2, typename A3, typename A4,
0194     typename A5, typename A6>
0195 class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
0196     internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6)> {
0197  public:
0198   typedef R F(A1, A2, A3, A4, A5, A6);
0199   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
0200 
0201   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
0202       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
0203       const Matcher<A6>& m6) {
0204     this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
0205         m6));
0206     return this->current_spec();
0207   }
0208 
0209   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
0210     // Even though gcc and MSVC don't enforce it, 'this->' is required
0211     // by the C++ standard [14.6.4] here, as the base class type is
0212     // dependent on the template argument (and thus shouldn't be
0213     // looked into when resolving InvokeWith).
0214     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6));
0215   }
0216 };
0217 
0218 template <typename R, typename A1, typename A2, typename A3, typename A4,
0219     typename A5, typename A6, typename A7>
0220 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
0221     internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7)> {
0222  public:
0223   typedef R F(A1, A2, A3, A4, A5, A6, A7);
0224   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
0225 
0226   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
0227       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
0228       const Matcher<A6>& m6, const Matcher<A7>& m7) {
0229     this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
0230         m6, m7));
0231     return this->current_spec();
0232   }
0233 
0234   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) {
0235     // Even though gcc and MSVC don't enforce it, 'this->' is required
0236     // by the C++ standard [14.6.4] here, as the base class type is
0237     // dependent on the template argument (and thus shouldn't be
0238     // looked into when resolving InvokeWith).
0239     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7));
0240   }
0241 };
0242 
0243 template <typename R, typename A1, typename A2, typename A3, typename A4,
0244     typename A5, typename A6, typename A7, typename A8>
0245 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
0246     internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
0247  public:
0248   typedef R F(A1, A2, A3, A4, A5, A6, A7, A8);
0249   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
0250 
0251   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
0252       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
0253       const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8) {
0254     this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
0255         m6, m7, m8));
0256     return this->current_spec();
0257   }
0258 
0259   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) {
0260     // Even though gcc and MSVC don't enforce it, 'this->' is required
0261     // by the C++ standard [14.6.4] here, as the base class type is
0262     // dependent on the template argument (and thus shouldn't be
0263     // looked into when resolving InvokeWith).
0264     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8));
0265   }
0266 };
0267 
0268 template <typename R, typename A1, typename A2, typename A3, typename A4,
0269     typename A5, typename A6, typename A7, typename A8, typename A9>
0270 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
0271     internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
0272  public:
0273   typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9);
0274   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
0275 
0276   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
0277       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
0278       const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
0279       const Matcher<A9>& m9) {
0280     this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
0281         m6, m7, m8, m9));
0282     return this->current_spec();
0283   }
0284 
0285   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) {
0286     // Even though gcc and MSVC don't enforce it, 'this->' is required
0287     // by the C++ standard [14.6.4] here, as the base class type is
0288     // dependent on the template argument (and thus shouldn't be
0289     // looked into when resolving InvokeWith).
0290     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9));
0291   }
0292 };
0293 
0294 template <typename R, typename A1, typename A2, typename A3, typename A4,
0295     typename A5, typename A6, typename A7, typename A8, typename A9,
0296     typename A10>
0297 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
0298     internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> {
0299  public:
0300   typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
0301   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
0302 
0303   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
0304       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
0305       const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
0306       const Matcher<A9>& m9, const Matcher<A10>& m10) {
0307     this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
0308         m6, m7, m8, m9, m10));
0309     return this->current_spec();
0310   }
0311 
0312   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
0313       A10 a10) {
0314     // Even though gcc and MSVC don't enforce it, 'this->' is required
0315     // by the C++ standard [14.6.4] here, as the base class type is
0316     // dependent on the template argument (and thus shouldn't be
0317     // looked into when resolving InvokeWith).
0318     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9,
0319         a10));
0320   }
0321 };
0322 
0323 }  // namespace internal
0324 
0325 // The style guide prohibits "using" statements in a namespace scope
0326 // inside a header file.  However, the FunctionMocker class template
0327 // is meant to be defined in the ::testing namespace.  The following
0328 // line is just a trick for working around a bug in MSVC 8.0, which
0329 // cannot handle it if we define FunctionMocker in ::testing.
0330 using internal::FunctionMocker;
0331 
0332 // GMOCK_RESULT_(tn, F) expands to the result type of function type F.
0333 // We define this as a variadic macro in case F contains unprotected
0334 // commas (the same reason that we use variadic macros in other places
0335 // in this file).
0336 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0337 #define GMOCK_RESULT_(tn, ...) \
0338     tn ::testing::internal::Function<__VA_ARGS__>::Result
0339 
0340 // The type of argument N of the given function type.
0341 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0342 #define GMOCK_ARG_(tn, N, ...) \
0343     tn ::testing::internal::Function<__VA_ARGS__>::Argument##N
0344 
0345 // The matcher type for argument N of the given function type.
0346 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0347 #define GMOCK_MATCHER_(tn, N, ...) \
0348     const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&
0349 
0350 // The variable for mocking the given method.
0351 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0352 #define GMOCK_MOCKER_(arity, constness, Method) \
0353     GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
0354 
0355 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0356 #define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
0357   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
0358       ) constness { \
0359     GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
0360         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
0361             == 0), \
0362         this_method_does_not_take_0_arguments); \
0363     GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \
0364     return GMOCK_MOCKER_(0, constness, Method).Invoke(); \
0365   } \
0366   ::testing::MockSpec<__VA_ARGS__>& \
0367       gmock_##Method() constness { \
0368     GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \
0369     return GMOCK_MOCKER_(0, constness, Method).With(); \
0370   } \
0371   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \
0372       Method)
0373 
0374 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0375 #define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
0376   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
0377       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
0378     GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
0379         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
0380             == 1), \
0381         this_method_does_not_take_1_argument); \
0382     GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \
0383     return GMOCK_MOCKER_(1, constness, Method).Invoke(gmock_a1); \
0384   } \
0385   ::testing::MockSpec<__VA_ARGS__>& \
0386       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
0387     GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \
0388     return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \
0389   } \
0390   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \
0391       Method)
0392 
0393 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0394 #define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \
0395   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
0396       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
0397       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
0398     GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
0399         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
0400             == 2), \
0401         this_method_does_not_take_2_arguments); \
0402     GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \
0403     return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2); \
0404   } \
0405   ::testing::MockSpec<__VA_ARGS__>& \
0406       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
0407                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
0408     GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \
0409     return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \
0410   } \
0411   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \
0412       Method)
0413 
0414 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0415 #define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \
0416   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
0417       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
0418       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
0419       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
0420     GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
0421         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
0422             == 3), \
0423         this_method_does_not_take_3_arguments); \
0424     GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \
0425     return GMOCK_MOCKER_(3, constness, Method).Invoke(gmock_a1, gmock_a2, \
0426         gmock_a3); \
0427   } \
0428   ::testing::MockSpec<__VA_ARGS__>& \
0429       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
0430                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
0431                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
0432     GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \
0433     return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \
0434         gmock_a3); \
0435   } \
0436   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \
0437       Method)
0438 
0439 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0440 #define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \
0441   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
0442       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
0443       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
0444       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
0445       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
0446     GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
0447         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
0448             == 4), \
0449         this_method_does_not_take_4_arguments); \
0450     GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \
0451     return GMOCK_MOCKER_(4, constness, Method).Invoke(gmock_a1, gmock_a2, \
0452         gmock_a3, gmock_a4); \
0453   } \
0454   ::testing::MockSpec<__VA_ARGS__>& \
0455       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
0456                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
0457                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
0458                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
0459     GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \
0460     return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \
0461         gmock_a3, gmock_a4); \
0462   } \
0463   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \
0464       Method)
0465 
0466 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0467 #define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \
0468   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
0469       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
0470       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
0471       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
0472       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
0473       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
0474     GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
0475         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
0476             == 5), \
0477         this_method_does_not_take_5_arguments); \
0478     GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \
0479     return GMOCK_MOCKER_(5, constness, Method).Invoke(gmock_a1, gmock_a2, \
0480         gmock_a3, gmock_a4, gmock_a5); \
0481   } \
0482   ::testing::MockSpec<__VA_ARGS__>& \
0483       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
0484                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
0485                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
0486                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
0487                      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
0488     GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \
0489     return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \
0490         gmock_a3, gmock_a4, gmock_a5); \
0491   } \
0492   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \
0493       Method)
0494 
0495 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0496 #define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \
0497   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
0498       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
0499       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
0500       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
0501       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
0502       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
0503       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
0504     GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
0505         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
0506             == 6), \
0507         this_method_does_not_take_6_arguments); \
0508     GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \
0509     return GMOCK_MOCKER_(6, constness, Method).Invoke(gmock_a1, gmock_a2, \
0510         gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
0511   } \
0512   ::testing::MockSpec<__VA_ARGS__>& \
0513       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
0514                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
0515                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
0516                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
0517                      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
0518                      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
0519     GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \
0520     return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \
0521         gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
0522   } \
0523   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \
0524       Method)
0525 
0526 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0527 #define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \
0528   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
0529       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
0530       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
0531       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
0532       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
0533       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
0534       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
0535       GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
0536     GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
0537         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
0538             == 7), \
0539         this_method_does_not_take_7_arguments); \
0540     GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \
0541     return GMOCK_MOCKER_(7, constness, Method).Invoke(gmock_a1, gmock_a2, \
0542         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
0543   } \
0544   ::testing::MockSpec<__VA_ARGS__>& \
0545       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
0546                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
0547                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
0548                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
0549                      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
0550                      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
0551                      GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
0552     GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \
0553     return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \
0554         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
0555   } \
0556   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \
0557       Method)
0558 
0559 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0560 #define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \
0561   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
0562       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
0563       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
0564       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
0565       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
0566       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
0567       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
0568       GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
0569       GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
0570     GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
0571         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
0572             == 8), \
0573         this_method_does_not_take_8_arguments); \
0574     GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \
0575     return GMOCK_MOCKER_(8, constness, Method).Invoke(gmock_a1, gmock_a2, \
0576         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
0577   } \
0578   ::testing::MockSpec<__VA_ARGS__>& \
0579       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
0580                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
0581                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
0582                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
0583                      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
0584                      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
0585                      GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
0586                      GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
0587     GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \
0588     return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \
0589         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
0590   } \
0591   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \
0592       Method)
0593 
0594 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0595 #define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \
0596   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
0597       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
0598       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
0599       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
0600       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
0601       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
0602       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
0603       GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
0604       GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
0605       GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
0606     GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
0607         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
0608             == 9), \
0609         this_method_does_not_take_9_arguments); \
0610     GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \
0611     return GMOCK_MOCKER_(9, constness, Method).Invoke(gmock_a1, gmock_a2, \
0612         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
0613         gmock_a9); \
0614   } \
0615   ::testing::MockSpec<__VA_ARGS__>& \
0616       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
0617                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
0618                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
0619                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
0620                      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
0621                      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
0622                      GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
0623                      GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
0624                      GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
0625     GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \
0626     return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \
0627         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
0628         gmock_a9); \
0629   } \
0630   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \
0631       Method)
0632 
0633 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
0634 #define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \
0635   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
0636       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
0637       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
0638       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
0639       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
0640       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
0641       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
0642       GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
0643       GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
0644       GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
0645       GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
0646     GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
0647         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
0648             == 10), \
0649         this_method_does_not_take_10_arguments); \
0650     GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \
0651     return GMOCK_MOCKER_(10, constness, Method).Invoke(gmock_a1, gmock_a2, \
0652         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
0653         gmock_a10); \
0654   } \
0655   ::testing::MockSpec<__VA_ARGS__>& \
0656       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
0657                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
0658                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
0659                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
0660                      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
0661                      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
0662                      GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
0663                      GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
0664                      GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \
0665                      GMOCK_MATCHER_(tn, 10, \
0666                          __VA_ARGS__) gmock_a10) constness { \
0667     GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \
0668     return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \
0669         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
0670         gmock_a10); \
0671   } \
0672   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \
0673       Method)
0674 
0675 #define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__)
0676 #define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__)
0677 #define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)
0678 #define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__)
0679 #define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__)
0680 #define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__)
0681 #define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__)
0682 #define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__)
0683 #define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__)
0684 #define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__)
0685 #define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__)
0686 
0687 #define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__)
0688 #define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__)
0689 #define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__)
0690 #define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__)
0691 #define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__)
0692 #define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__)
0693 #define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__)
0694 #define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__)
0695 #define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__)
0696 #define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__)
0697 #define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__)
0698 
0699 #define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__)
0700 #define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__)
0701 #define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__)
0702 #define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__)
0703 #define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__)
0704 #define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__)
0705 #define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__)
0706 #define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__)
0707 #define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__)
0708 #define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__)
0709 #define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__)
0710 
0711 #define MOCK_CONST_METHOD0_T(m, ...) \
0712     GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__)
0713 #define MOCK_CONST_METHOD1_T(m, ...) \
0714     GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__)
0715 #define MOCK_CONST_METHOD2_T(m, ...) \
0716     GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__)
0717 #define MOCK_CONST_METHOD3_T(m, ...) \
0718     GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__)
0719 #define MOCK_CONST_METHOD4_T(m, ...) \
0720     GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__)
0721 #define MOCK_CONST_METHOD5_T(m, ...) \
0722     GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__)
0723 #define MOCK_CONST_METHOD6_T(m, ...) \
0724     GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__)
0725 #define MOCK_CONST_METHOD7_T(m, ...) \
0726     GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__)
0727 #define MOCK_CONST_METHOD8_T(m, ...) \
0728     GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__)
0729 #define MOCK_CONST_METHOD9_T(m, ...) \
0730     GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__)
0731 #define MOCK_CONST_METHOD10_T(m, ...) \
0732     GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__)
0733 
0734 #define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \
0735     GMOCK_METHOD0_(, , ct, m, __VA_ARGS__)
0736 #define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \
0737     GMOCK_METHOD1_(, , ct, m, __VA_ARGS__)
0738 #define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \
0739     GMOCK_METHOD2_(, , ct, m, __VA_ARGS__)
0740 #define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \
0741     GMOCK_METHOD3_(, , ct, m, __VA_ARGS__)
0742 #define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \
0743     GMOCK_METHOD4_(, , ct, m, __VA_ARGS__)
0744 #define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \
0745     GMOCK_METHOD5_(, , ct, m, __VA_ARGS__)
0746 #define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \
0747     GMOCK_METHOD6_(, , ct, m, __VA_ARGS__)
0748 #define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \
0749     GMOCK_METHOD7_(, , ct, m, __VA_ARGS__)
0750 #define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \
0751     GMOCK_METHOD8_(, , ct, m, __VA_ARGS__)
0752 #define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \
0753     GMOCK_METHOD9_(, , ct, m, __VA_ARGS__)
0754 #define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \
0755     GMOCK_METHOD10_(, , ct, m, __VA_ARGS__)
0756 
0757 #define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \
0758     GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__)
0759 #define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \
0760     GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__)
0761 #define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \
0762     GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__)
0763 #define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \
0764     GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__)
0765 #define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \
0766     GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__)
0767 #define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \
0768     GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__)
0769 #define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \
0770     GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__)
0771 #define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \
0772     GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__)
0773 #define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \
0774     GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__)
0775 #define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \
0776     GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__)
0777 #define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \
0778     GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__)
0779 
0780 #define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
0781     GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__)
0782 #define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
0783     GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__)
0784 #define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
0785     GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__)
0786 #define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
0787     GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__)
0788 #define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
0789     GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__)
0790 #define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
0791     GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__)
0792 #define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
0793     GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__)
0794 #define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
0795     GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__)
0796 #define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
0797     GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__)
0798 #define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
0799     GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__)
0800 #define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
0801     GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__)
0802 
0803 #define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
0804     GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__)
0805 #define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
0806     GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__)
0807 #define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
0808     GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__)
0809 #define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
0810     GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__)
0811 #define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
0812     GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__)
0813 #define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
0814     GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__)
0815 #define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
0816     GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__)
0817 #define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
0818     GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__)
0819 #define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
0820     GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__)
0821 #define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
0822     GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__)
0823 #define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
0824     GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__)
0825 
0826 // A MockFunction<F> class has one mock method whose type is F.  It is
0827 // useful when you just want your test code to emit some messages and
0828 // have Google Mock verify the right messages are sent (and perhaps at
0829 // the right times).  For example, if you are exercising code:
0830 //
0831 //   Foo(1);
0832 //   Foo(2);
0833 //   Foo(3);
0834 //
0835 // and want to verify that Foo(1) and Foo(3) both invoke
0836 // mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:
0837 //
0838 // TEST(FooTest, InvokesBarCorrectly) {
0839 //   MyMock mock;
0840 //   MockFunction<void(string check_point_name)> check;
0841 //   {
0842 //     InSequence s;
0843 //
0844 //     EXPECT_CALL(mock, Bar("a"));
0845 //     EXPECT_CALL(check, Call("1"));
0846 //     EXPECT_CALL(check, Call("2"));
0847 //     EXPECT_CALL(mock, Bar("a"));
0848 //   }
0849 //   Foo(1);
0850 //   check.Call("1");
0851 //   Foo(2);
0852 //   check.Call("2");
0853 //   Foo(3);
0854 // }
0855 //
0856 // The expectation spec says that the first Bar("a") must happen
0857 // before check point "1", the second Bar("a") must happen after check
0858 // point "2", and nothing should happen between the two check
0859 // points. The explicit check points make it easy to tell which
0860 // Bar("a") is called by which call to Foo().
0861 //
0862 // MockFunction<F> can also be used to exercise code that accepts
0863 // std::function<F> callbacks. To do so, use AsStdFunction() method
0864 // to create std::function proxy forwarding to original object's Call.
0865 // Example:
0866 //
0867 // TEST(FooTest, RunsCallbackWithBarArgument) {
0868 //   MockFunction<int(string)> callback;
0869 //   EXPECT_CALL(callback, Call("bar")).WillOnce(Return(1));
0870 //   Foo(callback.AsStdFunction());
0871 // }
0872 template <typename F>
0873 class MockFunction;
0874 
0875 template <typename R>
0876 class MockFunction<R()> {
0877  public:
0878   MockFunction() {}
0879 
0880   MOCK_METHOD0_T(Call, R());
0881 
0882 #if GTEST_HAS_STD_FUNCTION_
0883   std::function<R()> AsStdFunction() {
0884     return [this]() -> R {
0885       return this->Call();
0886     };
0887   }
0888 #endif  // GTEST_HAS_STD_FUNCTION_
0889 
0890  private:
0891   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
0892 };
0893 
0894 template <typename R, typename A0>
0895 class MockFunction<R(A0)> {
0896  public:
0897   MockFunction() {}
0898 
0899   MOCK_METHOD1_T(Call, R(A0));
0900 
0901 #if GTEST_HAS_STD_FUNCTION_
0902   std::function<R(A0)> AsStdFunction() {
0903     return [this](A0 a0) -> R {
0904       return this->Call(a0);
0905     };
0906   }
0907 #endif  // GTEST_HAS_STD_FUNCTION_
0908 
0909  private:
0910   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
0911 };
0912 
0913 template <typename R, typename A0, typename A1>
0914 class MockFunction<R(A0, A1)> {
0915  public:
0916   MockFunction() {}
0917 
0918   MOCK_METHOD2_T(Call, R(A0, A1));
0919 
0920 #if GTEST_HAS_STD_FUNCTION_
0921   std::function<R(A0, A1)> AsStdFunction() {
0922     return [this](A0 a0, A1 a1) -> R {
0923       return this->Call(a0, a1);
0924     };
0925   }
0926 #endif  // GTEST_HAS_STD_FUNCTION_
0927 
0928  private:
0929   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
0930 };
0931 
0932 template <typename R, typename A0, typename A1, typename A2>
0933 class MockFunction<R(A0, A1, A2)> {
0934  public:
0935   MockFunction() {}
0936 
0937   MOCK_METHOD3_T(Call, R(A0, A1, A2));
0938 
0939 #if GTEST_HAS_STD_FUNCTION_
0940   std::function<R(A0, A1, A2)> AsStdFunction() {
0941     return [this](A0 a0, A1 a1, A2 a2) -> R {
0942       return this->Call(a0, a1, a2);
0943     };
0944   }
0945 #endif  // GTEST_HAS_STD_FUNCTION_
0946 
0947  private:
0948   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
0949 };
0950 
0951 template <typename R, typename A0, typename A1, typename A2, typename A3>
0952 class MockFunction<R(A0, A1, A2, A3)> {
0953  public:
0954   MockFunction() {}
0955 
0956   MOCK_METHOD4_T(Call, R(A0, A1, A2, A3));
0957 
0958 #if GTEST_HAS_STD_FUNCTION_
0959   std::function<R(A0, A1, A2, A3)> AsStdFunction() {
0960     return [this](A0 a0, A1 a1, A2 a2, A3 a3) -> R {
0961       return this->Call(a0, a1, a2, a3);
0962     };
0963   }
0964 #endif  // GTEST_HAS_STD_FUNCTION_
0965 
0966  private:
0967   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
0968 };
0969 
0970 template <typename R, typename A0, typename A1, typename A2, typename A3,
0971     typename A4>
0972 class MockFunction<R(A0, A1, A2, A3, A4)> {
0973  public:
0974   MockFunction() {}
0975 
0976   MOCK_METHOD5_T(Call, R(A0, A1, A2, A3, A4));
0977 
0978 #if GTEST_HAS_STD_FUNCTION_
0979   std::function<R(A0, A1, A2, A3, A4)> AsStdFunction() {
0980     return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) -> R {
0981       return this->Call(a0, a1, a2, a3, a4);
0982     };
0983   }
0984 #endif  // GTEST_HAS_STD_FUNCTION_
0985 
0986  private:
0987   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
0988 };
0989 
0990 template <typename R, typename A0, typename A1, typename A2, typename A3,
0991     typename A4, typename A5>
0992 class MockFunction<R(A0, A1, A2, A3, A4, A5)> {
0993  public:
0994   MockFunction() {}
0995 
0996   MOCK_METHOD6_T(Call, R(A0, A1, A2, A3, A4, A5));
0997 
0998 #if GTEST_HAS_STD_FUNCTION_
0999   std::function<R(A0, A1, A2, A3, A4, A5)> AsStdFunction() {
1000     return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -> R {
1001       return this->Call(a0, a1, a2, a3, a4, a5);
1002     };
1003   }
1004 #endif  // GTEST_HAS_STD_FUNCTION_
1005 
1006  private:
1007   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
1008 };
1009 
1010 template <typename R, typename A0, typename A1, typename A2, typename A3,
1011     typename A4, typename A5, typename A6>
1012 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> {
1013  public:
1014   MockFunction() {}
1015 
1016   MOCK_METHOD7_T(Call, R(A0, A1, A2, A3, A4, A5, A6));
1017 
1018 #if GTEST_HAS_STD_FUNCTION_
1019   std::function<R(A0, A1, A2, A3, A4, A5, A6)> AsStdFunction() {
1020     return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -> R {
1021       return this->Call(a0, a1, a2, a3, a4, a5, a6);
1022     };
1023   }
1024 #endif  // GTEST_HAS_STD_FUNCTION_
1025 
1026  private:
1027   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
1028 };
1029 
1030 template <typename R, typename A0, typename A1, typename A2, typename A3,
1031     typename A4, typename A5, typename A6, typename A7>
1032 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> {
1033  public:
1034   MockFunction() {}
1035 
1036   MOCK_METHOD8_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7));
1037 
1038 #if GTEST_HAS_STD_FUNCTION_
1039   std::function<R(A0, A1, A2, A3, A4, A5, A6, A7)> AsStdFunction() {
1040     return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -> R {
1041       return this->Call(a0, a1, a2, a3, a4, a5, a6, a7);
1042     };
1043   }
1044 #endif  // GTEST_HAS_STD_FUNCTION_
1045 
1046  private:
1047   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
1048 };
1049 
1050 template <typename R, typename A0, typename A1, typename A2, typename A3,
1051     typename A4, typename A5, typename A6, typename A7, typename A8>
1052 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> {
1053  public:
1054   MockFunction() {}
1055 
1056   MOCK_METHOD9_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8));
1057 
1058 #if GTEST_HAS_STD_FUNCTION_
1059   std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> AsStdFunction() {
1060     return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
1061         A8 a8) -> R {
1062       return this->Call(a0, a1, a2, a3, a4, a5, a6, a7, a8);
1063     };
1064   }
1065 #endif  // GTEST_HAS_STD_FUNCTION_
1066 
1067  private:
1068   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
1069 };
1070 
1071 template <typename R, typename A0, typename A1, typename A2, typename A3,
1072     typename A4, typename A5, typename A6, typename A7, typename A8,
1073     typename A9>
1074 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
1075  public:
1076   MockFunction() {}
1077 
1078   MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));
1079 
1080 #if GTEST_HAS_STD_FUNCTION_
1081   std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> AsStdFunction() {
1082     return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
1083         A8 a8, A9 a9) -> R {
1084       return this->Call(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
1085     };
1086   }
1087 #endif  // GTEST_HAS_STD_FUNCTION_
1088 
1089  private:
1090   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
1091 };
1092 
1093 }  // namespace testing
1094 
1095 #endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_