• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // This file was GENERATED by command:
2 //     pump.py gmock-generated-function-mockers.h.pump
3 // DO NOT EDIT BY HAND!!!
4 
5 // Copyright 2007, Google Inc.
6 // All rights reserved.
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions are
10 // met:
11 //
12 //     * Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 //     * Redistributions in binary form must reproduce the above
15 // copyright notice, this list of conditions and the following disclaimer
16 // in the documentation and/or other materials provided with the
17 // distribution.
18 //     * Neither the name of Google Inc. nor the names of its
19 // contributors may be used to endorse or promote products derived from
20 // this software without specific prior written permission.
21 //
22 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 //
34 // Author: wan@google.com (Zhanyong Wan)
35 
36 // Google Mock - a framework for writing C++ mock classes.
37 //
38 // This file implements function mockers of various arities.
39 
40 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
41 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
42 
43 #include "gmock/gmock-spec-builders.h"
44 #include "gmock/internal/gmock-internal-utils.h"
45 
46 namespace testing {
47 namespace internal {
48 
49 template <typename F>
50 class FunctionMockerBase;
51 
52 // Note: class FunctionMocker really belongs to the ::testing
53 // namespace.  However if we define it in ::testing, MSVC will
54 // complain when classes in ::testing::internal declare it as a
55 // friend class template.  To workaround this compiler bug, we define
56 // FunctionMocker in ::testing::internal and import it into ::testing.
57 template <typename F>
58 class FunctionMocker;
59 
60 template <typename R>
61 class FunctionMocker<R()> : public
62     internal::FunctionMockerBase<R()> {
63  public:
64   typedef R F();
65   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
66 
With()67   MockSpec<F>& With() {
68     return this->current_spec();
69   }
70 
Invoke()71   R Invoke() {
72     // Even though gcc and MSVC don't enforce it, 'this->' is required
73     // by the C++ standard [14.6.4] here, as the base class type is
74     // dependent on the template argument (and thus shouldn't be
75     // looked into when resolving InvokeWith).
76     return this->InvokeWith(ArgumentTuple());
77   }
78 };
79 
80 template <typename R, typename A1>
81 class FunctionMocker<R(A1)> : public
82     internal::FunctionMockerBase<R(A1)> {
83  public:
84   typedef R F(A1);
85   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
86 
With(const Matcher<A1> & m1)87   MockSpec<F>& With(const Matcher<A1>& m1) {
88     this->current_spec().SetMatchers(::std::tr1::make_tuple(m1));
89     return this->current_spec();
90   }
91 
Invoke(A1 a1)92   R Invoke(A1 a1) {
93     // Even though gcc and MSVC don't enforce it, 'this->' is required
94     // by the C++ standard [14.6.4] here, as the base class type is
95     // dependent on the template argument (and thus shouldn't be
96     // looked into when resolving InvokeWith).
97     return this->InvokeWith(ArgumentTuple(a1));
98   }
99 };
100 
101 template <typename R, typename A1, typename A2>
102 class FunctionMocker<R(A1, A2)> : public
103     internal::FunctionMockerBase<R(A1, A2)> {
104  public:
105   typedef R F(A1, A2);
106   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
107 
With(const Matcher<A1> & m1,const Matcher<A2> & m2)108   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2) {
109     this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2));
110     return this->current_spec();
111   }
112 
Invoke(A1 a1,A2 a2)113   R Invoke(A1 a1, A2 a2) {
114     // Even though gcc and MSVC don't enforce it, 'this->' is required
115     // by the C++ standard [14.6.4] here, as the base class type is
116     // dependent on the template argument (and thus shouldn't be
117     // looked into when resolving InvokeWith).
118     return this->InvokeWith(ArgumentTuple(a1, a2));
119   }
120 };
121 
122 template <typename R, typename A1, typename A2, typename A3>
123 class FunctionMocker<R(A1, A2, A3)> : public
124     internal::FunctionMockerBase<R(A1, A2, A3)> {
125  public:
126   typedef R F(A1, A2, A3);
127   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
128 
With(const Matcher<A1> & m1,const Matcher<A2> & m2,const Matcher<A3> & m3)129   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
130       const Matcher<A3>& m3) {
131     this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3));
132     return this->current_spec();
133   }
134 
Invoke(A1 a1,A2 a2,A3 a3)135   R Invoke(A1 a1, A2 a2, A3 a3) {
136     // Even though gcc and MSVC don't enforce it, 'this->' is required
137     // by the C++ standard [14.6.4] here, as the base class type is
138     // dependent on the template argument (and thus shouldn't be
139     // looked into when resolving InvokeWith).
140     return this->InvokeWith(ArgumentTuple(a1, a2, a3));
141   }
142 };
143 
144 template <typename R, typename A1, typename A2, typename A3, typename A4>
145 class FunctionMocker<R(A1, A2, A3, A4)> : public
146     internal::FunctionMockerBase<R(A1, A2, A3, A4)> {
147  public:
148   typedef R F(A1, A2, A3, A4);
149   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
150 
With(const Matcher<A1> & m1,const Matcher<A2> & m2,const Matcher<A3> & m3,const Matcher<A4> & m4)151   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
152       const Matcher<A3>& m3, const Matcher<A4>& m4) {
153     this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4));
154     return this->current_spec();
155   }
156 
Invoke(A1 a1,A2 a2,A3 a3,A4 a4)157   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) {
158     // Even though gcc and MSVC don't enforce it, 'this->' is required
159     // by the C++ standard [14.6.4] here, as the base class type is
160     // dependent on the template argument (and thus shouldn't be
161     // looked into when resolving InvokeWith).
162     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4));
163   }
164 };
165 
166 template <typename R, typename A1, typename A2, typename A3, typename A4,
167     typename A5>
168 class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
169     internal::FunctionMockerBase<R(A1, A2, A3, A4, A5)> {
170  public:
171   typedef R F(A1, A2, A3, A4, A5);
172   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
173 
With(const Matcher<A1> & m1,const Matcher<A2> & m2,const Matcher<A3> & m3,const Matcher<A4> & m4,const Matcher<A5> & m5)174   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
175       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5) {
176     this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4,
177         m5));
178     return this->current_spec();
179   }
180 
Invoke(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5)181   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
182     // Even though gcc and MSVC don't enforce it, 'this->' is required
183     // by the C++ standard [14.6.4] here, as the base class type is
184     // dependent on the template argument (and thus shouldn't be
185     // looked into when resolving InvokeWith).
186     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5));
187   }
188 };
189 
190 template <typename R, typename A1, typename A2, typename A3, typename A4,
191     typename A5, typename A6>
192 class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
193     internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6)> {
194  public:
195   typedef R F(A1, A2, A3, A4, A5, A6);
196   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
197 
With(const Matcher<A1> & m1,const Matcher<A2> & m2,const Matcher<A3> & m3,const Matcher<A4> & m4,const Matcher<A5> & m5,const Matcher<A6> & m6)198   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
199       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
200       const Matcher<A6>& m6) {
201     this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
202         m6));
203     return this->current_spec();
204   }
205 
Invoke(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6)206   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
207     // Even though gcc and MSVC don't enforce it, 'this->' is required
208     // by the C++ standard [14.6.4] here, as the base class type is
209     // dependent on the template argument (and thus shouldn't be
210     // looked into when resolving InvokeWith).
211     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6));
212   }
213 };
214 
215 template <typename R, typename A1, typename A2, typename A3, typename A4,
216     typename A5, typename A6, typename A7>
217 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
218     internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7)> {
219  public:
220   typedef R F(A1, A2, A3, A4, A5, A6, A7);
221   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
222 
With(const Matcher<A1> & m1,const Matcher<A2> & m2,const Matcher<A3> & m3,const Matcher<A4> & m4,const Matcher<A5> & m5,const Matcher<A6> & m6,const Matcher<A7> & m7)223   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
224       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
225       const Matcher<A6>& m6, const Matcher<A7>& m7) {
226     this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
227         m6, m7));
228     return this->current_spec();
229   }
230 
Invoke(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7)231   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) {
232     // Even though gcc and MSVC don't enforce it, 'this->' is required
233     // by the C++ standard [14.6.4] here, as the base class type is
234     // dependent on the template argument (and thus shouldn't be
235     // looked into when resolving InvokeWith).
236     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7));
237   }
238 };
239 
240 template <typename R, typename A1, typename A2, typename A3, typename A4,
241     typename A5, typename A6, typename A7, typename A8>
242 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
243     internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
244  public:
245   typedef R F(A1, A2, A3, A4, A5, A6, A7, A8);
246   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
247 
With(const Matcher<A1> & m1,const Matcher<A2> & m2,const Matcher<A3> & m3,const Matcher<A4> & m4,const Matcher<A5> & m5,const Matcher<A6> & m6,const Matcher<A7> & m7,const Matcher<A8> & m8)248   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
249       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
250       const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8) {
251     this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
252         m6, m7, m8));
253     return this->current_spec();
254   }
255 
Invoke(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8)256   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) {
257     // Even though gcc and MSVC don't enforce it, 'this->' is required
258     // by the C++ standard [14.6.4] here, as the base class type is
259     // dependent on the template argument (and thus shouldn't be
260     // looked into when resolving InvokeWith).
261     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8));
262   }
263 };
264 
265 template <typename R, typename A1, typename A2, typename A3, typename A4,
266     typename A5, typename A6, typename A7, typename A8, typename A9>
267 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
268     internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
269  public:
270   typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9);
271   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
272 
With(const Matcher<A1> & m1,const Matcher<A2> & m2,const Matcher<A3> & m3,const Matcher<A4> & m4,const Matcher<A5> & m5,const Matcher<A6> & m6,const Matcher<A7> & m7,const Matcher<A8> & m8,const Matcher<A9> & m9)273   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
274       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
275       const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
276       const Matcher<A9>& m9) {
277     this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
278         m6, m7, m8, m9));
279     return this->current_spec();
280   }
281 
Invoke(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9)282   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) {
283     // Even though gcc and MSVC don't enforce it, 'this->' is required
284     // by the C++ standard [14.6.4] here, as the base class type is
285     // dependent on the template argument (and thus shouldn't be
286     // looked into when resolving InvokeWith).
287     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9));
288   }
289 };
290 
291 template <typename R, typename A1, typename A2, typename A3, typename A4,
292     typename A5, typename A6, typename A7, typename A8, typename A9,
293     typename A10>
294 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
295     internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> {
296  public:
297   typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
298   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
299 
With(const Matcher<A1> & m1,const Matcher<A2> & m2,const Matcher<A3> & m3,const Matcher<A4> & m4,const Matcher<A5> & m5,const Matcher<A6> & m6,const Matcher<A7> & m7,const Matcher<A8> & m8,const Matcher<A9> & m9,const Matcher<A10> & m10)300   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
301       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
302       const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
303       const Matcher<A9>& m9, const Matcher<A10>& m10) {
304     this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
305         m6, m7, m8, m9, m10));
306     return this->current_spec();
307   }
308 
Invoke(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9,A10 a10)309   R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
310       A10 a10) {
311     // Even though gcc and MSVC don't enforce it, 'this->' is required
312     // by the C++ standard [14.6.4] here, as the base class type is
313     // dependent on the template argument (and thus shouldn't be
314     // looked into when resolving InvokeWith).
315     return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9,
316         a10));
317   }
318 };
319 
320 }  // namespace internal
321 
322 // The style guide prohibits "using" statements in a namespace scope
323 // inside a header file.  However, the FunctionMocker class template
324 // is meant to be defined in the ::testing namespace.  The following
325 // line is just a trick for working around a bug in MSVC 8.0, which
326 // cannot handle it if we define FunctionMocker in ::testing.
327 using internal::FunctionMocker;
328 
329 // GMOCK_RESULT_(tn, F) expands to the result type of function type F.
330 // We define this as a variadic macro in case F contains unprotected
331 // commas (the same reason that we use variadic macros in other places
332 // in this file).
333 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
334 #define GMOCK_RESULT_(tn, ...) \
335     tn ::testing::internal::Function<__VA_ARGS__>::Result
336 
337 // The type of argument N of the given function type.
338 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
339 #define GMOCK_ARG_(tn, N, ...) \
340     tn ::testing::internal::Function<__VA_ARGS__>::Argument##N
341 
342 // The matcher type for argument N of the given function type.
343 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
344 #define GMOCK_MATCHER_(tn, N, ...) \
345     const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&
346 
347 // The variable for mocking the given method.
348 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
349 #define GMOCK_MOCKER_(arity, constness, Method) \
350     GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
351 
352 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
353 #define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
354   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
355       ) constness { \
356     GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
357         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
358             == 0), \
359         this_method_does_not_take_0_arguments); \
360     GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \
361     return GMOCK_MOCKER_(0, constness, Method).Invoke(); \
362   } \
363   ::testing::MockSpec<__VA_ARGS__>& \
364       gmock_##Method() constness { \
365     GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \
366     return GMOCK_MOCKER_(0, constness, Method).With(); \
367   } \
368   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \
369       Method)
370 
371 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
372 #define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
373   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
374       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
375     GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
376         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
377             == 1), \
378         this_method_does_not_take_1_argument); \
379     GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \
380     return GMOCK_MOCKER_(1, constness, Method).Invoke(gmock_a1); \
381   } \
382   ::testing::MockSpec<__VA_ARGS__>& \
383       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
384     GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \
385     return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \
386   } \
387   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \
388       Method)
389 
390 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
391 #define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \
392   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
393       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
394       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
395     GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
396         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
397             == 2), \
398         this_method_does_not_take_2_arguments); \
399     GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \
400     return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2); \
401   } \
402   ::testing::MockSpec<__VA_ARGS__>& \
403       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
404                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
405     GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \
406     return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \
407   } \
408   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \
409       Method)
410 
411 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
412 #define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \
413   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
414       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
415       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
416       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
417     GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
418         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
419             == 3), \
420         this_method_does_not_take_3_arguments); \
421     GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \
422     return GMOCK_MOCKER_(3, constness, Method).Invoke(gmock_a1, gmock_a2, \
423         gmock_a3); \
424   } \
425   ::testing::MockSpec<__VA_ARGS__>& \
426       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
427                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
428                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
429     GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \
430     return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \
431         gmock_a3); \
432   } \
433   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \
434       Method)
435 
436 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
437 #define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \
438   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
439       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
440       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
441       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
442       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
443     GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
444         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
445             == 4), \
446         this_method_does_not_take_4_arguments); \
447     GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \
448     return GMOCK_MOCKER_(4, constness, Method).Invoke(gmock_a1, gmock_a2, \
449         gmock_a3, gmock_a4); \
450   } \
451   ::testing::MockSpec<__VA_ARGS__>& \
452       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
453                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
454                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
455                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
456     GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \
457     return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \
458         gmock_a3, gmock_a4); \
459   } \
460   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \
461       Method)
462 
463 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
464 #define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \
465   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
466       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
467       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
468       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
469       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
470       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
471     GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
472         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
473             == 5), \
474         this_method_does_not_take_5_arguments); \
475     GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \
476     return GMOCK_MOCKER_(5, constness, Method).Invoke(gmock_a1, gmock_a2, \
477         gmock_a3, gmock_a4, gmock_a5); \
478   } \
479   ::testing::MockSpec<__VA_ARGS__>& \
480       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
481                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
482                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
483                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
484                      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
485     GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \
486     return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \
487         gmock_a3, gmock_a4, gmock_a5); \
488   } \
489   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \
490       Method)
491 
492 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
493 #define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \
494   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
495       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
496       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
497       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
498       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
499       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
500       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
501     GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
502         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
503             == 6), \
504         this_method_does_not_take_6_arguments); \
505     GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \
506     return GMOCK_MOCKER_(6, constness, Method).Invoke(gmock_a1, gmock_a2, \
507         gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
508   } \
509   ::testing::MockSpec<__VA_ARGS__>& \
510       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
511                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
512                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
513                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
514                      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
515                      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
516     GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \
517     return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \
518         gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
519   } \
520   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \
521       Method)
522 
523 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
524 #define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \
525   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
526       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
527       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
528       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
529       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
530       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
531       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
532       GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
533     GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
534         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
535             == 7), \
536         this_method_does_not_take_7_arguments); \
537     GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \
538     return GMOCK_MOCKER_(7, constness, Method).Invoke(gmock_a1, gmock_a2, \
539         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
540   } \
541   ::testing::MockSpec<__VA_ARGS__>& \
542       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
543                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
544                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
545                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
546                      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
547                      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
548                      GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
549     GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \
550     return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \
551         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
552   } \
553   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \
554       Method)
555 
556 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
557 #define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \
558   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
559       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
560       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
561       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
562       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
563       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
564       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
565       GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
566       GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
567     GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
568         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
569             == 8), \
570         this_method_does_not_take_8_arguments); \
571     GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \
572     return GMOCK_MOCKER_(8, constness, Method).Invoke(gmock_a1, gmock_a2, \
573         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
574   } \
575   ::testing::MockSpec<__VA_ARGS__>& \
576       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
577                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
578                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
579                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
580                      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
581                      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
582                      GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
583                      GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
584     GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \
585     return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \
586         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
587   } \
588   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \
589       Method)
590 
591 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
592 #define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \
593   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
594       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
595       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
596       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
597       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
598       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
599       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
600       GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
601       GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
602       GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
603     GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
604         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
605             == 9), \
606         this_method_does_not_take_9_arguments); \
607     GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \
608     return GMOCK_MOCKER_(9, constness, Method).Invoke(gmock_a1, gmock_a2, \
609         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
610         gmock_a9); \
611   } \
612   ::testing::MockSpec<__VA_ARGS__>& \
613       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
614                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
615                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
616                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
617                      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
618                      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
619                      GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
620                      GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
621                      GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
622     GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \
623     return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \
624         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
625         gmock_a9); \
626   } \
627   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \
628       Method)
629 
630 // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
631 #define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \
632   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
633       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
634       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
635       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
636       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
637       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
638       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
639       GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
640       GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
641       GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
642       GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
643     GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
644         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
645             == 10), \
646         this_method_does_not_take_10_arguments); \
647     GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \
648     return GMOCK_MOCKER_(10, constness, Method).Invoke(gmock_a1, gmock_a2, \
649         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
650         gmock_a10); \
651   } \
652   ::testing::MockSpec<__VA_ARGS__>& \
653       gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
654                      GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
655                      GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
656                      GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
657                      GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
658                      GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
659                      GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
660                      GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
661                      GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \
662                      GMOCK_MATCHER_(tn, 10, \
663                          __VA_ARGS__) gmock_a10) constness { \
664     GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \
665     return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \
666         gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
667         gmock_a10); \
668   } \
669   mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \
670       Method)
671 
672 #define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__)
673 #define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__)
674 #define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)
675 #define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__)
676 #define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__)
677 #define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__)
678 #define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__)
679 #define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__)
680 #define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__)
681 #define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__)
682 #define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__)
683 
684 #define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__)
685 #define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__)
686 #define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__)
687 #define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__)
688 #define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__)
689 #define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__)
690 #define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__)
691 #define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__)
692 #define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__)
693 #define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__)
694 #define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__)
695 
696 #define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__)
697 #define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__)
698 #define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__)
699 #define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__)
700 #define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__)
701 #define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__)
702 #define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__)
703 #define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__)
704 #define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__)
705 #define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__)
706 #define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__)
707 
708 #define MOCK_CONST_METHOD0_T(m, ...) \
709     GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__)
710 #define MOCK_CONST_METHOD1_T(m, ...) \
711     GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__)
712 #define MOCK_CONST_METHOD2_T(m, ...) \
713     GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__)
714 #define MOCK_CONST_METHOD3_T(m, ...) \
715     GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__)
716 #define MOCK_CONST_METHOD4_T(m, ...) \
717     GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__)
718 #define MOCK_CONST_METHOD5_T(m, ...) \
719     GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__)
720 #define MOCK_CONST_METHOD6_T(m, ...) \
721     GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__)
722 #define MOCK_CONST_METHOD7_T(m, ...) \
723     GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__)
724 #define MOCK_CONST_METHOD8_T(m, ...) \
725     GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__)
726 #define MOCK_CONST_METHOD9_T(m, ...) \
727     GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__)
728 #define MOCK_CONST_METHOD10_T(m, ...) \
729     GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__)
730 
731 #define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \
732     GMOCK_METHOD0_(, , ct, m, __VA_ARGS__)
733 #define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \
734     GMOCK_METHOD1_(, , ct, m, __VA_ARGS__)
735 #define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \
736     GMOCK_METHOD2_(, , ct, m, __VA_ARGS__)
737 #define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \
738     GMOCK_METHOD3_(, , ct, m, __VA_ARGS__)
739 #define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \
740     GMOCK_METHOD4_(, , ct, m, __VA_ARGS__)
741 #define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \
742     GMOCK_METHOD5_(, , ct, m, __VA_ARGS__)
743 #define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \
744     GMOCK_METHOD6_(, , ct, m, __VA_ARGS__)
745 #define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \
746     GMOCK_METHOD7_(, , ct, m, __VA_ARGS__)
747 #define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \
748     GMOCK_METHOD8_(, , ct, m, __VA_ARGS__)
749 #define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \
750     GMOCK_METHOD9_(, , ct, m, __VA_ARGS__)
751 #define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \
752     GMOCK_METHOD10_(, , ct, m, __VA_ARGS__)
753 
754 #define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \
755     GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__)
756 #define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \
757     GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__)
758 #define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \
759     GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__)
760 #define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \
761     GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__)
762 #define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \
763     GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__)
764 #define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \
765     GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__)
766 #define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \
767     GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__)
768 #define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \
769     GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__)
770 #define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \
771     GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__)
772 #define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \
773     GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__)
774 #define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \
775     GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__)
776 
777 #define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
778     GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__)
779 #define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
780     GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__)
781 #define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
782     GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__)
783 #define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
784     GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__)
785 #define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
786     GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__)
787 #define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
788     GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__)
789 #define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
790     GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__)
791 #define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
792     GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__)
793 #define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
794     GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__)
795 #define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
796     GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__)
797 #define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
798     GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__)
799 
800 #define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
801     GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__)
802 #define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
803     GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__)
804 #define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
805     GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__)
806 #define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
807     GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__)
808 #define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
809     GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__)
810 #define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
811     GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__)
812 #define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
813     GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__)
814 #define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
815     GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__)
816 #define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
817     GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__)
818 #define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
819     GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__)
820 #define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
821     GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__)
822 
823 // A MockFunction<F> class has one mock method whose type is F.  It is
824 // useful when you just want your test code to emit some messages and
825 // have Google Mock verify the right messages are sent (and perhaps at
826 // the right times).  For example, if you are exercising code:
827 //
828 //   Foo(1);
829 //   Foo(2);
830 //   Foo(3);
831 //
832 // and want to verify that Foo(1) and Foo(3) both invoke
833 // mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:
834 //
835 // TEST(FooTest, InvokesBarCorrectly) {
836 //   MyMock mock;
837 //   MockFunction<void(string check_point_name)> check;
838 //   {
839 //     InSequence s;
840 //
841 //     EXPECT_CALL(mock, Bar("a"));
842 //     EXPECT_CALL(check, Call("1"));
843 //     EXPECT_CALL(check, Call("2"));
844 //     EXPECT_CALL(mock, Bar("a"));
845 //   }
846 //   Foo(1);
847 //   check.Call("1");
848 //   Foo(2);
849 //   check.Call("2");
850 //   Foo(3);
851 // }
852 //
853 // The expectation spec says that the first Bar("a") must happen
854 // before check point "1", the second Bar("a") must happen after check
855 // point "2", and nothing should happen between the two check
856 // points. The explicit check points make it easy to tell which
857 // Bar("a") is called by which call to Foo().
858 template <typename F>
859 class MockFunction;
860 
861 template <typename R>
862 class MockFunction<R()> {
863  public:
MockFunction()864   MockFunction() {}
865 
866   MOCK_METHOD0_T(Call, R());
867 
868  private:
869   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
870 };
871 
872 template <typename R, typename A0>
873 class MockFunction<R(A0)> {
874  public:
MockFunction()875   MockFunction() {}
876 
877   MOCK_METHOD1_T(Call, R(A0));
878 
879  private:
880   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
881 };
882 
883 template <typename R, typename A0, typename A1>
884 class MockFunction<R(A0, A1)> {
885  public:
MockFunction()886   MockFunction() {}
887 
888   MOCK_METHOD2_T(Call, R(A0, A1));
889 
890  private:
891   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
892 };
893 
894 template <typename R, typename A0, typename A1, typename A2>
895 class MockFunction<R(A0, A1, A2)> {
896  public:
MockFunction()897   MockFunction() {}
898 
899   MOCK_METHOD3_T(Call, R(A0, A1, A2));
900 
901  private:
902   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
903 };
904 
905 template <typename R, typename A0, typename A1, typename A2, typename A3>
906 class MockFunction<R(A0, A1, A2, A3)> {
907  public:
MockFunction()908   MockFunction() {}
909 
910   MOCK_METHOD4_T(Call, R(A0, A1, A2, A3));
911 
912  private:
913   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
914 };
915 
916 template <typename R, typename A0, typename A1, typename A2, typename A3,
917     typename A4>
918 class MockFunction<R(A0, A1, A2, A3, A4)> {
919  public:
MockFunction()920   MockFunction() {}
921 
922   MOCK_METHOD5_T(Call, R(A0, A1, A2, A3, A4));
923 
924  private:
925   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
926 };
927 
928 template <typename R, typename A0, typename A1, typename A2, typename A3,
929     typename A4, typename A5>
930 class MockFunction<R(A0, A1, A2, A3, A4, A5)> {
931  public:
MockFunction()932   MockFunction() {}
933 
934   MOCK_METHOD6_T(Call, R(A0, A1, A2, A3, A4, A5));
935 
936  private:
937   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
938 };
939 
940 template <typename R, typename A0, typename A1, typename A2, typename A3,
941     typename A4, typename A5, typename A6>
942 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> {
943  public:
MockFunction()944   MockFunction() {}
945 
946   MOCK_METHOD7_T(Call, R(A0, A1, A2, A3, A4, A5, A6));
947 
948  private:
949   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
950 };
951 
952 template <typename R, typename A0, typename A1, typename A2, typename A3,
953     typename A4, typename A5, typename A6, typename A7>
954 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> {
955  public:
MockFunction()956   MockFunction() {}
957 
958   MOCK_METHOD8_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7));
959 
960  private:
961   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
962 };
963 
964 template <typename R, typename A0, typename A1, typename A2, typename A3,
965     typename A4, typename A5, typename A6, typename A7, typename A8>
966 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> {
967  public:
MockFunction()968   MockFunction() {}
969 
970   MOCK_METHOD9_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8));
971 
972  private:
973   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
974 };
975 
976 template <typename R, typename A0, typename A1, typename A2, typename A3,
977     typename A4, typename A5, typename A6, typename A7, typename A8,
978     typename A9>
979 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
980  public:
MockFunction()981   MockFunction() {}
982 
983   MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));
984 
985  private:
986   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
987 };
988 
989 }  // namespace testing
990 
991 #endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
992