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


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:06:05