1 // This file was GENERATED by command:
2 // pump.py gmock-generated-actions.h.pump
3 // DO NOT EDIT BY HAND!!!
5 // Copyright 2007, Google Inc.
6 // All rights reserved.
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions are
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
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.
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.
35 // Google Mock - a framework for writing C++ mock classes.
37 // This file implements some commonly used variadic actions.
39 // GOOGLETEST_CM0002 DO NOT DELETE
41 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
42 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
47 #include "gmock/gmock-actions.h"
48 #include "gmock/internal/gmock-port.h"
53 // A macro from the ACTION* family (defined later in this file)
54 // defines an action that can be used in a mock function. Typically,
55 // these actions only care about a subset of the arguments of the mock
56 // function. For example, if such an action only uses the second
57 // argument, it can be used in any mock function that takes >= 2
58 // arguments where the type of the second argument is compatible.
60 // Therefore, the action implementation must be prepared to take more
61 // arguments than it needs. The ExcessiveArg type is used to
62 // represent those excessive arguments. In order to keep the compiler
63 // error messages tractable, we define it in the testing namespace
64 // instead of testing::internal. However, this is an INTERNAL TYPE
65 // and subject to change without notice, so a user MUST NOT USE THIS
67 struct ExcessiveArg {};
69 // A helper class needed for implementing the ACTION* macros.
70 template <typename Result, class Impl>
73 static Result Perform(Impl* impl, const ::std::tuple<>& args) {
74 return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),
75 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
76 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
80 template <typename A0>
81 static Result Perform(Impl* impl, const ::std::tuple<A0>& args) {
82 return impl->template gmock_PerformImpl<A0>(args, std::get<0>(args),
83 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
84 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
88 template <typename A0, typename A1>
89 static Result Perform(Impl* impl, const ::std::tuple<A0, A1>& args) {
90 return impl->template gmock_PerformImpl<A0, A1>(args, std::get<0>(args),
91 std::get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
92 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
96 template <typename A0, typename A1, typename A2>
97 static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2>& args) {
98 return impl->template gmock_PerformImpl<A0, A1, A2>(args,
99 std::get<0>(args), std::get<1>(args), std::get<2>(args),
100 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
101 ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
104 template <typename A0, typename A1, typename A2, typename A3>
105 static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3>& args) {
106 return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args,
107 std::get<0>(args), std::get<1>(args), std::get<2>(args),
108 std::get<3>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
109 ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
112 template <typename A0, typename A1, typename A2, typename A3, typename A4>
113 static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3,
115 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(args,
116 std::get<0>(args), std::get<1>(args), std::get<2>(args),
117 std::get<3>(args), std::get<4>(args), ExcessiveArg(), ExcessiveArg(),
118 ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
121 template <typename A0, typename A1, typename A2, typename A3, typename A4,
123 static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4,
125 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(args,
126 std::get<0>(args), std::get<1>(args), std::get<2>(args),
127 std::get<3>(args), std::get<4>(args), std::get<5>(args),
128 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
131 template <typename A0, typename A1, typename A2, typename A3, typename A4,
132 typename A5, typename A6>
133 static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5,
135 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(args,
136 std::get<0>(args), std::get<1>(args), std::get<2>(args),
137 std::get<3>(args), std::get<4>(args), std::get<5>(args),
138 std::get<6>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg());
141 template <typename A0, typename A1, typename A2, typename A3, typename A4,
142 typename A5, typename A6, typename A7>
143 static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5,
145 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6,
146 A7>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args),
147 std::get<3>(args), std::get<4>(args), std::get<5>(args),
148 std::get<6>(args), std::get<7>(args), ExcessiveArg(), ExcessiveArg());
151 template <typename A0, typename A1, typename A2, typename A3, typename A4,
152 typename A5, typename A6, typename A7, typename A8>
153 static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5,
155 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7,
156 A8>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args),
157 std::get<3>(args), std::get<4>(args), std::get<5>(args),
158 std::get<6>(args), std::get<7>(args), std::get<8>(args),
162 template <typename A0, typename A1, typename A2, typename A3, typename A4,
163 typename A5, typename A6, typename A7, typename A8, typename A9>
164 static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5,
165 A6, A7, A8, A9>& args) {
166 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8,
167 A9>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args),
168 std::get<3>(args), std::get<4>(args), std::get<5>(args),
169 std::get<6>(args), std::get<7>(args), std::get<8>(args),
174 } // namespace internal
175 } // namespace testing
177 // The ACTION* family of macros can be used in a namespace scope to
178 // define custom actions easily. The syntax:
180 // ACTION(name) { statements; }
182 // will define an action with the given name that executes the
183 // statements. The value returned by the statements will be used as
184 // the return value of the action. Inside the statements, you can
185 // refer to the K-th (0-based) argument of the mock function by
186 // 'argK', and refer to its type by 'argK_type'. For example:
188 // ACTION(IncrementArg1) {
189 // arg1_type temp = arg1;
193 // allows you to write
195 // ...WillOnce(IncrementArg1());
197 // You can also refer to the entire argument tuple and its type by
198 // 'args' and 'args_type', and refer to the mock function type and its
199 // return type by 'function_type' and 'return_type'.
201 // Note that you don't need to specify the types of the mock function
202 // arguments. However rest assured that your code is still type-safe:
203 // you'll get a compiler error if *arg1 doesn't support the ++
204 // operator, or if the type of ++(*arg1) isn't compatible with the
205 // mock function's return type, for example.
207 // Sometimes you'll want to parameterize the action. For that you can use
210 // ACTION_P(name, param_name) { statements; }
214 // ACTION_P(Add, n) { return arg0 + n; }
216 // will allow you to write:
218 // ...WillOnce(Add(5));
220 // Note that you don't need to provide the type of the parameter
221 // either. If you need to reference the type of a parameter named
222 // 'foo', you can write 'foo_type'. For example, in the body of
223 // ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
226 // We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support
227 // multi-parameter actions.
229 // For the purpose of typing, you can view
231 // ACTION_Pk(Foo, p1, ..., pk) { ... }
235 // template <typename p1_type, ..., typename pk_type>
236 // FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }
238 // In particular, you can provide the template type arguments
239 // explicitly when invoking Foo(), as in Foo<long, bool>(5, false);
240 // although usually you can rely on the compiler to infer the types
241 // for you automatically. You can assign the result of expression
242 // Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,
243 // pk_type>. This can be useful when composing actions.
245 // You can also overload actions with different numbers of parameters:
247 // ACTION_P(Plus, a) { ... }
248 // ACTION_P2(Plus, a, b) { ... }
250 // While it's tempting to always use the ACTION* macros when defining
251 // a new action, you should also consider implementing ActionInterface
252 // or using MakePolymorphicAction() instead, especially if you need to
253 // use the action a lot. While these approaches require more work,
254 // they give you more control on the types of the mock function
255 // arguments and the action parameters, which in general leads to
256 // better compiler error messages that pay off in the long run. They
257 // also allow overloading actions based on parameter types (as opposed
258 // to just based on the number of parameters).
262 // ACTION*() can only be used in a namespace scope as templates cannot be
263 // declared inside of a local class.
264 // Users can, however, define any local functors (e.g. a lambda) that
265 // can be used as actions.
269 // To learn more about using these macros, please search for 'ACTION' on
270 // https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md
272 // An internal macro needed for implementing ACTION*().
273 #define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
274 const args_type& args GTEST_ATTRIBUTE_UNUSED_, \
275 const arg0_type& arg0 GTEST_ATTRIBUTE_UNUSED_, \
276 const arg1_type& arg1 GTEST_ATTRIBUTE_UNUSED_, \
277 const arg2_type& arg2 GTEST_ATTRIBUTE_UNUSED_, \
278 const arg3_type& arg3 GTEST_ATTRIBUTE_UNUSED_, \
279 const arg4_type& arg4 GTEST_ATTRIBUTE_UNUSED_, \
280 const arg5_type& arg5 GTEST_ATTRIBUTE_UNUSED_, \
281 const arg6_type& arg6 GTEST_ATTRIBUTE_UNUSED_, \
282 const arg7_type& arg7 GTEST_ATTRIBUTE_UNUSED_, \
283 const arg8_type& arg8 GTEST_ATTRIBUTE_UNUSED_, \
284 const arg9_type& arg9 GTEST_ATTRIBUTE_UNUSED_
286 // Sometimes you want to give an action explicit template parameters
287 // that cannot be inferred from its value parameters. ACTION() and
288 // ACTION_P*() don't support that. ACTION_TEMPLATE() remedies that
289 // and can be viewed as an extension to ACTION() and ACTION_P*().
293 // ACTION_TEMPLATE(ActionName,
294 // HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
295 // AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
297 // defines an action template that takes m explicit template
298 // parameters and n value parameters. name_i is the name of the i-th
299 // template parameter, and kind_i specifies whether it's a typename,
300 // an integral constant, or a template. p_i is the name of the i-th
305 // // DuplicateArg<k, T>(output) converts the k-th argument of the mock
306 // // function to type T and copies it to *output.
307 // ACTION_TEMPLATE(DuplicateArg,
308 // HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
309 // AND_1_VALUE_PARAMS(output)) {
310 // *output = T(::std::get<k>(args));
314 // EXPECT_CALL(mock, Foo(_, _))
315 // .WillOnce(DuplicateArg<1, unsigned char>(&n));
317 // To create an instance of an action template, write:
319 // ActionName<t1, ..., t_m>(v1, ..., v_n)
321 // where the ts are the template arguments and the vs are the value
322 // arguments. The value argument types are inferred by the compiler.
323 // If you want to explicitly specify the value argument types, you can
324 // provide additional template arguments:
326 // ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
328 // where u_i is the desired type of v_i.
330 // ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the
331 // number of value parameters, but not on the number of template
332 // parameters. Without the restriction, the meaning of the following
335 // OverloadedAction<int, bool>(x);
337 // Are we using a single-template-parameter action where 'bool' refers
338 // to the type of x, or are we using a two-template-parameter action
339 // where the compiler is asked to infer the type of x?
341 // Implementation notes:
343 // GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and
344 // GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for
345 // implementing ACTION_TEMPLATE. The main trick we use is to create
346 // new macro invocations when expanding a macro. For example, we have
348 // #define ACTION_TEMPLATE(name, template_params, value_params)
349 // ... GMOCK_INTERNAL_DECL_##template_params ...
351 // which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)
354 // ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...
356 // Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the
357 // preprocessor will continue to expand it to
359 // ... typename T ...
361 // This technique conforms to the C++ standard and is portable. It
362 // allows us to implement action templates using O(N) code, where N is
363 // the maximum number of template/value parameters supported. Without
364 // using it, we'd have to devote O(N^2) amount of code to implement all
365 // combinations of m and n.
367 // Declares the template parameters.
368 #define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0
369 #define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
370 name1) kind0 name0, kind1 name1
371 #define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
372 kind2, name2) kind0 name0, kind1 name1, kind2 name2
373 #define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
374 kind2, name2, kind3, name3) kind0 name0, kind1 name1, kind2 name2, \
376 #define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
377 kind2, name2, kind3, name3, kind4, name4) kind0 name0, kind1 name1, \
378 kind2 name2, kind3 name3, kind4 name4
379 #define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
380 kind2, name2, kind3, name3, kind4, name4, kind5, name5) kind0 name0, \
381 kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5
382 #define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
383 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
384 name6) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
385 kind5 name5, kind6 name6
386 #define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
387 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
388 kind7, name7) kind0 name0, kind1 name1, kind2 name2, kind3 name3, \
389 kind4 name4, kind5 name5, kind6 name6, kind7 name7
390 #define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
391 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
392 kind7, name7, kind8, name8) kind0 name0, kind1 name1, kind2 name2, \
393 kind3 name3, kind4 name4, kind5 name5, kind6 name6, kind7 name7, \
395 #define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
396 name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
397 name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \
398 kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \
399 kind6 name6, kind7 name7, kind8 name8, kind9 name9
401 // Lists the template parameters.
402 #define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0
403 #define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
405 #define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
406 kind2, name2) name0, name1, name2
407 #define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
408 kind2, name2, kind3, name3) name0, name1, name2, name3
409 #define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
410 kind2, name2, kind3, name3, kind4, name4) name0, name1, name2, name3, \
412 #define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
413 kind2, name2, kind3, name3, kind4, name4, kind5, name5) name0, name1, \
414 name2, name3, name4, name5
415 #define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
416 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
417 name6) name0, name1, name2, name3, name4, name5, name6
418 #define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
419 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
420 kind7, name7) name0, name1, name2, name3, name4, name5, name6, name7
421 #define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
422 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
423 kind7, name7, kind8, name8) name0, name1, name2, name3, name4, name5, \
425 #define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
426 name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
427 name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \
428 name3, name4, name5, name6, name7, name8, name9
430 // Declares the types of value parameters.
431 #define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
432 #define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type
433 #define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) , \
434 typename p0##_type, typename p1##_type
435 #define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , \
436 typename p0##_type, typename p1##_type, typename p2##_type
437 #define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
438 typename p0##_type, typename p1##_type, typename p2##_type, \
440 #define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
441 typename p0##_type, typename p1##_type, typename p2##_type, \
442 typename p3##_type, typename p4##_type
443 #define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
444 typename p0##_type, typename p1##_type, typename p2##_type, \
445 typename p3##_type, typename p4##_type, typename p5##_type
446 #define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
447 p6) , typename p0##_type, typename p1##_type, typename p2##_type, \
448 typename p3##_type, typename p4##_type, typename p5##_type, \
450 #define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
451 p6, p7) , typename p0##_type, typename p1##_type, typename p2##_type, \
452 typename p3##_type, typename p4##_type, typename p5##_type, \
453 typename p6##_type, typename p7##_type
454 #define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
455 p6, p7, p8) , typename p0##_type, typename p1##_type, typename p2##_type, \
456 typename p3##_type, typename p4##_type, typename p5##_type, \
457 typename p6##_type, typename p7##_type, typename p8##_type
458 #define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
459 p6, p7, p8, p9) , typename p0##_type, typename p1##_type, \
460 typename p2##_type, typename p3##_type, typename p4##_type, \
461 typename p5##_type, typename p6##_type, typename p7##_type, \
462 typename p8##_type, typename p9##_type
464 // Initializes the value parameters.
465 #define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\
467 #define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\
468 (p0##_type gmock_p0) : p0(::std::move(gmock_p0))
469 #define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\
470 (p0##_type gmock_p0, p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \
471 p1(::std::move(gmock_p1))
472 #define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\
473 (p0##_type gmock_p0, p1##_type gmock_p1, \
474 p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \
475 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2))
476 #define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\
477 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
478 p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \
479 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
480 p3(::std::move(gmock_p3))
481 #define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\
482 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
483 p3##_type gmock_p3, p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \
484 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
485 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4))
486 #define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\
487 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
488 p3##_type gmock_p3, p4##_type gmock_p4, \
489 p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \
490 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
491 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
492 p5(::std::move(gmock_p5))
493 #define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\
494 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
495 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
496 p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \
497 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
498 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
499 p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6))
500 #define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\
501 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
502 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
503 p6##_type gmock_p6, p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \
504 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
505 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
506 p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
507 p7(::std::move(gmock_p7))
508 #define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
510 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
511 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
512 p6##_type gmock_p6, p7##_type gmock_p7, \
513 p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \
514 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
515 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
516 p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
517 p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8))
518 #define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
520 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
521 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
522 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
523 p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \
524 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
525 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
526 p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
527 p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \
528 p9(::std::move(gmock_p9))
530 // Declares the fields for storing the value parameters.
531 #define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
532 #define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0;
533 #define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0; \
535 #define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0; \
536 p1##_type p1; p2##_type p2;
537 #define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0; \
538 p1##_type p1; p2##_type p2; p3##_type p3;
539 #define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
540 p4) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4;
541 #define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
542 p5) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
544 #define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
545 p6) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
546 p5##_type p5; p6##_type p6;
547 #define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
548 p7) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
549 p5##_type p5; p6##_type p6; p7##_type p7;
550 #define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
551 p7, p8) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
552 p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8;
553 #define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
554 p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
555 p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \
558 // Lists the value parameters.
559 #define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
560 #define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0
561 #define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1
562 #define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2
563 #define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3
564 #define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) p0, p1, \
566 #define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) p0, \
568 #define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
569 p6) p0, p1, p2, p3, p4, p5, p6
570 #define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
571 p7) p0, p1, p2, p3, p4, p5, p6, p7
572 #define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
573 p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8
574 #define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
575 p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9
577 // Lists the value parameter types.
578 #define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
579 #define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type
580 #define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) , p0##_type, \
582 #define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , p0##_type, \
584 #define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
585 p0##_type, p1##_type, p2##_type, p3##_type
586 #define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
587 p0##_type, p1##_type, p2##_type, p3##_type, p4##_type
588 #define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
589 p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type
590 #define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
591 p6) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \
593 #define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
594 p6, p7) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
595 p5##_type, p6##_type, p7##_type
596 #define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
597 p6, p7, p8) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
598 p5##_type, p6##_type, p7##_type, p8##_type
599 #define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
600 p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
601 p5##_type, p6##_type, p7##_type, p8##_type, p9##_type
603 // Declares the value parameters.
604 #define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
605 #define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0
606 #define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0, \
608 #define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0, \
609 p1##_type p1, p2##_type p2
610 #define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0, \
611 p1##_type p1, p2##_type p2, p3##_type p3
612 #define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
613 p4) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4
614 #define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
615 p5) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
617 #define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
618 p6) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
619 p5##_type p5, p6##_type p6
620 #define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
621 p7) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
622 p5##_type p5, p6##_type p6, p7##_type p7
623 #define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
624 p7, p8) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
625 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8
626 #define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
627 p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
628 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
631 // The suffix of the class template implementing the action template.
632 #define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
633 #define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P
634 #define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2
635 #define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3
636 #define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4
637 #define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5
638 #define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6
639 #define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7
640 #define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
642 #define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
644 #define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
647 // The name of the class template implementing the action template.
648 #define GMOCK_ACTION_CLASS_(name, value_params)\
649 GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
651 #define ACTION_TEMPLATE(name, template_params, value_params)\
652 template <GMOCK_INTERNAL_DECL_##template_params\
653 GMOCK_INTERNAL_DECL_TYPE_##value_params>\
654 class GMOCK_ACTION_CLASS_(name, value_params) {\
656 explicit GMOCK_ACTION_CLASS_(name, value_params)\
657 GMOCK_INTERNAL_INIT_##value_params {}\
658 template <typename F>\
659 class gmock_Impl : public ::testing::ActionInterface<F> {\
661 typedef F function_type;\
662 typedef typename ::testing::internal::Function<F>::Result return_type;\
663 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
665 explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\
666 virtual return_type Perform(const args_type& args) {\
667 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
668 Perform(this, args);\
670 template <typename arg0_type, typename arg1_type, typename arg2_type, \
671 typename arg3_type, typename arg4_type, typename arg5_type, \
672 typename arg6_type, typename arg7_type, typename arg8_type, \
674 return_type gmock_PerformImpl(const args_type& args, \
675 const arg0_type& arg0, const arg1_type& arg1, \
676 const arg2_type& arg2, const arg3_type& arg3, \
677 const arg4_type& arg4, const arg5_type& arg5, \
678 const arg6_type& arg6, const arg7_type& arg7, \
679 const arg8_type& arg8, const arg9_type& arg9) const;\
680 GMOCK_INTERNAL_DEFN_##value_params\
682 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
684 template <typename F> operator ::testing::Action<F>() const {\
685 return ::testing::Action<F>(\
686 new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
688 GMOCK_INTERNAL_DEFN_##value_params\
690 GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
692 template <GMOCK_INTERNAL_DECL_##template_params\
693 GMOCK_INTERNAL_DECL_TYPE_##value_params>\
694 inline GMOCK_ACTION_CLASS_(name, value_params)<\
695 GMOCK_INTERNAL_LIST_##template_params\
696 GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\
697 GMOCK_INTERNAL_DECL_##value_params) {\
698 return GMOCK_ACTION_CLASS_(name, value_params)<\
699 GMOCK_INTERNAL_LIST_##template_params\
700 GMOCK_INTERNAL_LIST_TYPE_##value_params>(\
701 GMOCK_INTERNAL_LIST_##value_params);\
703 template <GMOCK_INTERNAL_DECL_##template_params\
704 GMOCK_INTERNAL_DECL_TYPE_##value_params>\
705 template <typename F>\
706 template <typename arg0_type, typename arg1_type, typename arg2_type, \
707 typename arg3_type, typename arg4_type, typename arg5_type, \
708 typename arg6_type, typename arg7_type, typename arg8_type, \
710 typename ::testing::internal::Function<F>::Result\
711 GMOCK_ACTION_CLASS_(name, value_params)<\
712 GMOCK_INTERNAL_LIST_##template_params\
713 GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\
715 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
717 #define ACTION(name)\
718 class name##Action {\
721 template <typename F>\
722 class gmock_Impl : public ::testing::ActionInterface<F> {\
724 typedef F function_type;\
725 typedef typename ::testing::internal::Function<F>::Result return_type;\
726 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
729 virtual return_type Perform(const args_type& args) {\
730 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
731 Perform(this, args);\
733 template <typename arg0_type, typename arg1_type, typename arg2_type, \
734 typename arg3_type, typename arg4_type, typename arg5_type, \
735 typename arg6_type, typename arg7_type, typename arg8_type, \
737 return_type gmock_PerformImpl(const args_type& args, \
738 const arg0_type& arg0, const arg1_type& arg1, \
739 const arg2_type& arg2, const arg3_type& arg3, \
740 const arg4_type& arg4, const arg5_type& arg5, \
741 const arg6_type& arg6, const arg7_type& arg7, \
742 const arg8_type& arg8, const arg9_type& arg9) const;\
744 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
746 template <typename F> operator ::testing::Action<F>() const {\
747 return ::testing::Action<F>(new gmock_Impl<F>());\
750 GTEST_DISALLOW_ASSIGN_(name##Action);\
752 inline name##Action name() {\
753 return name##Action();\
755 template <typename F>\
756 template <typename arg0_type, typename arg1_type, typename arg2_type, \
757 typename arg3_type, typename arg4_type, typename arg5_type, \
758 typename arg6_type, typename arg7_type, typename arg8_type, \
760 typename ::testing::internal::Function<F>::Result\
761 name##Action::gmock_Impl<F>::gmock_PerformImpl(\
762 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
764 #define ACTION_P(name, p0)\
765 template <typename p0##_type>\
766 class name##ActionP {\
768 explicit name##ActionP(p0##_type gmock_p0) : \
769 p0(::std::forward<p0##_type>(gmock_p0)) {}\
770 template <typename F>\
771 class gmock_Impl : public ::testing::ActionInterface<F> {\
773 typedef F function_type;\
774 typedef typename ::testing::internal::Function<F>::Result return_type;\
775 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
777 explicit gmock_Impl(p0##_type gmock_p0) : \
778 p0(::std::forward<p0##_type>(gmock_p0)) {}\
779 virtual return_type Perform(const args_type& args) {\
780 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
781 Perform(this, args);\
783 template <typename arg0_type, typename arg1_type, typename arg2_type, \
784 typename arg3_type, typename arg4_type, typename arg5_type, \
785 typename arg6_type, typename arg7_type, typename arg8_type, \
787 return_type gmock_PerformImpl(const args_type& args, \
788 const arg0_type& arg0, const arg1_type& arg1, \
789 const arg2_type& arg2, const arg3_type& arg3, \
790 const arg4_type& arg4, const arg5_type& arg5, \
791 const arg6_type& arg6, const arg7_type& arg7, \
792 const arg8_type& arg8, const arg9_type& arg9) const;\
795 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
797 template <typename F> operator ::testing::Action<F>() const {\
798 return ::testing::Action<F>(new gmock_Impl<F>(p0));\
802 GTEST_DISALLOW_ASSIGN_(name##ActionP);\
804 template <typename p0##_type>\
805 inline name##ActionP<p0##_type> name(p0##_type p0) {\
806 return name##ActionP<p0##_type>(p0);\
808 template <typename p0##_type>\
809 template <typename F>\
810 template <typename arg0_type, typename arg1_type, typename arg2_type, \
811 typename arg3_type, typename arg4_type, typename arg5_type, \
812 typename arg6_type, typename arg7_type, typename arg8_type, \
814 typename ::testing::internal::Function<F>::Result\
815 name##ActionP<p0##_type>::gmock_Impl<F>::gmock_PerformImpl(\
816 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
818 #define ACTION_P2(name, p0, p1)\
819 template <typename p0##_type, typename p1##_type>\
820 class name##ActionP2 {\
822 name##ActionP2(p0##_type gmock_p0, \
823 p1##_type gmock_p1) : p0(::std::forward<p0##_type>(gmock_p0)), \
824 p1(::std::forward<p1##_type>(gmock_p1)) {}\
825 template <typename F>\
826 class gmock_Impl : public ::testing::ActionInterface<F> {\
828 typedef F function_type;\
829 typedef typename ::testing::internal::Function<F>::Result return_type;\
830 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
832 gmock_Impl(p0##_type gmock_p0, \
833 p1##_type gmock_p1) : p0(::std::forward<p0##_type>(gmock_p0)), \
834 p1(::std::forward<p1##_type>(gmock_p1)) {}\
835 virtual return_type Perform(const args_type& args) {\
836 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
837 Perform(this, args);\
839 template <typename arg0_type, typename arg1_type, typename arg2_type, \
840 typename arg3_type, typename arg4_type, typename arg5_type, \
841 typename arg6_type, typename arg7_type, typename arg8_type, \
843 return_type gmock_PerformImpl(const args_type& args, \
844 const arg0_type& arg0, const arg1_type& arg1, \
845 const arg2_type& arg2, const arg3_type& arg3, \
846 const arg4_type& arg4, const arg5_type& arg5, \
847 const arg6_type& arg6, const arg7_type& arg7, \
848 const arg8_type& arg8, const arg9_type& arg9) const;\
852 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
854 template <typename F> operator ::testing::Action<F>() const {\
855 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1));\
860 GTEST_DISALLOW_ASSIGN_(name##ActionP2);\
862 template <typename p0##_type, typename p1##_type>\
863 inline name##ActionP2<p0##_type, p1##_type> name(p0##_type p0, \
865 return name##ActionP2<p0##_type, p1##_type>(p0, p1);\
867 template <typename p0##_type, typename p1##_type>\
868 template <typename F>\
869 template <typename arg0_type, typename arg1_type, typename arg2_type, \
870 typename arg3_type, typename arg4_type, typename arg5_type, \
871 typename arg6_type, typename arg7_type, typename arg8_type, \
873 typename ::testing::internal::Function<F>::Result\
874 name##ActionP2<p0##_type, p1##_type>::gmock_Impl<F>::gmock_PerformImpl(\
875 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
877 #define ACTION_P3(name, p0, p1, p2)\
878 template <typename p0##_type, typename p1##_type, typename p2##_type>\
879 class name##ActionP3 {\
881 name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \
882 p2##_type gmock_p2) : p0(::std::forward<p0##_type>(gmock_p0)), \
883 p1(::std::forward<p1##_type>(gmock_p1)), \
884 p2(::std::forward<p2##_type>(gmock_p2)) {}\
885 template <typename F>\
886 class gmock_Impl : public ::testing::ActionInterface<F> {\
888 typedef F function_type;\
889 typedef typename ::testing::internal::Function<F>::Result return_type;\
890 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
892 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \
893 p2##_type gmock_p2) : p0(::std::forward<p0##_type>(gmock_p0)), \
894 p1(::std::forward<p1##_type>(gmock_p1)), \
895 p2(::std::forward<p2##_type>(gmock_p2)) {}\
896 virtual return_type Perform(const args_type& args) {\
897 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
898 Perform(this, args);\
900 template <typename arg0_type, typename arg1_type, typename arg2_type, \
901 typename arg3_type, typename arg4_type, typename arg5_type, \
902 typename arg6_type, typename arg7_type, typename arg8_type, \
904 return_type gmock_PerformImpl(const args_type& args, \
905 const arg0_type& arg0, const arg1_type& arg1, \
906 const arg2_type& arg2, const arg3_type& arg3, \
907 const arg4_type& arg4, const arg5_type& arg5, \
908 const arg6_type& arg6, const arg7_type& arg7, \
909 const arg8_type& arg8, const arg9_type& arg9) const;\
914 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
916 template <typename F> operator ::testing::Action<F>() const {\
917 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2));\
923 GTEST_DISALLOW_ASSIGN_(name##ActionP3);\
925 template <typename p0##_type, typename p1##_type, typename p2##_type>\
926 inline name##ActionP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
927 p1##_type p1, p2##_type p2) {\
928 return name##ActionP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
930 template <typename p0##_type, typename p1##_type, typename p2##_type>\
931 template <typename F>\
932 template <typename arg0_type, typename arg1_type, typename arg2_type, \
933 typename arg3_type, typename arg4_type, typename arg5_type, \
934 typename arg6_type, typename arg7_type, typename arg8_type, \
936 typename ::testing::internal::Function<F>::Result\
937 name##ActionP3<p0##_type, p1##_type, \
938 p2##_type>::gmock_Impl<F>::gmock_PerformImpl(\
939 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
941 #define ACTION_P4(name, p0, p1, p2, p3)\
942 template <typename p0##_type, typename p1##_type, typename p2##_type, \
944 class name##ActionP4 {\
946 name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \
947 p2##_type gmock_p2, \
948 p3##_type gmock_p3) : p0(::std::forward<p0##_type>(gmock_p0)), \
949 p1(::std::forward<p1##_type>(gmock_p1)), \
950 p2(::std::forward<p2##_type>(gmock_p2)), \
951 p3(::std::forward<p3##_type>(gmock_p3)) {}\
952 template <typename F>\
953 class gmock_Impl : public ::testing::ActionInterface<F> {\
955 typedef F function_type;\
956 typedef typename ::testing::internal::Function<F>::Result return_type;\
957 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
959 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
960 p3##_type gmock_p3) : p0(::std::forward<p0##_type>(gmock_p0)), \
961 p1(::std::forward<p1##_type>(gmock_p1)), \
962 p2(::std::forward<p2##_type>(gmock_p2)), \
963 p3(::std::forward<p3##_type>(gmock_p3)) {}\
964 virtual return_type Perform(const args_type& args) {\
965 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
966 Perform(this, args);\
968 template <typename arg0_type, typename arg1_type, typename arg2_type, \
969 typename arg3_type, typename arg4_type, typename arg5_type, \
970 typename arg6_type, typename arg7_type, typename arg8_type, \
972 return_type gmock_PerformImpl(const args_type& args, \
973 const arg0_type& arg0, const arg1_type& arg1, \
974 const arg2_type& arg2, const arg3_type& arg3, \
975 const arg4_type& arg4, const arg5_type& arg5, \
976 const arg6_type& arg6, const arg7_type& arg7, \
977 const arg8_type& arg8, const arg9_type& arg9) const;\
983 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
985 template <typename F> operator ::testing::Action<F>() const {\
986 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3));\
993 GTEST_DISALLOW_ASSIGN_(name##ActionP4);\
995 template <typename p0##_type, typename p1##_type, typename p2##_type, \
997 inline name##ActionP4<p0##_type, p1##_type, p2##_type, \
998 p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1000 return name##ActionP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, p1, \
1003 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1004 typename p3##_type>\
1005 template <typename F>\
1006 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1007 typename arg3_type, typename arg4_type, typename arg5_type, \
1008 typename arg6_type, typename arg7_type, typename arg8_type, \
1009 typename arg9_type>\
1010 typename ::testing::internal::Function<F>::Result\
1011 name##ActionP4<p0##_type, p1##_type, p2##_type, \
1012 p3##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1013 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1015 #define ACTION_P5(name, p0, p1, p2, p3, p4)\
1016 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1017 typename p3##_type, typename p4##_type>\
1018 class name##ActionP5 {\
1020 name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \
1021 p2##_type gmock_p2, p3##_type gmock_p3, \
1022 p4##_type gmock_p4) : p0(::std::forward<p0##_type>(gmock_p0)), \
1023 p1(::std::forward<p1##_type>(gmock_p1)), \
1024 p2(::std::forward<p2##_type>(gmock_p2)), \
1025 p3(::std::forward<p3##_type>(gmock_p3)), \
1026 p4(::std::forward<p4##_type>(gmock_p4)) {}\
1027 template <typename F>\
1028 class gmock_Impl : public ::testing::ActionInterface<F> {\
1030 typedef F function_type;\
1031 typedef typename ::testing::internal::Function<F>::Result return_type;\
1032 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1034 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1035 p3##_type gmock_p3, \
1036 p4##_type gmock_p4) : p0(::std::forward<p0##_type>(gmock_p0)), \
1037 p1(::std::forward<p1##_type>(gmock_p1)), \
1038 p2(::std::forward<p2##_type>(gmock_p2)), \
1039 p3(::std::forward<p3##_type>(gmock_p3)), \
1040 p4(::std::forward<p4##_type>(gmock_p4)) {}\
1041 virtual return_type Perform(const args_type& args) {\
1042 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1043 Perform(this, args);\
1045 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1046 typename arg3_type, typename arg4_type, typename arg5_type, \
1047 typename arg6_type, typename arg7_type, typename arg8_type, \
1048 typename arg9_type>\
1049 return_type gmock_PerformImpl(const args_type& args, \
1050 const arg0_type& arg0, const arg1_type& arg1, \
1051 const arg2_type& arg2, const arg3_type& arg3, \
1052 const arg4_type& arg4, const arg5_type& arg5, \
1053 const arg6_type& arg6, const arg7_type& arg7, \
1054 const arg8_type& arg8, const arg9_type& arg9) const;\
1061 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1063 template <typename F> operator ::testing::Action<F>() const {\
1064 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4));\
1072 GTEST_DISALLOW_ASSIGN_(name##ActionP5);\
1074 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1075 typename p3##_type, typename p4##_type>\
1076 inline name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1077 p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1079 return name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1080 p4##_type>(p0, p1, p2, p3, p4);\
1082 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1083 typename p3##_type, typename p4##_type>\
1084 template <typename F>\
1085 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1086 typename arg3_type, typename arg4_type, typename arg5_type, \
1087 typename arg6_type, typename arg7_type, typename arg8_type, \
1088 typename arg9_type>\
1089 typename ::testing::internal::Function<F>::Result\
1090 name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1091 p4##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1092 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1094 #define ACTION_P6(name, p0, p1, p2, p3, p4, p5)\
1095 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1096 typename p3##_type, typename p4##_type, typename p5##_type>\
1097 class name##ActionP6 {\
1099 name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \
1100 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1101 p5##_type gmock_p5) : p0(::std::forward<p0##_type>(gmock_p0)), \
1102 p1(::std::forward<p1##_type>(gmock_p1)), \
1103 p2(::std::forward<p2##_type>(gmock_p2)), \
1104 p3(::std::forward<p3##_type>(gmock_p3)), \
1105 p4(::std::forward<p4##_type>(gmock_p4)), \
1106 p5(::std::forward<p5##_type>(gmock_p5)) {}\
1107 template <typename F>\
1108 class gmock_Impl : public ::testing::ActionInterface<F> {\
1110 typedef F function_type;\
1111 typedef typename ::testing::internal::Function<F>::Result return_type;\
1112 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1114 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1115 p3##_type gmock_p3, p4##_type gmock_p4, \
1116 p5##_type gmock_p5) : p0(::std::forward<p0##_type>(gmock_p0)), \
1117 p1(::std::forward<p1##_type>(gmock_p1)), \
1118 p2(::std::forward<p2##_type>(gmock_p2)), \
1119 p3(::std::forward<p3##_type>(gmock_p3)), \
1120 p4(::std::forward<p4##_type>(gmock_p4)), \
1121 p5(::std::forward<p5##_type>(gmock_p5)) {}\
1122 virtual return_type Perform(const args_type& args) {\
1123 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1124 Perform(this, args);\
1126 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1127 typename arg3_type, typename arg4_type, typename arg5_type, \
1128 typename arg6_type, typename arg7_type, typename arg8_type, \
1129 typename arg9_type>\
1130 return_type gmock_PerformImpl(const args_type& args, \
1131 const arg0_type& arg0, const arg1_type& arg1, \
1132 const arg2_type& arg2, const arg3_type& arg3, \
1133 const arg4_type& arg4, const arg5_type& arg5, \
1134 const arg6_type& arg6, const arg7_type& arg7, \
1135 const arg8_type& arg8, const arg9_type& arg9) const;\
1143 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1145 template <typename F> operator ::testing::Action<F>() const {\
1146 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5));\
1155 GTEST_DISALLOW_ASSIGN_(name##ActionP6);\
1157 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1158 typename p3##_type, typename p4##_type, typename p5##_type>\
1159 inline name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1160 p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1161 p3##_type p3, p4##_type p4, p5##_type p5) {\
1162 return name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1163 p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
1165 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1166 typename p3##_type, typename p4##_type, typename p5##_type>\
1167 template <typename F>\
1168 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1169 typename arg3_type, typename arg4_type, typename arg5_type, \
1170 typename arg6_type, typename arg7_type, typename arg8_type, \
1171 typename arg9_type>\
1172 typename ::testing::internal::Function<F>::Result\
1173 name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1174 p5##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1175 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1177 #define ACTION_P7(name, p0, p1, p2, p3, p4, p5, p6)\
1178 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1179 typename p3##_type, typename p4##_type, typename p5##_type, \
1180 typename p6##_type>\
1181 class name##ActionP7 {\
1183 name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \
1184 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1185 p5##_type gmock_p5, \
1186 p6##_type gmock_p6) : p0(::std::forward<p0##_type>(gmock_p0)), \
1187 p1(::std::forward<p1##_type>(gmock_p1)), \
1188 p2(::std::forward<p2##_type>(gmock_p2)), \
1189 p3(::std::forward<p3##_type>(gmock_p3)), \
1190 p4(::std::forward<p4##_type>(gmock_p4)), \
1191 p5(::std::forward<p5##_type>(gmock_p5)), \
1192 p6(::std::forward<p6##_type>(gmock_p6)) {}\
1193 template <typename F>\
1194 class gmock_Impl : public ::testing::ActionInterface<F> {\
1196 typedef F function_type;\
1197 typedef typename ::testing::internal::Function<F>::Result return_type;\
1198 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1200 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1201 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1202 p6##_type gmock_p6) : p0(::std::forward<p0##_type>(gmock_p0)), \
1203 p1(::std::forward<p1##_type>(gmock_p1)), \
1204 p2(::std::forward<p2##_type>(gmock_p2)), \
1205 p3(::std::forward<p3##_type>(gmock_p3)), \
1206 p4(::std::forward<p4##_type>(gmock_p4)), \
1207 p5(::std::forward<p5##_type>(gmock_p5)), \
1208 p6(::std::forward<p6##_type>(gmock_p6)) {}\
1209 virtual return_type Perform(const args_type& args) {\
1210 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1211 Perform(this, args);\
1213 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1214 typename arg3_type, typename arg4_type, typename arg5_type, \
1215 typename arg6_type, typename arg7_type, typename arg8_type, \
1216 typename arg9_type>\
1217 return_type gmock_PerformImpl(const args_type& args, \
1218 const arg0_type& arg0, const arg1_type& arg1, \
1219 const arg2_type& arg2, const arg3_type& arg3, \
1220 const arg4_type& arg4, const arg5_type& arg5, \
1221 const arg6_type& arg6, const arg7_type& arg7, \
1222 const arg8_type& arg8, const arg9_type& arg9) const;\
1231 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1233 template <typename F> operator ::testing::Action<F>() const {\
1234 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
1245 GTEST_DISALLOW_ASSIGN_(name##ActionP7);\
1247 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1248 typename p3##_type, typename p4##_type, typename p5##_type, \
1249 typename p6##_type>\
1250 inline name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
1251 p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
1252 p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
1254 return name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
1255 p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
1257 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1258 typename p3##_type, typename p4##_type, typename p5##_type, \
1259 typename p6##_type>\
1260 template <typename F>\
1261 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1262 typename arg3_type, typename arg4_type, typename arg5_type, \
1263 typename arg6_type, typename arg7_type, typename arg8_type, \
1264 typename arg9_type>\
1265 typename ::testing::internal::Function<F>::Result\
1266 name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1267 p5##_type, p6##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1268 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1270 #define ACTION_P8(name, p0, p1, p2, p3, p4, p5, p6, p7)\
1271 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1272 typename p3##_type, typename p4##_type, typename p5##_type, \
1273 typename p6##_type, typename p7##_type>\
1274 class name##ActionP8 {\
1276 name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \
1277 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1278 p5##_type gmock_p5, p6##_type gmock_p6, \
1279 p7##_type gmock_p7) : p0(::std::forward<p0##_type>(gmock_p0)), \
1280 p1(::std::forward<p1##_type>(gmock_p1)), \
1281 p2(::std::forward<p2##_type>(gmock_p2)), \
1282 p3(::std::forward<p3##_type>(gmock_p3)), \
1283 p4(::std::forward<p4##_type>(gmock_p4)), \
1284 p5(::std::forward<p5##_type>(gmock_p5)), \
1285 p6(::std::forward<p6##_type>(gmock_p6)), \
1286 p7(::std::forward<p7##_type>(gmock_p7)) {}\
1287 template <typename F>\
1288 class gmock_Impl : public ::testing::ActionInterface<F> {\
1290 typedef F function_type;\
1291 typedef typename ::testing::internal::Function<F>::Result return_type;\
1292 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1294 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1295 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1296 p6##_type gmock_p6, \
1297 p7##_type gmock_p7) : p0(::std::forward<p0##_type>(gmock_p0)), \
1298 p1(::std::forward<p1##_type>(gmock_p1)), \
1299 p2(::std::forward<p2##_type>(gmock_p2)), \
1300 p3(::std::forward<p3##_type>(gmock_p3)), \
1301 p4(::std::forward<p4##_type>(gmock_p4)), \
1302 p5(::std::forward<p5##_type>(gmock_p5)), \
1303 p6(::std::forward<p6##_type>(gmock_p6)), \
1304 p7(::std::forward<p7##_type>(gmock_p7)) {}\
1305 virtual return_type Perform(const args_type& args) {\
1306 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1307 Perform(this, args);\
1309 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1310 typename arg3_type, typename arg4_type, typename arg5_type, \
1311 typename arg6_type, typename arg7_type, typename arg8_type, \
1312 typename arg9_type>\
1313 return_type gmock_PerformImpl(const args_type& args, \
1314 const arg0_type& arg0, const arg1_type& arg1, \
1315 const arg2_type& arg2, const arg3_type& arg3, \
1316 const arg4_type& arg4, const arg5_type& arg5, \
1317 const arg6_type& arg6, const arg7_type& arg7, \
1318 const arg8_type& arg8, const arg9_type& arg9) const;\
1328 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1330 template <typename F> operator ::testing::Action<F>() const {\
1331 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
1343 GTEST_DISALLOW_ASSIGN_(name##ActionP8);\
1345 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1346 typename p3##_type, typename p4##_type, typename p5##_type, \
1347 typename p6##_type, typename p7##_type>\
1348 inline name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
1349 p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
1350 p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
1351 p6##_type p6, p7##_type p7) {\
1352 return name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
1353 p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
1356 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1357 typename p3##_type, typename p4##_type, typename p5##_type, \
1358 typename p6##_type, typename p7##_type>\
1359 template <typename F>\
1360 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1361 typename arg3_type, typename arg4_type, typename arg5_type, \
1362 typename arg6_type, typename arg7_type, typename arg8_type, \
1363 typename arg9_type>\
1364 typename ::testing::internal::Function<F>::Result\
1365 name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1366 p5##_type, p6##_type, \
1367 p7##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1368 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1370 #define ACTION_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8)\
1371 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1372 typename p3##_type, typename p4##_type, typename p5##_type, \
1373 typename p6##_type, typename p7##_type, typename p8##_type>\
1374 class name##ActionP9 {\
1376 name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \
1377 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1378 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
1379 p8##_type gmock_p8) : p0(::std::forward<p0##_type>(gmock_p0)), \
1380 p1(::std::forward<p1##_type>(gmock_p1)), \
1381 p2(::std::forward<p2##_type>(gmock_p2)), \
1382 p3(::std::forward<p3##_type>(gmock_p3)), \
1383 p4(::std::forward<p4##_type>(gmock_p4)), \
1384 p5(::std::forward<p5##_type>(gmock_p5)), \
1385 p6(::std::forward<p6##_type>(gmock_p6)), \
1386 p7(::std::forward<p7##_type>(gmock_p7)), \
1387 p8(::std::forward<p8##_type>(gmock_p8)) {}\
1388 template <typename F>\
1389 class gmock_Impl : public ::testing::ActionInterface<F> {\
1391 typedef F function_type;\
1392 typedef typename ::testing::internal::Function<F>::Result return_type;\
1393 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1395 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1396 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1397 p6##_type gmock_p6, p7##_type gmock_p7, \
1398 p8##_type gmock_p8) : p0(::std::forward<p0##_type>(gmock_p0)), \
1399 p1(::std::forward<p1##_type>(gmock_p1)), \
1400 p2(::std::forward<p2##_type>(gmock_p2)), \
1401 p3(::std::forward<p3##_type>(gmock_p3)), \
1402 p4(::std::forward<p4##_type>(gmock_p4)), \
1403 p5(::std::forward<p5##_type>(gmock_p5)), \
1404 p6(::std::forward<p6##_type>(gmock_p6)), \
1405 p7(::std::forward<p7##_type>(gmock_p7)), \
1406 p8(::std::forward<p8##_type>(gmock_p8)) {}\
1407 virtual return_type Perform(const args_type& args) {\
1408 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1409 Perform(this, args);\
1411 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1412 typename arg3_type, typename arg4_type, typename arg5_type, \
1413 typename arg6_type, typename arg7_type, typename arg8_type, \
1414 typename arg9_type>\
1415 return_type gmock_PerformImpl(const args_type& args, \
1416 const arg0_type& arg0, const arg1_type& arg1, \
1417 const arg2_type& arg2, const arg3_type& arg3, \
1418 const arg4_type& arg4, const arg5_type& arg5, \
1419 const arg6_type& arg6, const arg7_type& arg7, \
1420 const arg8_type& arg8, const arg9_type& arg9) const;\
1431 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1433 template <typename F> operator ::testing::Action<F>() const {\
1434 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
1447 GTEST_DISALLOW_ASSIGN_(name##ActionP9);\
1449 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1450 typename p3##_type, typename p4##_type, typename p5##_type, \
1451 typename p6##_type, typename p7##_type, typename p8##_type>\
1452 inline name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
1453 p4##_type, p5##_type, p6##_type, p7##_type, \
1454 p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1455 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
1457 return name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
1458 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
1459 p3, p4, p5, p6, p7, p8);\
1461 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1462 typename p3##_type, typename p4##_type, typename p5##_type, \
1463 typename p6##_type, typename p7##_type, typename p8##_type>\
1464 template <typename F>\
1465 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1466 typename arg3_type, typename arg4_type, typename arg5_type, \
1467 typename arg6_type, typename arg7_type, typename arg8_type, \
1468 typename arg9_type>\
1469 typename ::testing::internal::Function<F>::Result\
1470 name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1471 p5##_type, p6##_type, p7##_type, \
1472 p8##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1473 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1475 #define ACTION_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)\
1476 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1477 typename p3##_type, typename p4##_type, typename p5##_type, \
1478 typename p6##_type, typename p7##_type, typename p8##_type, \
1479 typename p9##_type>\
1480 class name##ActionP10 {\
1482 name##ActionP10(p0##_type gmock_p0, p1##_type gmock_p1, \
1483 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1484 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
1485 p8##_type gmock_p8, \
1486 p9##_type gmock_p9) : p0(::std::forward<p0##_type>(gmock_p0)), \
1487 p1(::std::forward<p1##_type>(gmock_p1)), \
1488 p2(::std::forward<p2##_type>(gmock_p2)), \
1489 p3(::std::forward<p3##_type>(gmock_p3)), \
1490 p4(::std::forward<p4##_type>(gmock_p4)), \
1491 p5(::std::forward<p5##_type>(gmock_p5)), \
1492 p6(::std::forward<p6##_type>(gmock_p6)), \
1493 p7(::std::forward<p7##_type>(gmock_p7)), \
1494 p8(::std::forward<p8##_type>(gmock_p8)), \
1495 p9(::std::forward<p9##_type>(gmock_p9)) {}\
1496 template <typename F>\
1497 class gmock_Impl : public ::testing::ActionInterface<F> {\
1499 typedef F function_type;\
1500 typedef typename ::testing::internal::Function<F>::Result return_type;\
1501 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1503 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1504 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1505 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
1506 p9##_type gmock_p9) : p0(::std::forward<p0##_type>(gmock_p0)), \
1507 p1(::std::forward<p1##_type>(gmock_p1)), \
1508 p2(::std::forward<p2##_type>(gmock_p2)), \
1509 p3(::std::forward<p3##_type>(gmock_p3)), \
1510 p4(::std::forward<p4##_type>(gmock_p4)), \
1511 p5(::std::forward<p5##_type>(gmock_p5)), \
1512 p6(::std::forward<p6##_type>(gmock_p6)), \
1513 p7(::std::forward<p7##_type>(gmock_p7)), \
1514 p8(::std::forward<p8##_type>(gmock_p8)), \
1515 p9(::std::forward<p9##_type>(gmock_p9)) {}\
1516 virtual return_type Perform(const args_type& args) {\
1517 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1518 Perform(this, args);\
1520 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1521 typename arg3_type, typename arg4_type, typename arg5_type, \
1522 typename arg6_type, typename arg7_type, typename arg8_type, \
1523 typename arg9_type>\
1524 return_type gmock_PerformImpl(const args_type& args, \
1525 const arg0_type& arg0, const arg1_type& arg1, \
1526 const arg2_type& arg2, const arg3_type& arg3, \
1527 const arg4_type& arg4, const arg5_type& arg5, \
1528 const arg6_type& arg6, const arg7_type& arg7, \
1529 const arg8_type& arg8, const arg9_type& arg9) const;\
1541 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1543 template <typename F> operator ::testing::Action<F>() const {\
1544 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
1558 GTEST_DISALLOW_ASSIGN_(name##ActionP10);\
1560 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1561 typename p3##_type, typename p4##_type, typename p5##_type, \
1562 typename p6##_type, typename p7##_type, typename p8##_type, \
1563 typename p9##_type>\
1564 inline name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
1565 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
1566 p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1567 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
1569 return name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
1570 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
1571 p1, p2, p3, p4, p5, p6, p7, p8, p9);\
1573 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1574 typename p3##_type, typename p4##_type, typename p5##_type, \
1575 typename p6##_type, typename p7##_type, typename p8##_type, \
1576 typename p9##_type>\
1577 template <typename F>\
1578 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1579 typename arg3_type, typename arg4_type, typename arg5_type, \
1580 typename arg6_type, typename arg7_type, typename arg8_type, \
1581 typename arg9_type>\
1582 typename ::testing::internal::Function<F>::Result\
1583 name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1584 p5##_type, p6##_type, p7##_type, p8##_type, \
1585 p9##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1586 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1591 // The ACTION*() macros trigger warning C4100 (unreferenced formal
1592 // parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
1593 // the macro definition, as the warnings are generated when the macro
1594 // is expanded and macro expansion cannot contain #pragma. Therefore
1595 // we suppress them here.
1597 # pragma warning(push)
1598 # pragma warning(disable:4100)
1601 // Various overloads for InvokeArgument<N>().
1603 // The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th
1604 // (0-based) argument, which must be a k-ary callable, of the mock
1605 // function, with arguments a1, a2, ..., a_k.
1609 // 1. The arguments are passed by value by default. If you need to
1610 // pass an argument by reference, wrap it inside ByRef(). For
1613 // InvokeArgument<1>(5, string("Hello"), ByRef(foo))
1615 // passes 5 and string("Hello") by value, and passes foo by
1618 // 2. If the callable takes an argument by reference but ByRef() is
1619 // not used, it will receive the reference to a copy of the value,
1620 // instead of the original value. For example, when the 0-th
1621 // argument of the mock function takes a const string&, the action
1623 // InvokeArgument<0>(string("Hello"))
1625 // makes a copy of the temporary string("Hello") object and passes a
1626 // reference of the copy, instead of the original temporary object,
1627 // to the callable. This makes it easy for a user to define an
1628 // InvokeArgument action from temporary values and have it performed
1631 namespace internal {
1632 namespace invoke_argument {
1634 // Appears in InvokeArgumentAdl's argument list to help avoid
1635 // accidental calls to user functions of the same name.
1638 // InvokeArgumentAdl - a helper for InvokeArgument.
1639 // The basic overloads are provided here for generic functors.
1640 // Overloads for other custom-callables are provided in the
1641 // internal/custom/callback-actions.h header.
1643 template <typename R, typename F>
1644 R InvokeArgumentAdl(AdlTag, F f) {
1647 template <typename R, typename F, typename A1>
1648 R InvokeArgumentAdl(AdlTag, F f, A1 a1) {
1651 template <typename R, typename F, typename A1, typename A2>
1652 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2) {
1655 template <typename R, typename F, typename A1, typename A2, typename A3>
1656 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3) {
1657 return f(a1, a2, a3);
1659 template <typename R, typename F, typename A1, typename A2, typename A3,
1661 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4) {
1662 return f(a1, a2, a3, a4);
1664 template <typename R, typename F, typename A1, typename A2, typename A3,
1665 typename A4, typename A5>
1666 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
1667 return f(a1, a2, a3, a4, a5);
1669 template <typename R, typename F, typename A1, typename A2, typename A3,
1670 typename A4, typename A5, typename A6>
1671 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
1672 return f(a1, a2, a3, a4, a5, a6);
1674 template <typename R, typename F, typename A1, typename A2, typename A3,
1675 typename A4, typename A5, typename A6, typename A7>
1676 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
1678 return f(a1, a2, a3, a4, a5, a6, a7);
1680 template <typename R, typename F, typename A1, typename A2, typename A3,
1681 typename A4, typename A5, typename A6, typename A7, typename A8>
1682 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
1684 return f(a1, a2, a3, a4, a5, a6, a7, a8);
1686 template <typename R, typename F, typename A1, typename A2, typename A3,
1687 typename A4, typename A5, typename A6, typename A7, typename A8,
1689 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
1690 A7 a7, A8 a8, A9 a9) {
1691 return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
1693 template <typename R, typename F, typename A1, typename A2, typename A3,
1694 typename A4, typename A5, typename A6, typename A7, typename A8,
1695 typename A9, typename A10>
1696 R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
1697 A7 a7, A8 a8, A9 a9, A10 a10) {
1698 return f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
1700 } // namespace invoke_argument
1701 } // namespace internal
1703 ACTION_TEMPLATE(InvokeArgument,
1704 HAS_1_TEMPLATE_PARAMS(int, k),
1705 AND_0_VALUE_PARAMS()) {
1706 using internal::invoke_argument::InvokeArgumentAdl;
1707 return InvokeArgumentAdl<return_type>(
1708 internal::invoke_argument::AdlTag(),
1709 ::std::get<k>(args));
1712 ACTION_TEMPLATE(InvokeArgument,
1713 HAS_1_TEMPLATE_PARAMS(int, k),
1714 AND_1_VALUE_PARAMS(p0)) {
1715 using internal::invoke_argument::InvokeArgumentAdl;
1716 return InvokeArgumentAdl<return_type>(
1717 internal::invoke_argument::AdlTag(),
1718 ::std::get<k>(args), p0);
1721 ACTION_TEMPLATE(InvokeArgument,
1722 HAS_1_TEMPLATE_PARAMS(int, k),
1723 AND_2_VALUE_PARAMS(p0, p1)) {
1724 using internal::invoke_argument::InvokeArgumentAdl;
1725 return InvokeArgumentAdl<return_type>(
1726 internal::invoke_argument::AdlTag(),
1727 ::std::get<k>(args), p0, p1);
1730 ACTION_TEMPLATE(InvokeArgument,
1731 HAS_1_TEMPLATE_PARAMS(int, k),
1732 AND_3_VALUE_PARAMS(p0, p1, p2)) {
1733 using internal::invoke_argument::InvokeArgumentAdl;
1734 return InvokeArgumentAdl<return_type>(
1735 internal::invoke_argument::AdlTag(),
1736 ::std::get<k>(args), p0, p1, p2);
1739 ACTION_TEMPLATE(InvokeArgument,
1740 HAS_1_TEMPLATE_PARAMS(int, k),
1741 AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
1742 using internal::invoke_argument::InvokeArgumentAdl;
1743 return InvokeArgumentAdl<return_type>(
1744 internal::invoke_argument::AdlTag(),
1745 ::std::get<k>(args), p0, p1, p2, p3);
1748 ACTION_TEMPLATE(InvokeArgument,
1749 HAS_1_TEMPLATE_PARAMS(int, k),
1750 AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
1751 using internal::invoke_argument::InvokeArgumentAdl;
1752 return InvokeArgumentAdl<return_type>(
1753 internal::invoke_argument::AdlTag(),
1754 ::std::get<k>(args), p0, p1, p2, p3, p4);
1757 ACTION_TEMPLATE(InvokeArgument,
1758 HAS_1_TEMPLATE_PARAMS(int, k),
1759 AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
1760 using internal::invoke_argument::InvokeArgumentAdl;
1761 return InvokeArgumentAdl<return_type>(
1762 internal::invoke_argument::AdlTag(),
1763 ::std::get<k>(args), p0, p1, p2, p3, p4, p5);
1766 ACTION_TEMPLATE(InvokeArgument,
1767 HAS_1_TEMPLATE_PARAMS(int, k),
1768 AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
1769 using internal::invoke_argument::InvokeArgumentAdl;
1770 return InvokeArgumentAdl<return_type>(
1771 internal::invoke_argument::AdlTag(),
1772 ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6);
1775 ACTION_TEMPLATE(InvokeArgument,
1776 HAS_1_TEMPLATE_PARAMS(int, k),
1777 AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
1778 using internal::invoke_argument::InvokeArgumentAdl;
1779 return InvokeArgumentAdl<return_type>(
1780 internal::invoke_argument::AdlTag(),
1781 ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7);
1784 ACTION_TEMPLATE(InvokeArgument,
1785 HAS_1_TEMPLATE_PARAMS(int, k),
1786 AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
1787 using internal::invoke_argument::InvokeArgumentAdl;
1788 return InvokeArgumentAdl<return_type>(
1789 internal::invoke_argument::AdlTag(),
1790 ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8);
1793 ACTION_TEMPLATE(InvokeArgument,
1794 HAS_1_TEMPLATE_PARAMS(int, k),
1795 AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
1796 using internal::invoke_argument::InvokeArgumentAdl;
1797 return InvokeArgumentAdl<return_type>(
1798 internal::invoke_argument::AdlTag(),
1799 ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1802 // Various overloads for ReturnNew<T>().
1804 // The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
1805 // instance of type T, constructed on the heap with constructor arguments
1806 // a1, a2, ..., and a_k. The caller assumes ownership of the returned value.
1807 ACTION_TEMPLATE(ReturnNew,
1808 HAS_1_TEMPLATE_PARAMS(typename, T),
1809 AND_0_VALUE_PARAMS()) {
1813 ACTION_TEMPLATE(ReturnNew,
1814 HAS_1_TEMPLATE_PARAMS(typename, T),
1815 AND_1_VALUE_PARAMS(p0)) {
1819 ACTION_TEMPLATE(ReturnNew,
1820 HAS_1_TEMPLATE_PARAMS(typename, T),
1821 AND_2_VALUE_PARAMS(p0, p1)) {
1822 return new T(p0, p1);
1825 ACTION_TEMPLATE(ReturnNew,
1826 HAS_1_TEMPLATE_PARAMS(typename, T),
1827 AND_3_VALUE_PARAMS(p0, p1, p2)) {
1828 return new T(p0, p1, p2);
1831 ACTION_TEMPLATE(ReturnNew,
1832 HAS_1_TEMPLATE_PARAMS(typename, T),
1833 AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
1834 return new T(p0, p1, p2, p3);
1837 ACTION_TEMPLATE(ReturnNew,
1838 HAS_1_TEMPLATE_PARAMS(typename, T),
1839 AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
1840 return new T(p0, p1, p2, p3, p4);
1843 ACTION_TEMPLATE(ReturnNew,
1844 HAS_1_TEMPLATE_PARAMS(typename, T),
1845 AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
1846 return new T(p0, p1, p2, p3, p4, p5);
1849 ACTION_TEMPLATE(ReturnNew,
1850 HAS_1_TEMPLATE_PARAMS(typename, T),
1851 AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
1852 return new T(p0, p1, p2, p3, p4, p5, p6);
1855 ACTION_TEMPLATE(ReturnNew,
1856 HAS_1_TEMPLATE_PARAMS(typename, T),
1857 AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
1858 return new T(p0, p1, p2, p3, p4, p5, p6, p7);
1861 ACTION_TEMPLATE(ReturnNew,
1862 HAS_1_TEMPLATE_PARAMS(typename, T),
1863 AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
1864 return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8);
1867 ACTION_TEMPLATE(ReturnNew,
1868 HAS_1_TEMPLATE_PARAMS(typename, T),
1869 AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
1870 return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1874 # pragma warning(pop)
1877 } // namespace testing
1879 // Include any custom callback actions added by the local installation.
1880 // We must include this header at the end to make sure it can use the
1881 // declarations from this file.
1882 #include "gmock/internal/custom/gmock-generated-actions.h"
1884 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_