blob: cd3a102c31ce63fc84d26eb06c700ab84b2189eb [file] [log] [blame]
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001// This file was GENERATED by command:
2// pump.py gmock-generated-actions.h.pump
3// DO NOT EDIT BY HAND!!!
shiqiane35fdd92008-12-10 05:08:54 +00004
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 some commonly used variadic actions.
39
Gennadiy Civil984cba32018-07-27 11:15:08 -040040// GOOGLETEST_CM0002 DO NOT DELETE
41
shiqiane35fdd92008-12-10 05:08:54 +000042#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
43#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
44
zhanyong.wan53e08c42010-09-14 05:38:21 +000045#include "gmock/gmock-actions.h"
46#include "gmock/internal/gmock-port.h"
shiqiane35fdd92008-12-10 05:08:54 +000047
48namespace testing {
49namespace internal {
50
51// InvokeHelper<F> knows how to unpack an N-tuple and invoke an N-ary
Gennadiy Civile1071eb2018-04-10 15:57:16 -040052// function, method, or callback with the unpacked values, where F is
53// a function type that takes N arguments.
shiqiane35fdd92008-12-10 05:08:54 +000054template <typename Result, typename ArgumentTuple>
55class InvokeHelper;
56
57template <typename R>
kosakbd018832014-04-02 20:30:00 +000058class InvokeHelper<R, ::testing::tuple<> > {
shiqiane35fdd92008-12-10 05:08:54 +000059 public:
60 template <typename Function>
kosakbd018832014-04-02 20:30:00 +000061 static R Invoke(Function function, const ::testing::tuple<>&) {
62 return function();
shiqiane35fdd92008-12-10 05:08:54 +000063 }
64
65 template <class Class, typename MethodPtr>
66 static R InvokeMethod(Class* obj_ptr,
67 MethodPtr method_ptr,
kosakbd018832014-04-02 20:30:00 +000068 const ::testing::tuple<>&) {
69 return (obj_ptr->*method_ptr)();
shiqiane35fdd92008-12-10 05:08:54 +000070 }
Gennadiy Civile1071eb2018-04-10 15:57:16 -040071
72 template <typename CallbackType>
73 static R InvokeCallback(CallbackType* callback,
74 const ::testing::tuple<>&) {
75 return callback->Run();
76 }
shiqiane35fdd92008-12-10 05:08:54 +000077};
78
79template <typename R, typename A1>
kosakbd018832014-04-02 20:30:00 +000080class InvokeHelper<R, ::testing::tuple<A1> > {
shiqiane35fdd92008-12-10 05:08:54 +000081 public:
82 template <typename Function>
kosakbd018832014-04-02 20:30:00 +000083 static R Invoke(Function function, const ::testing::tuple<A1>& args) {
84 return function(get<0>(args));
shiqiane35fdd92008-12-10 05:08:54 +000085 }
86
87 template <class Class, typename MethodPtr>
88 static R InvokeMethod(Class* obj_ptr,
89 MethodPtr method_ptr,
kosakbd018832014-04-02 20:30:00 +000090 const ::testing::tuple<A1>& args) {
91 return (obj_ptr->*method_ptr)(get<0>(args));
shiqiane35fdd92008-12-10 05:08:54 +000092 }
Gennadiy Civile1071eb2018-04-10 15:57:16 -040093
94 template <typename CallbackType>
95 static R InvokeCallback(CallbackType* callback,
96 const ::testing::tuple<A1>& args) {
97 return callback->Run(get<0>(args));
98 }
shiqiane35fdd92008-12-10 05:08:54 +000099};
100
101template <typename R, typename A1, typename A2>
kosakbd018832014-04-02 20:30:00 +0000102class InvokeHelper<R, ::testing::tuple<A1, A2> > {
shiqiane35fdd92008-12-10 05:08:54 +0000103 public:
104 template <typename Function>
kosakbd018832014-04-02 20:30:00 +0000105 static R Invoke(Function function, const ::testing::tuple<A1, A2>& args) {
106 return function(get<0>(args), get<1>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000107 }
108
109 template <class Class, typename MethodPtr>
110 static R InvokeMethod(Class* obj_ptr,
111 MethodPtr method_ptr,
kosakbd018832014-04-02 20:30:00 +0000112 const ::testing::tuple<A1, A2>& args) {
113 return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000114 }
Gennadiy Civile1071eb2018-04-10 15:57:16 -0400115
116 template <typename CallbackType>
117 static R InvokeCallback(CallbackType* callback,
118 const ::testing::tuple<A1, A2>& args) {
119 return callback->Run(get<0>(args), get<1>(args));
120 }
shiqiane35fdd92008-12-10 05:08:54 +0000121};
122
123template <typename R, typename A1, typename A2, typename A3>
kosakbd018832014-04-02 20:30:00 +0000124class InvokeHelper<R, ::testing::tuple<A1, A2, A3> > {
shiqiane35fdd92008-12-10 05:08:54 +0000125 public:
126 template <typename Function>
kosakbd018832014-04-02 20:30:00 +0000127 static R Invoke(Function function, const ::testing::tuple<A1, A2, A3>& args) {
128 return function(get<0>(args), get<1>(args), get<2>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000129 }
130
131 template <class Class, typename MethodPtr>
132 static R InvokeMethod(Class* obj_ptr,
133 MethodPtr method_ptr,
kosakbd018832014-04-02 20:30:00 +0000134 const ::testing::tuple<A1, A2, A3>& args) {
135 return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
136 get<2>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000137 }
Gennadiy Civile1071eb2018-04-10 15:57:16 -0400138
139 template <typename CallbackType>
140 static R InvokeCallback(CallbackType* callback,
141 const ::testing::tuple<A1, A2, A3>& args) {
142 return callback->Run(get<0>(args), get<1>(args), get<2>(args));
143 }
shiqiane35fdd92008-12-10 05:08:54 +0000144};
145
146template <typename R, typename A1, typename A2, typename A3, typename A4>
kosakbd018832014-04-02 20:30:00 +0000147class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4> > {
shiqiane35fdd92008-12-10 05:08:54 +0000148 public:
149 template <typename Function>
kosakbd018832014-04-02 20:30:00 +0000150 static R Invoke(Function function, const ::testing::tuple<A1, A2, A3,
shiqiane35fdd92008-12-10 05:08:54 +0000151 A4>& args) {
kosakbd018832014-04-02 20:30:00 +0000152 return function(get<0>(args), get<1>(args), get<2>(args),
153 get<3>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000154 }
155
156 template <class Class, typename MethodPtr>
157 static R InvokeMethod(Class* obj_ptr,
158 MethodPtr method_ptr,
kosakbd018832014-04-02 20:30:00 +0000159 const ::testing::tuple<A1, A2, A3, A4>& args) {
160 return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
161 get<2>(args), get<3>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000162 }
Gennadiy Civile1071eb2018-04-10 15:57:16 -0400163
164 template <typename CallbackType>
165 static R InvokeCallback(CallbackType* callback,
166 const ::testing::tuple<A1, A2, A3, A4>& args) {
167 return callback->Run(get<0>(args), get<1>(args), get<2>(args),
168 get<3>(args));
169 }
shiqiane35fdd92008-12-10 05:08:54 +0000170};
171
172template <typename R, typename A1, typename A2, typename A3, typename A4,
173 typename A5>
kosakbd018832014-04-02 20:30:00 +0000174class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5> > {
shiqiane35fdd92008-12-10 05:08:54 +0000175 public:
176 template <typename Function>
kosakbd018832014-04-02 20:30:00 +0000177 static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4,
shiqiane35fdd92008-12-10 05:08:54 +0000178 A5>& args) {
kosakbd018832014-04-02 20:30:00 +0000179 return function(get<0>(args), get<1>(args), get<2>(args),
180 get<3>(args), get<4>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000181 }
182
183 template <class Class, typename MethodPtr>
184 static R InvokeMethod(Class* obj_ptr,
185 MethodPtr method_ptr,
kosakbd018832014-04-02 20:30:00 +0000186 const ::testing::tuple<A1, A2, A3, A4, A5>& args) {
187 return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
188 get<2>(args), get<3>(args), get<4>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000189 }
Gennadiy Civile1071eb2018-04-10 15:57:16 -0400190
191 template <typename CallbackType>
192 static R InvokeCallback(CallbackType* callback,
193 const ::testing::tuple<A1, A2, A3, A4, A5>& args) {
194 return callback->Run(get<0>(args), get<1>(args), get<2>(args),
195 get<3>(args), get<4>(args));
196 }
shiqiane35fdd92008-12-10 05:08:54 +0000197};
198
199template <typename R, typename A1, typename A2, typename A3, typename A4,
200 typename A5, typename A6>
kosakbd018832014-04-02 20:30:00 +0000201class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
shiqiane35fdd92008-12-10 05:08:54 +0000202 public:
203 template <typename Function>
kosakbd018832014-04-02 20:30:00 +0000204 static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
205 A6>& args) {
206 return function(get<0>(args), get<1>(args), get<2>(args),
207 get<3>(args), get<4>(args), get<5>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000208 }
209
210 template <class Class, typename MethodPtr>
211 static R InvokeMethod(Class* obj_ptr,
212 MethodPtr method_ptr,
kosakbd018832014-04-02 20:30:00 +0000213 const ::testing::tuple<A1, A2, A3, A4, A5, A6>& args) {
214 return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
215 get<2>(args), get<3>(args), get<4>(args), get<5>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000216 }
Gennadiy Civile1071eb2018-04-10 15:57:16 -0400217
Gennadiy Civilf2257352018-08-14 11:08:35 -0400218 // There is no InvokeCallback() for 6-tuples
shiqiane35fdd92008-12-10 05:08:54 +0000219};
220
221template <typename R, typename A1, typename A2, typename A3, typename A4,
222 typename A5, typename A6, typename A7>
kosakbd018832014-04-02 20:30:00 +0000223class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
shiqiane35fdd92008-12-10 05:08:54 +0000224 public:
225 template <typename Function>
kosakbd018832014-04-02 20:30:00 +0000226 static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
227 A6, A7>& args) {
228 return function(get<0>(args), get<1>(args), get<2>(args),
229 get<3>(args), get<4>(args), get<5>(args), get<6>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000230 }
231
232 template <class Class, typename MethodPtr>
233 static R InvokeMethod(Class* obj_ptr,
234 MethodPtr method_ptr,
kosakbd018832014-04-02 20:30:00 +0000235 const ::testing::tuple<A1, A2, A3, A4, A5, A6,
shiqiane35fdd92008-12-10 05:08:54 +0000236 A7>& args) {
kosakbd018832014-04-02 20:30:00 +0000237 return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
238 get<2>(args), get<3>(args), get<4>(args), get<5>(args),
239 get<6>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000240 }
Gennadiy Civile1071eb2018-04-10 15:57:16 -0400241
Gennadiy Civilf2257352018-08-14 11:08:35 -0400242 // There is no InvokeCallback() for 7-tuples
shiqiane35fdd92008-12-10 05:08:54 +0000243};
244
245template <typename R, typename A1, typename A2, typename A3, typename A4,
246 typename A5, typename A6, typename A7, typename A8>
kosakbd018832014-04-02 20:30:00 +0000247class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
shiqiane35fdd92008-12-10 05:08:54 +0000248 public:
249 template <typename Function>
kosakbd018832014-04-02 20:30:00 +0000250 static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
251 A6, A7, A8>& args) {
252 return function(get<0>(args), get<1>(args), get<2>(args),
253 get<3>(args), get<4>(args), get<5>(args), get<6>(args),
254 get<7>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000255 }
256
257 template <class Class, typename MethodPtr>
258 static R InvokeMethod(Class* obj_ptr,
259 MethodPtr method_ptr,
kosakbd018832014-04-02 20:30:00 +0000260 const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7,
shiqiane35fdd92008-12-10 05:08:54 +0000261 A8>& args) {
kosakbd018832014-04-02 20:30:00 +0000262 return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
263 get<2>(args), get<3>(args), get<4>(args), get<5>(args),
264 get<6>(args), get<7>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000265 }
Gennadiy Civile1071eb2018-04-10 15:57:16 -0400266
Gennadiy Civilf2257352018-08-14 11:08:35 -0400267 // There is no InvokeCallback() for 8-tuples
shiqiane35fdd92008-12-10 05:08:54 +0000268};
269
270template <typename R, typename A1, typename A2, typename A3, typename A4,
271 typename A5, typename A6, typename A7, typename A8, typename A9>
kosakbd018832014-04-02 20:30:00 +0000272class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
shiqiane35fdd92008-12-10 05:08:54 +0000273 public:
274 template <typename Function>
kosakbd018832014-04-02 20:30:00 +0000275 static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
276 A6, A7, A8, A9>& args) {
277 return function(get<0>(args), get<1>(args), get<2>(args),
278 get<3>(args), get<4>(args), get<5>(args), get<6>(args),
279 get<7>(args), get<8>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000280 }
281
282 template <class Class, typename MethodPtr>
283 static R InvokeMethod(Class* obj_ptr,
284 MethodPtr method_ptr,
kosakbd018832014-04-02 20:30:00 +0000285 const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
shiqiane35fdd92008-12-10 05:08:54 +0000286 A9>& args) {
kosakbd018832014-04-02 20:30:00 +0000287 return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
288 get<2>(args), get<3>(args), get<4>(args), get<5>(args),
289 get<6>(args), get<7>(args), get<8>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000290 }
Gennadiy Civile1071eb2018-04-10 15:57:16 -0400291
Gennadiy Civilf2257352018-08-14 11:08:35 -0400292 // There is no InvokeCallback() for 9-tuples
shiqiane35fdd92008-12-10 05:08:54 +0000293};
294
295template <typename R, typename A1, typename A2, typename A3, typename A4,
296 typename A5, typename A6, typename A7, typename A8, typename A9,
297 typename A10>
kosakbd018832014-04-02 20:30:00 +0000298class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
shiqiane35fdd92008-12-10 05:08:54 +0000299 A10> > {
300 public:
301 template <typename Function>
kosakbd018832014-04-02 20:30:00 +0000302 static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
303 A6, A7, A8, A9, A10>& args) {
304 return function(get<0>(args), get<1>(args), get<2>(args),
305 get<3>(args), get<4>(args), get<5>(args), get<6>(args),
306 get<7>(args), get<8>(args), get<9>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000307 }
308
309 template <class Class, typename MethodPtr>
310 static R InvokeMethod(Class* obj_ptr,
311 MethodPtr method_ptr,
kosakbd018832014-04-02 20:30:00 +0000312 const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
shiqiane35fdd92008-12-10 05:08:54 +0000313 A9, A10>& args) {
kosakbd018832014-04-02 20:30:00 +0000314 return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
315 get<2>(args), get<3>(args), get<4>(args), get<5>(args),
316 get<6>(args), get<7>(args), get<8>(args), get<9>(args));
shiqiane35fdd92008-12-10 05:08:54 +0000317 }
Gennadiy Civile1071eb2018-04-10 15:57:16 -0400318
Gennadiy Civilf2257352018-08-14 11:08:35 -0400319 // There is no InvokeCallback() for 10-tuples
Gennadiy Civile1071eb2018-04-10 15:57:16 -0400320};
321
322// Implements the Invoke(callback) action.
323template <typename CallbackType>
324class InvokeCallbackAction {
325 public:
326 // The c'tor takes ownership of the callback.
327 explicit InvokeCallbackAction(CallbackType* callback)
328 : callback_(callback) {
329 callback->CheckIsRepeatable(); // Makes sure the callback is permanent.
330 }
331
332 // This type conversion operator template allows Invoke(callback) to
333 // be used wherever the callback's type is compatible with that of
334 // the mock function, i.e. if the mock function's arguments can be
335 // implicitly converted to the callback's arguments and the
336 // callback's result can be implicitly converted to the mock
337 // function's result.
338 template <typename Result, typename ArgumentTuple>
339 Result Perform(const ArgumentTuple& args) const {
340 return InvokeHelper<Result, ArgumentTuple>::InvokeCallback(
341 callback_.get(), args);
342 }
343 private:
344 const linked_ptr<CallbackType> callback_;
shiqiane35fdd92008-12-10 05:08:54 +0000345};
346
shiqiane35fdd92008-12-10 05:08:54 +0000347// An INTERNAL macro for extracting the type of a tuple field. It's
348// subject to change without notice - DO NOT USE IN USER CODE!
zhanyong.wane0d051e2009-02-19 00:33:37 +0000349#define GMOCK_FIELD_(Tuple, N) \
kosakbd018832014-04-02 20:30:00 +0000350 typename ::testing::tuple_element<N, Tuple>::type
shiqiane35fdd92008-12-10 05:08:54 +0000351
352// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::type is the
353// type of an n-ary function whose i-th (1-based) argument type is the
354// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
355// type, and whose return type is Result. For example,
kosakbd018832014-04-02 20:30:00 +0000356// SelectArgs<int, ::testing::tuple<bool, char, double, long>, 0, 3>::type
shiqiane35fdd92008-12-10 05:08:54 +0000357// is int(bool, long).
358//
359// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
360// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
361// For example,
kosakbd018832014-04-02 20:30:00 +0000362// SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select(
363// ::testing::make_tuple(true, 'a', 2.5))
364// returns tuple (2.5, true).
shiqiane35fdd92008-12-10 05:08:54 +0000365//
366// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
367// in the range [0, 10]. Duplicates are allowed and they don't have
368// to be in an ascending or descending order.
369
370template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
371 int k4, int k5, int k6, int k7, int k8, int k9, int k10>
372class SelectArgs {
373 public:
zhanyong.wane0d051e2009-02-19 00:33:37 +0000374 typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
375 GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
376 GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
377 GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
378 GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9),
379 GMOCK_FIELD_(ArgumentTuple, k10));
shiqiane35fdd92008-12-10 05:08:54 +0000380 typedef typename Function<type>::ArgumentTuple SelectedArgs;
381 static SelectedArgs Select(const ArgumentTuple& args) {
shiqiane35fdd92008-12-10 05:08:54 +0000382 return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
383 get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
384 get<k8>(args), get<k9>(args), get<k10>(args));
385 }
386};
387
388template <typename Result, typename ArgumentTuple>
389class SelectArgs<Result, ArgumentTuple,
390 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
391 public:
392 typedef Result type();
393 typedef typename Function<type>::ArgumentTuple SelectedArgs;
zhanyong.wan3fbd2dd2009-03-26 19:06:45 +0000394 static SelectedArgs Select(const ArgumentTuple& /* args */) {
shiqiane35fdd92008-12-10 05:08:54 +0000395 return SelectedArgs();
396 }
397};
398
399template <typename Result, typename ArgumentTuple, int k1>
400class SelectArgs<Result, ArgumentTuple,
401 k1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
402 public:
zhanyong.wane0d051e2009-02-19 00:33:37 +0000403 typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1));
shiqiane35fdd92008-12-10 05:08:54 +0000404 typedef typename Function<type>::ArgumentTuple SelectedArgs;
405 static SelectedArgs Select(const ArgumentTuple& args) {
shiqiane35fdd92008-12-10 05:08:54 +0000406 return SelectedArgs(get<k1>(args));
407 }
408};
409
410template <typename Result, typename ArgumentTuple, int k1, int k2>
411class SelectArgs<Result, ArgumentTuple,
412 k1, k2, -1, -1, -1, -1, -1, -1, -1, -1> {
413 public:
zhanyong.wane0d051e2009-02-19 00:33:37 +0000414 typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
415 GMOCK_FIELD_(ArgumentTuple, k2));
shiqiane35fdd92008-12-10 05:08:54 +0000416 typedef typename Function<type>::ArgumentTuple SelectedArgs;
417 static SelectedArgs Select(const ArgumentTuple& args) {
shiqiane35fdd92008-12-10 05:08:54 +0000418 return SelectedArgs(get<k1>(args), get<k2>(args));
419 }
420};
421
422template <typename Result, typename ArgumentTuple, int k1, int k2, int k3>
423class SelectArgs<Result, ArgumentTuple,
424 k1, k2, k3, -1, -1, -1, -1, -1, -1, -1> {
425 public:
zhanyong.wane0d051e2009-02-19 00:33:37 +0000426 typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
427 GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3));
shiqiane35fdd92008-12-10 05:08:54 +0000428 typedef typename Function<type>::ArgumentTuple SelectedArgs;
429 static SelectedArgs Select(const ArgumentTuple& args) {
shiqiane35fdd92008-12-10 05:08:54 +0000430 return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args));
431 }
432};
433
434template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
435 int k4>
436class SelectArgs<Result, ArgumentTuple,
437 k1, k2, k3, k4, -1, -1, -1, -1, -1, -1> {
438 public:
zhanyong.wane0d051e2009-02-19 00:33:37 +0000439 typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
440 GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
441 GMOCK_FIELD_(ArgumentTuple, k4));
shiqiane35fdd92008-12-10 05:08:54 +0000442 typedef typename Function<type>::ArgumentTuple SelectedArgs;
443 static SelectedArgs Select(const ArgumentTuple& args) {
shiqiane35fdd92008-12-10 05:08:54 +0000444 return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
445 get<k4>(args));
446 }
447};
448
449template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
450 int k4, int k5>
451class SelectArgs<Result, ArgumentTuple,
452 k1, k2, k3, k4, k5, -1, -1, -1, -1, -1> {
453 public:
zhanyong.wane0d051e2009-02-19 00:33:37 +0000454 typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
455 GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
456 GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5));
shiqiane35fdd92008-12-10 05:08:54 +0000457 typedef typename Function<type>::ArgumentTuple SelectedArgs;
458 static SelectedArgs Select(const ArgumentTuple& args) {
shiqiane35fdd92008-12-10 05:08:54 +0000459 return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
460 get<k4>(args), get<k5>(args));
461 }
462};
463
464template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
465 int k4, int k5, int k6>
466class SelectArgs<Result, ArgumentTuple,
467 k1, k2, k3, k4, k5, k6, -1, -1, -1, -1> {
468 public:
zhanyong.wane0d051e2009-02-19 00:33:37 +0000469 typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
470 GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
471 GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
472 GMOCK_FIELD_(ArgumentTuple, k6));
shiqiane35fdd92008-12-10 05:08:54 +0000473 typedef typename Function<type>::ArgumentTuple SelectedArgs;
474 static SelectedArgs Select(const ArgumentTuple& args) {
shiqiane35fdd92008-12-10 05:08:54 +0000475 return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
476 get<k4>(args), get<k5>(args), get<k6>(args));
477 }
478};
479
480template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
481 int k4, int k5, int k6, int k7>
482class SelectArgs<Result, ArgumentTuple,
483 k1, k2, k3, k4, k5, k6, k7, -1, -1, -1> {
484 public:
zhanyong.wane0d051e2009-02-19 00:33:37 +0000485 typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
486 GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
487 GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
488 GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7));
shiqiane35fdd92008-12-10 05:08:54 +0000489 typedef typename Function<type>::ArgumentTuple SelectedArgs;
490 static SelectedArgs Select(const ArgumentTuple& args) {
shiqiane35fdd92008-12-10 05:08:54 +0000491 return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
492 get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args));
493 }
494};
495
496template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
497 int k4, int k5, int k6, int k7, int k8>
498class SelectArgs<Result, ArgumentTuple,
499 k1, k2, k3, k4, k5, k6, k7, k8, -1, -1> {
500 public:
zhanyong.wane0d051e2009-02-19 00:33:37 +0000501 typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
502 GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
503 GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
504 GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
505 GMOCK_FIELD_(ArgumentTuple, k8));
shiqiane35fdd92008-12-10 05:08:54 +0000506 typedef typename Function<type>::ArgumentTuple SelectedArgs;
507 static SelectedArgs Select(const ArgumentTuple& args) {
shiqiane35fdd92008-12-10 05:08:54 +0000508 return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
509 get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
510 get<k8>(args));
511 }
512};
513
514template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
515 int k4, int k5, int k6, int k7, int k8, int k9>
516class SelectArgs<Result, ArgumentTuple,
517 k1, k2, k3, k4, k5, k6, k7, k8, k9, -1> {
518 public:
zhanyong.wane0d051e2009-02-19 00:33:37 +0000519 typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
520 GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
521 GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
522 GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
523 GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9));
shiqiane35fdd92008-12-10 05:08:54 +0000524 typedef typename Function<type>::ArgumentTuple SelectedArgs;
525 static SelectedArgs Select(const ArgumentTuple& args) {
shiqiane35fdd92008-12-10 05:08:54 +0000526 return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
527 get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
528 get<k8>(args), get<k9>(args));
529 }
530};
531
zhanyong.wane0d051e2009-02-19 00:33:37 +0000532#undef GMOCK_FIELD_
shiqiane35fdd92008-12-10 05:08:54 +0000533
534// Implements the WithArgs action.
535template <typename InnerAction, int k1 = -1, int k2 = -1, int k3 = -1,
536 int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
537 int k9 = -1, int k10 = -1>
538class WithArgsAction {
539 public:
540 explicit WithArgsAction(const InnerAction& action) : action_(action) {}
541
542 template <typename F>
zhanyong.wan38ca64d2009-02-19 22:30:22 +0000543 operator Action<F>() const { return MakeAction(new Impl<F>(action_)); }
544
545 private:
546 template <typename F>
547 class Impl : public ActionInterface<F> {
548 public:
shiqiane35fdd92008-12-10 05:08:54 +0000549 typedef typename Function<F>::Result Result;
550 typedef typename Function<F>::ArgumentTuple ArgumentTuple;
zhanyong.wan38ca64d2009-02-19 22:30:22 +0000551
552 explicit Impl(const InnerAction& action) : action_(action) {}
553
554 virtual Result Perform(const ArgumentTuple& args) {
555 return action_.Perform(SelectArgs<Result, ArgumentTuple, k1, k2, k3, k4,
556 k5, k6, k7, k8, k9, k10>::Select(args));
557 }
558
559 private:
shiqiane35fdd92008-12-10 05:08:54 +0000560 typedef typename SelectArgs<Result, ArgumentTuple,
zhanyong.wan38ca64d2009-02-19 22:30:22 +0000561 k1, k2, k3, k4, k5, k6, k7, k8, k9, k10>::type InnerFunctionType;
shiqiane35fdd92008-12-10 05:08:54 +0000562
zhanyong.wan38ca64d2009-02-19 22:30:22 +0000563 Action<InnerFunctionType> action_;
564 };
shiqiane35fdd92008-12-10 05:08:54 +0000565
shiqiane35fdd92008-12-10 05:08:54 +0000566 const InnerAction action_;
zhanyong.wan32de5f52009-12-23 00:13:23 +0000567
568 GTEST_DISALLOW_ASSIGN_(WithArgsAction);
shiqiane35fdd92008-12-10 05:08:54 +0000569};
570
shiqian326aa562009-01-09 21:43:57 +0000571// A macro from the ACTION* family (defined later in this file)
572// defines an action that can be used in a mock function. Typically,
573// these actions only care about a subset of the arguments of the mock
574// function. For example, if such an action only uses the second
575// argument, it can be used in any mock function that takes >= 2
576// arguments where the type of the second argument is compatible.
577//
578// Therefore, the action implementation must be prepared to take more
579// arguments than it needs. The ExcessiveArg type is used to
580// represent those excessive arguments. In order to keep the compiler
581// error messages tractable, we define it in the testing namespace
582// instead of testing::internal. However, this is an INTERNAL TYPE
583// and subject to change without notice, so a user MUST NOT USE THIS
584// TYPE DIRECTLY.
585struct ExcessiveArg {};
586
587// A helper class needed for implementing the ACTION* macros.
588template <typename Result, class Impl>
589class ActionHelper {
590 public:
kosakbd018832014-04-02 20:30:00 +0000591 static Result Perform(Impl* impl, const ::testing::tuple<>& args) {
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000592 return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),
shiqian326aa562009-01-09 21:43:57 +0000593 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000594 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
595 ExcessiveArg());
shiqian326aa562009-01-09 21:43:57 +0000596 }
597
598 template <typename A0>
kosakbd018832014-04-02 20:30:00 +0000599 static Result Perform(Impl* impl, const ::testing::tuple<A0>& args) {
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000600 return impl->template gmock_PerformImpl<A0>(args, get<0>(args),
shiqian326aa562009-01-09 21:43:57 +0000601 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000602 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
603 ExcessiveArg());
shiqian326aa562009-01-09 21:43:57 +0000604 }
605
606 template <typename A0, typename A1>
kosakbd018832014-04-02 20:30:00 +0000607 static Result Perform(Impl* impl, const ::testing::tuple<A0, A1>& args) {
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000608 return impl->template gmock_PerformImpl<A0, A1>(args, get<0>(args),
609 get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
shiqian326aa562009-01-09 21:43:57 +0000610 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000611 ExcessiveArg());
shiqian326aa562009-01-09 21:43:57 +0000612 }
613
614 template <typename A0, typename A1, typename A2>
kosakbd018832014-04-02 20:30:00 +0000615 static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2>& args) {
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000616 return impl->template gmock_PerformImpl<A0, A1, A2>(args, get<0>(args),
617 get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(),
618 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
619 ExcessiveArg());
shiqian326aa562009-01-09 21:43:57 +0000620 }
621
622 template <typename A0, typename A1, typename A2, typename A3>
kosakbd018832014-04-02 20:30:00 +0000623 static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2,
shiqian326aa562009-01-09 21:43:57 +0000624 A3>& args) {
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000625 return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, get<0>(args),
626 get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(),
627 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
628 ExcessiveArg());
shiqian326aa562009-01-09 21:43:57 +0000629 }
630
631 template <typename A0, typename A1, typename A2, typename A3, typename A4>
kosakbd018832014-04-02 20:30:00 +0000632 static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3,
shiqian326aa562009-01-09 21:43:57 +0000633 A4>& args) {
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000634 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(args,
635 get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
636 ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
637 ExcessiveArg());
shiqian326aa562009-01-09 21:43:57 +0000638 }
639
640 template <typename A0, typename A1, typename A2, typename A3, typename A4,
641 typename A5>
kosakbd018832014-04-02 20:30:00 +0000642 static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
shiqian326aa562009-01-09 21:43:57 +0000643 A5>& args) {
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000644 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(args,
645 get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
646 get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
647 ExcessiveArg());
shiqian326aa562009-01-09 21:43:57 +0000648 }
649
650 template <typename A0, typename A1, typename A2, typename A3, typename A4,
651 typename A5, typename A6>
kosakbd018832014-04-02 20:30:00 +0000652 static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
shiqian326aa562009-01-09 21:43:57 +0000653 A5, A6>& args) {
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000654 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(args,
655 get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
656 get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(),
657 ExcessiveArg());
shiqian326aa562009-01-09 21:43:57 +0000658 }
659
660 template <typename A0, typename A1, typename A2, typename A3, typename A4,
661 typename A5, typename A6, typename A7>
kosakbd018832014-04-02 20:30:00 +0000662 static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
shiqian326aa562009-01-09 21:43:57 +0000663 A5, A6, A7>& args) {
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000664 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6,
665 A7>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
666 get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(),
667 ExcessiveArg());
shiqian326aa562009-01-09 21:43:57 +0000668 }
669
670 template <typename A0, typename A1, typename A2, typename A3, typename A4,
671 typename A5, typename A6, typename A7, typename A8>
kosakbd018832014-04-02 20:30:00 +0000672 static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
shiqian326aa562009-01-09 21:43:57 +0000673 A5, A6, A7, A8>& args) {
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000674 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7,
675 A8>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
676 get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
677 ExcessiveArg());
shiqian326aa562009-01-09 21:43:57 +0000678 }
679
680 template <typename A0, typename A1, typename A2, typename A3, typename A4,
681 typename A5, typename A6, typename A7, typename A8, typename A9>
kosakbd018832014-04-02 20:30:00 +0000682 static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
shiqian326aa562009-01-09 21:43:57 +0000683 A5, A6, A7, A8, A9>& args) {
zhanyong.wan7f4c2c02009-02-19 22:38:27 +0000684 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8,
685 A9>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
686 get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
687 get<9>(args));
shiqian326aa562009-01-09 21:43:57 +0000688 }
689};
690
shiqiane35fdd92008-12-10 05:08:54 +0000691} // namespace internal
692
693// Various overloads for Invoke().
694
shiqiane35fdd92008-12-10 05:08:54 +0000695// WithArgs<N1, N2, ..., Nk>(an_action) creates an action that passes
696// the selected arguments of the mock function to an_action and
697// performs it. It serves as an adaptor between actions with
698// different argument lists. C++ doesn't support default arguments for
699// function templates, so we have to overload it.
700template <int k1, typename InnerAction>
701inline internal::WithArgsAction<InnerAction, k1>
702WithArgs(const InnerAction& action) {
703 return internal::WithArgsAction<InnerAction, k1>(action);
704}
705
706template <int k1, int k2, typename InnerAction>
707inline internal::WithArgsAction<InnerAction, k1, k2>
708WithArgs(const InnerAction& action) {
709 return internal::WithArgsAction<InnerAction, k1, k2>(action);
710}
711
712template <int k1, int k2, int k3, typename InnerAction>
713inline internal::WithArgsAction<InnerAction, k1, k2, k3>
714WithArgs(const InnerAction& action) {
715 return internal::WithArgsAction<InnerAction, k1, k2, k3>(action);
716}
717
718template <int k1, int k2, int k3, int k4, typename InnerAction>
719inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4>
720WithArgs(const InnerAction& action) {
721 return internal::WithArgsAction<InnerAction, k1, k2, k3, k4>(action);
722}
723
724template <int k1, int k2, int k3, int k4, int k5, typename InnerAction>
725inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>
726WithArgs(const InnerAction& action) {
727 return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>(action);
728}
729
730template <int k1, int k2, int k3, int k4, int k5, int k6, typename InnerAction>
731inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>
732WithArgs(const InnerAction& action) {
733 return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>(action);
734}
735
736template <int k1, int k2, int k3, int k4, int k5, int k6, int k7,
737 typename InnerAction>
738inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7>
739WithArgs(const InnerAction& action) {
740 return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6,
741 k7>(action);
742}
743
744template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
745 typename InnerAction>
746inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8>
747WithArgs(const InnerAction& action) {
748 return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7,
749 k8>(action);
750}
751
752template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
753 int k9, typename InnerAction>
754inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8, k9>
755WithArgs(const InnerAction& action) {
756 return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
757 k9>(action);
758}
759
760template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
761 int k9, int k10, typename InnerAction>
762inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
763 k9, k10>
764WithArgs(const InnerAction& action) {
765 return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
766 k9, k10>(action);
767}
768
769// Creates an action that does actions a1, a2, ..., sequentially in
770// each invocation.
771template <typename Action1, typename Action2>
772inline internal::DoBothAction<Action1, Action2>
773DoAll(Action1 a1, Action2 a2) {
774 return internal::DoBothAction<Action1, Action2>(a1, a2);
775}
776
777template <typename Action1, typename Action2, typename Action3>
778inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
779 Action3> >
780DoAll(Action1 a1, Action2 a2, Action3 a3) {
781 return DoAll(a1, DoAll(a2, a3));
782}
783
784template <typename Action1, typename Action2, typename Action3,
785 typename Action4>
786inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
787 internal::DoBothAction<Action3, Action4> > >
788DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4) {
789 return DoAll(a1, DoAll(a2, a3, a4));
790}
791
792template <typename Action1, typename Action2, typename Action3,
793 typename Action4, typename Action5>
794inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
795 internal::DoBothAction<Action3, internal::DoBothAction<Action4,
796 Action5> > > >
797DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5) {
798 return DoAll(a1, DoAll(a2, a3, a4, a5));
799}
800
801template <typename Action1, typename Action2, typename Action3,
802 typename Action4, typename Action5, typename Action6>
803inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
804 internal::DoBothAction<Action3, internal::DoBothAction<Action4,
805 internal::DoBothAction<Action5, Action6> > > > >
806DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6) {
807 return DoAll(a1, DoAll(a2, a3, a4, a5, a6));
808}
809
810template <typename Action1, typename Action2, typename Action3,
811 typename Action4, typename Action5, typename Action6, typename Action7>
812inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
813 internal::DoBothAction<Action3, internal::DoBothAction<Action4,
814 internal::DoBothAction<Action5, internal::DoBothAction<Action6,
815 Action7> > > > > >
816DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
817 Action7 a7) {
818 return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7));
819}
820
821template <typename Action1, typename Action2, typename Action3,
822 typename Action4, typename Action5, typename Action6, typename Action7,
823 typename Action8>
824inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
825 internal::DoBothAction<Action3, internal::DoBothAction<Action4,
826 internal::DoBothAction<Action5, internal::DoBothAction<Action6,
827 internal::DoBothAction<Action7, Action8> > > > > > >
828DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
829 Action7 a7, Action8 a8) {
830 return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8));
831}
832
833template <typename Action1, typename Action2, typename Action3,
834 typename Action4, typename Action5, typename Action6, typename Action7,
835 typename Action8, typename Action9>
836inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
837 internal::DoBothAction<Action3, internal::DoBothAction<Action4,
838 internal::DoBothAction<Action5, internal::DoBothAction<Action6,
839 internal::DoBothAction<Action7, internal::DoBothAction<Action8,
840 Action9> > > > > > > >
841DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
842 Action7 a7, Action8 a8, Action9 a9) {
843 return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9));
844}
845
846template <typename Action1, typename Action2, typename Action3,
847 typename Action4, typename Action5, typename Action6, typename Action7,
848 typename Action8, typename Action9, typename Action10>
849inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
850 internal::DoBothAction<Action3, internal::DoBothAction<Action4,
851 internal::DoBothAction<Action5, internal::DoBothAction<Action6,
852 internal::DoBothAction<Action7, internal::DoBothAction<Action8,
853 internal::DoBothAction<Action9, Action10> > > > > > > > >
854DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
855 Action7 a7, Action8 a8, Action9 a9, Action10 a10) {
856 return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9, a10));
857}
858
859} // namespace testing
860
shiqian326aa562009-01-09 21:43:57 +0000861// The ACTION* family of macros can be used in a namespace scope to
862// define custom actions easily. The syntax:
863//
864// ACTION(name) { statements; }
865//
866// will define an action with the given name that executes the
867// statements. The value returned by the statements will be used as
868// the return value of the action. Inside the statements, you can
869// refer to the K-th (0-based) argument of the mock function by
870// 'argK', and refer to its type by 'argK_type'. For example:
871//
872// ACTION(IncrementArg1) {
873// arg1_type temp = arg1;
874// return ++(*temp);
875// }
876//
877// allows you to write
878//
879// ...WillOnce(IncrementArg1());
880//
881// You can also refer to the entire argument tuple and its type by
882// 'args' and 'args_type', and refer to the mock function type and its
883// return type by 'function_type' and 'return_type'.
884//
885// Note that you don't need to specify the types of the mock function
886// arguments. However rest assured that your code is still type-safe:
887// you'll get a compiler error if *arg1 doesn't support the ++
888// operator, or if the type of ++(*arg1) isn't compatible with the
889// mock function's return type, for example.
890//
891// Sometimes you'll want to parameterize the action. For that you can use
892// another macro:
893//
894// ACTION_P(name, param_name) { statements; }
895//
896// For example:
897//
898// ACTION_P(Add, n) { return arg0 + n; }
899//
900// will allow you to write:
901//
902// ...WillOnce(Add(5));
903//
904// Note that you don't need to provide the type of the parameter
905// either. If you need to reference the type of a parameter named
906// 'foo', you can write 'foo_type'. For example, in the body of
907// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
908// of 'n'.
909//
910// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support
911// multi-parameter actions.
912//
913// For the purpose of typing, you can view
914//
915// ACTION_Pk(Foo, p1, ..., pk) { ... }
916//
917// as shorthand for
918//
919// template <typename p1_type, ..., typename pk_type>
920// FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }
921//
922// In particular, you can provide the template type arguments
923// explicitly when invoking Foo(), as in Foo<long, bool>(5, false);
924// although usually you can rely on the compiler to infer the types
925// for you automatically. You can assign the result of expression
926// Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,
927// pk_type>. This can be useful when composing actions.
928//
929// You can also overload actions with different numbers of parameters:
930//
931// ACTION_P(Plus, a) { ... }
932// ACTION_P2(Plus, a, b) { ... }
933//
934// While it's tempting to always use the ACTION* macros when defining
935// a new action, you should also consider implementing ActionInterface
936// or using MakePolymorphicAction() instead, especially if you need to
937// use the action a lot. While these approaches require more work,
938// they give you more control on the types of the mock function
939// arguments and the action parameters, which in general leads to
940// better compiler error messages that pay off in the long run. They
941// also allow overloading actions based on parameter types (as opposed
942// to just based on the number of parameters).
943//
944// CAVEAT:
945//
946// ACTION*() can only be used in a namespace scope. The reason is
947// that C++ doesn't yet allow function-local types to be used to
948// instantiate templates. The up-coming C++0x standard will fix this.
949// Once that's done, we'll consider supporting using ACTION*() inside
950// a function.
951//
952// MORE INFORMATION:
953//
954// To learn more about using these macros, please search for 'ACTION'
Herbert Thielene033d8c2017-08-31 18:12:17 +0200955// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
shiqian326aa562009-01-09 21:43:57 +0000956
zhanyong.wan33c0af02009-04-03 00:10:12 +0000957// An internal macro needed for implementing ACTION*().
958#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
jgm79a367e2012-04-10 16:02:11 +0000959 const args_type& args GTEST_ATTRIBUTE_UNUSED_, \
960 arg0_type arg0 GTEST_ATTRIBUTE_UNUSED_, \
961 arg1_type arg1 GTEST_ATTRIBUTE_UNUSED_, \
962 arg2_type arg2 GTEST_ATTRIBUTE_UNUSED_, \
963 arg3_type arg3 GTEST_ATTRIBUTE_UNUSED_, \
964 arg4_type arg4 GTEST_ATTRIBUTE_UNUSED_, \
965 arg5_type arg5 GTEST_ATTRIBUTE_UNUSED_, \
966 arg6_type arg6 GTEST_ATTRIBUTE_UNUSED_, \
967 arg7_type arg7 GTEST_ATTRIBUTE_UNUSED_, \
968 arg8_type arg8 GTEST_ATTRIBUTE_UNUSED_, \
zhanyong.wan33c0af02009-04-03 00:10:12 +0000969 arg9_type arg9 GTEST_ATTRIBUTE_UNUSED_
970
zhanyong.wan18490652009-05-11 18:54:08 +0000971// Sometimes you want to give an action explicit template parameters
972// that cannot be inferred from its value parameters. ACTION() and
973// ACTION_P*() don't support that. ACTION_TEMPLATE() remedies that
974// and can be viewed as an extension to ACTION() and ACTION_P*().
975//
976// The syntax:
977//
978// ACTION_TEMPLATE(ActionName,
979// HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
980// AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
981//
982// defines an action template that takes m explicit template
983// parameters and n value parameters. name_i is the name of the i-th
984// template parameter, and kind_i specifies whether it's a typename,
985// an integral constant, or a template. p_i is the name of the i-th
986// value parameter.
987//
988// Example:
989//
990// // DuplicateArg<k, T>(output) converts the k-th argument of the mock
991// // function to type T and copies it to *output.
992// ACTION_TEMPLATE(DuplicateArg,
993// HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
994// AND_1_VALUE_PARAMS(output)) {
kosakbd018832014-04-02 20:30:00 +0000995// *output = T(::testing::get<k>(args));
zhanyong.wan18490652009-05-11 18:54:08 +0000996// }
997// ...
998// int n;
999// EXPECT_CALL(mock, Foo(_, _))
1000// .WillOnce(DuplicateArg<1, unsigned char>(&n));
1001//
1002// To create an instance of an action template, write:
1003//
1004// ActionName<t1, ..., t_m>(v1, ..., v_n)
1005//
1006// where the ts are the template arguments and the vs are the value
1007// arguments. The value argument types are inferred by the compiler.
1008// If you want to explicitly specify the value argument types, you can
1009// provide additional template arguments:
1010//
1011// ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
1012//
1013// where u_i is the desired type of v_i.
1014//
1015// ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the
1016// number of value parameters, but not on the number of template
1017// parameters. Without the restriction, the meaning of the following
1018// is unclear:
1019//
1020// OverloadedAction<int, bool>(x);
1021//
1022// Are we using a single-template-parameter action where 'bool' refers
1023// to the type of x, or are we using a two-template-parameter action
1024// where the compiler is asked to infer the type of x?
1025//
1026// Implementation notes:
1027//
1028// GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and
1029// GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for
1030// implementing ACTION_TEMPLATE. The main trick we use is to create
1031// new macro invocations when expanding a macro. For example, we have
1032//
1033// #define ACTION_TEMPLATE(name, template_params, value_params)
1034// ... GMOCK_INTERNAL_DECL_##template_params ...
1035//
1036// which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)
1037// to expand to
1038//
1039// ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...
1040//
1041// Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the
1042// preprocessor will continue to expand it to
1043//
1044// ... typename T ...
1045//
1046// This technique conforms to the C++ standard and is portable. It
1047// allows us to implement action templates using O(N) code, where N is
1048// the maximum number of template/value parameters supported. Without
1049// using it, we'd have to devote O(N^2) amount of code to implement all
1050// combinations of m and n.
1051
1052// Declares the template parameters.
1053#define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0
1054#define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
1055 name1) kind0 name0, kind1 name1
1056#define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1057 kind2, name2) kind0 name0, kind1 name1, kind2 name2
1058#define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1059 kind2, name2, kind3, name3) kind0 name0, kind1 name1, kind2 name2, \
1060 kind3 name3
1061#define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1062 kind2, name2, kind3, name3, kind4, name4) kind0 name0, kind1 name1, \
1063 kind2 name2, kind3 name3, kind4 name4
1064#define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1065 kind2, name2, kind3, name3, kind4, name4, kind5, name5) kind0 name0, \
1066 kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5
1067#define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1068 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
1069 name6) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
1070 kind5 name5, kind6 name6
1071#define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1072 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
1073 kind7, name7) kind0 name0, kind1 name1, kind2 name2, kind3 name3, \
1074 kind4 name4, kind5 name5, kind6 name6, kind7 name7
1075#define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1076 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
1077 kind7, name7, kind8, name8) kind0 name0, kind1 name1, kind2 name2, \
1078 kind3 name3, kind4 name4, kind5 name5, kind6 name6, kind7 name7, \
1079 kind8 name8
1080#define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
1081 name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
1082 name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \
1083 kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \
1084 kind6 name6, kind7 name7, kind8 name8, kind9 name9
1085
1086// Lists the template parameters.
1087#define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0
1088#define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
1089 name1) name0, name1
1090#define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1091 kind2, name2) name0, name1, name2
1092#define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1093 kind2, name2, kind3, name3) name0, name1, name2, name3
1094#define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1095 kind2, name2, kind3, name3, kind4, name4) name0, name1, name2, name3, \
1096 name4
1097#define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1098 kind2, name2, kind3, name3, kind4, name4, kind5, name5) name0, name1, \
1099 name2, name3, name4, name5
1100#define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1101 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
1102 name6) name0, name1, name2, name3, name4, name5, name6
1103#define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1104 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
1105 kind7, name7) name0, name1, name2, name3, name4, name5, name6, name7
1106#define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1107 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
1108 kind7, name7, kind8, name8) name0, name1, name2, name3, name4, name5, \
1109 name6, name7, name8
1110#define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
1111 name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
1112 name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \
1113 name3, name4, name5, name6, name7, name8, name9
1114
1115// Declares the types of value parameters.
1116#define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
1117#define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type
1118#define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) , \
1119 typename p0##_type, typename p1##_type
1120#define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , \
1121 typename p0##_type, typename p1##_type, typename p2##_type
1122#define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
1123 typename p0##_type, typename p1##_type, typename p2##_type, \
1124 typename p3##_type
1125#define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
1126 typename p0##_type, typename p1##_type, typename p2##_type, \
1127 typename p3##_type, typename p4##_type
1128#define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
1129 typename p0##_type, typename p1##_type, typename p2##_type, \
1130 typename p3##_type, typename p4##_type, typename p5##_type
1131#define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1132 p6) , typename p0##_type, typename p1##_type, typename p2##_type, \
1133 typename p3##_type, typename p4##_type, typename p5##_type, \
1134 typename p6##_type
1135#define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1136 p6, p7) , typename p0##_type, typename p1##_type, typename p2##_type, \
1137 typename p3##_type, typename p4##_type, typename p5##_type, \
1138 typename p6##_type, typename p7##_type
1139#define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1140 p6, p7, p8) , typename p0##_type, typename p1##_type, typename p2##_type, \
1141 typename p3##_type, typename p4##_type, typename p5##_type, \
1142 typename p6##_type, typename p7##_type, typename p8##_type
1143#define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1144 p6, p7, p8, p9) , typename p0##_type, typename p1##_type, \
1145 typename p2##_type, typename p3##_type, typename p4##_type, \
1146 typename p5##_type, typename p6##_type, typename p7##_type, \
1147 typename p8##_type, typename p9##_type
1148
1149// Initializes the value parameters.
1150#define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\
1151 ()
1152#define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001153 (p0##_type gmock_p0) : p0(::testing::internal::move(gmock_p0))
zhanyong.wan18490652009-05-11 18:54:08 +00001154#define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001155 (p0##_type gmock_p0, \
1156 p1##_type gmock_p1) : p0(::testing::internal::move(gmock_p0)), \
1157 p1(::testing::internal::move(gmock_p1))
zhanyong.wan18490652009-05-11 18:54:08 +00001158#define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\
1159 (p0##_type gmock_p0, p1##_type gmock_p1, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001160 p2##_type gmock_p2) : p0(::testing::internal::move(gmock_p0)), \
1161 p1(::testing::internal::move(gmock_p1)), \
1162 p2(::testing::internal::move(gmock_p2))
zhanyong.wan18490652009-05-11 18:54:08 +00001163#define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\
1164 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001165 p3##_type gmock_p3) : p0(::testing::internal::move(gmock_p0)), \
1166 p1(::testing::internal::move(gmock_p1)), \
1167 p2(::testing::internal::move(gmock_p2)), \
1168 p3(::testing::internal::move(gmock_p3))
zhanyong.wan18490652009-05-11 18:54:08 +00001169#define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\
1170 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001171 p3##_type gmock_p3, \
1172 p4##_type gmock_p4) : p0(::testing::internal::move(gmock_p0)), \
1173 p1(::testing::internal::move(gmock_p1)), \
1174 p2(::testing::internal::move(gmock_p2)), \
1175 p3(::testing::internal::move(gmock_p3)), \
1176 p4(::testing::internal::move(gmock_p4))
zhanyong.wan18490652009-05-11 18:54:08 +00001177#define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\
1178 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1179 p3##_type gmock_p3, p4##_type gmock_p4, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001180 p5##_type gmock_p5) : p0(::testing::internal::move(gmock_p0)), \
1181 p1(::testing::internal::move(gmock_p1)), \
1182 p2(::testing::internal::move(gmock_p2)), \
1183 p3(::testing::internal::move(gmock_p3)), \
1184 p4(::testing::internal::move(gmock_p4)), \
1185 p5(::testing::internal::move(gmock_p5))
zhanyong.wan18490652009-05-11 18:54:08 +00001186#define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\
1187 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1188 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001189 p6##_type gmock_p6) : p0(::testing::internal::move(gmock_p0)), \
1190 p1(::testing::internal::move(gmock_p1)), \
1191 p2(::testing::internal::move(gmock_p2)), \
1192 p3(::testing::internal::move(gmock_p3)), \
1193 p4(::testing::internal::move(gmock_p4)), \
1194 p5(::testing::internal::move(gmock_p5)), \
1195 p6(::testing::internal::move(gmock_p6))
zhanyong.wan18490652009-05-11 18:54:08 +00001196#define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\
1197 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1198 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001199 p6##_type gmock_p6, \
1200 p7##_type gmock_p7) : p0(::testing::internal::move(gmock_p0)), \
1201 p1(::testing::internal::move(gmock_p1)), \
1202 p2(::testing::internal::move(gmock_p2)), \
1203 p3(::testing::internal::move(gmock_p3)), \
1204 p4(::testing::internal::move(gmock_p4)), \
1205 p5(::testing::internal::move(gmock_p5)), \
1206 p6(::testing::internal::move(gmock_p6)), \
1207 p7(::testing::internal::move(gmock_p7))
zhanyong.wan18490652009-05-11 18:54:08 +00001208#define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1209 p7, p8)\
1210 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1211 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1212 p6##_type gmock_p6, p7##_type gmock_p7, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001213 p8##_type gmock_p8) : p0(::testing::internal::move(gmock_p0)), \
1214 p1(::testing::internal::move(gmock_p1)), \
1215 p2(::testing::internal::move(gmock_p2)), \
1216 p3(::testing::internal::move(gmock_p3)), \
1217 p4(::testing::internal::move(gmock_p4)), \
1218 p5(::testing::internal::move(gmock_p5)), \
1219 p6(::testing::internal::move(gmock_p6)), \
1220 p7(::testing::internal::move(gmock_p7)), \
1221 p8(::testing::internal::move(gmock_p8))
zhanyong.wan18490652009-05-11 18:54:08 +00001222#define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1223 p7, p8, p9)\
1224 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1225 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1226 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001227 p9##_type gmock_p9) : p0(::testing::internal::move(gmock_p0)), \
1228 p1(::testing::internal::move(gmock_p1)), \
1229 p2(::testing::internal::move(gmock_p2)), \
1230 p3(::testing::internal::move(gmock_p3)), \
1231 p4(::testing::internal::move(gmock_p4)), \
1232 p5(::testing::internal::move(gmock_p5)), \
1233 p6(::testing::internal::move(gmock_p6)), \
1234 p7(::testing::internal::move(gmock_p7)), \
1235 p8(::testing::internal::move(gmock_p8)), \
1236 p9(::testing::internal::move(gmock_p9))
zhanyong.wan18490652009-05-11 18:54:08 +00001237
1238// Declares the fields for storing the value parameters.
1239#define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
1240#define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0;
1241#define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0; \
1242 p1##_type p1;
1243#define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0; \
1244 p1##_type p1; p2##_type p2;
1245#define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0; \
1246 p1##_type p1; p2##_type p2; p3##_type p3;
1247#define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
1248 p4) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4;
1249#define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
1250 p5) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
1251 p5##_type p5;
1252#define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1253 p6) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
1254 p5##_type p5; p6##_type p6;
1255#define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1256 p7) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
1257 p5##_type p5; p6##_type p6; p7##_type p7;
1258#define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1259 p7, p8) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
1260 p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8;
1261#define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1262 p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
1263 p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \
1264 p9##_type p9;
1265
1266// Lists the value parameters.
1267#define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
1268#define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0
1269#define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1
1270#define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2
1271#define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3
1272#define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) p0, p1, \
1273 p2, p3, p4
1274#define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) p0, \
1275 p1, p2, p3, p4, p5
1276#define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1277 p6) p0, p1, p2, p3, p4, p5, p6
1278#define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1279 p7) p0, p1, p2, p3, p4, p5, p6, p7
1280#define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1281 p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8
1282#define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1283 p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9
1284
1285// Lists the value parameter types.
1286#define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
1287#define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type
1288#define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) , p0##_type, \
1289 p1##_type
1290#define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , p0##_type, \
1291 p1##_type, p2##_type
1292#define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
1293 p0##_type, p1##_type, p2##_type, p3##_type
1294#define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
1295 p0##_type, p1##_type, p2##_type, p3##_type, p4##_type
1296#define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
1297 p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type
1298#define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1299 p6) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \
1300 p6##_type
1301#define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1302 p6, p7) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1303 p5##_type, p6##_type, p7##_type
1304#define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1305 p6, p7, p8) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1306 p5##_type, p6##_type, p7##_type, p8##_type
1307#define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1308 p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1309 p5##_type, p6##_type, p7##_type, p8##_type, p9##_type
1310
1311// Declares the value parameters.
1312#define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
1313#define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0
1314#define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0, \
1315 p1##_type p1
1316#define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0, \
1317 p1##_type p1, p2##_type p2
1318#define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0, \
1319 p1##_type p1, p2##_type p2, p3##_type p3
1320#define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
1321 p4) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4
1322#define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
1323 p5) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
1324 p5##_type p5
1325#define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1326 p6) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
1327 p5##_type p5, p6##_type p6
1328#define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1329 p7) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
1330 p5##_type p5, p6##_type p6, p7##_type p7
1331#define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1332 p7, p8) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1333 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8
1334#define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1335 p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1336 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
1337 p9##_type p9
1338
1339// The suffix of the class template implementing the action template.
1340#define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
1341#define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P
1342#define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2
1343#define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3
1344#define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4
1345#define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5
1346#define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6
1347#define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7
1348#define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1349 p7) P8
1350#define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1351 p7, p8) P9
1352#define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1353 p7, p8, p9) P10
1354
1355// The name of the class template implementing the action template.
1356#define GMOCK_ACTION_CLASS_(name, value_params)\
zhanyong.wanccedc1c2010-08-09 22:46:12 +00001357 GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
zhanyong.wan18490652009-05-11 18:54:08 +00001358
1359#define ACTION_TEMPLATE(name, template_params, value_params)\
1360 template <GMOCK_INTERNAL_DECL_##template_params\
1361 GMOCK_INTERNAL_DECL_TYPE_##value_params>\
1362 class GMOCK_ACTION_CLASS_(name, value_params) {\
1363 public:\
billydonahue1f5fdea2014-05-19 17:54:51 +00001364 explicit GMOCK_ACTION_CLASS_(name, value_params)\
zhanyong.wan18490652009-05-11 18:54:08 +00001365 GMOCK_INTERNAL_INIT_##value_params {}\
1366 template <typename F>\
1367 class gmock_Impl : public ::testing::ActionInterface<F> {\
1368 public:\
1369 typedef F function_type;\
1370 typedef typename ::testing::internal::Function<F>::Result return_type;\
1371 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1372 args_type;\
1373 explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\
1374 virtual return_type Perform(const args_type& args) {\
1375 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1376 Perform(this, args);\
1377 }\
1378 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1379 typename arg3_type, typename arg4_type, typename arg5_type, \
1380 typename arg6_type, typename arg7_type, typename arg8_type, \
1381 typename arg9_type>\
1382 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1383 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1384 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1385 arg9_type arg9) const;\
1386 GMOCK_INTERNAL_DEFN_##value_params\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001387 private:\
1388 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
zhanyong.wan18490652009-05-11 18:54:08 +00001389 };\
1390 template <typename F> operator ::testing::Action<F>() const {\
1391 return ::testing::Action<F>(\
1392 new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
1393 }\
1394 GMOCK_INTERNAL_DEFN_##value_params\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001395 private:\
1396 GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
zhanyong.wan18490652009-05-11 18:54:08 +00001397 };\
1398 template <GMOCK_INTERNAL_DECL_##template_params\
1399 GMOCK_INTERNAL_DECL_TYPE_##value_params>\
1400 inline GMOCK_ACTION_CLASS_(name, value_params)<\
1401 GMOCK_INTERNAL_LIST_##template_params\
1402 GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\
1403 GMOCK_INTERNAL_DECL_##value_params) {\
1404 return GMOCK_ACTION_CLASS_(name, value_params)<\
1405 GMOCK_INTERNAL_LIST_##template_params\
1406 GMOCK_INTERNAL_LIST_TYPE_##value_params>(\
1407 GMOCK_INTERNAL_LIST_##value_params);\
1408 }\
1409 template <GMOCK_INTERNAL_DECL_##template_params\
1410 GMOCK_INTERNAL_DECL_TYPE_##value_params>\
1411 template <typename F>\
jgm79a367e2012-04-10 16:02:11 +00001412 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1413 typename arg3_type, typename arg4_type, typename arg5_type, \
1414 typename arg6_type, typename arg7_type, typename arg8_type, \
zhanyong.wan18490652009-05-11 18:54:08 +00001415 typename arg9_type>\
1416 typename ::testing::internal::Function<F>::Result\
1417 GMOCK_ACTION_CLASS_(name, value_params)<\
1418 GMOCK_INTERNAL_LIST_##template_params\
1419 GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\
1420 gmock_PerformImpl(\
1421 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1422
shiqian326aa562009-01-09 21:43:57 +00001423#define ACTION(name)\
1424 class name##Action {\
1425 public:\
1426 name##Action() {}\
1427 template <typename F>\
1428 class gmock_Impl : public ::testing::ActionInterface<F> {\
1429 public:\
1430 typedef F function_type;\
1431 typedef typename ::testing::internal::Function<F>::Result return_type;\
1432 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1433 args_type;\
1434 gmock_Impl() {}\
1435 virtual return_type Perform(const args_type& args) {\
1436 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1437 Perform(this, args);\
1438 }\
1439 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1440 typename arg3_type, typename arg4_type, typename arg5_type, \
1441 typename arg6_type, typename arg7_type, typename arg8_type, \
1442 typename arg9_type>\
1443 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1444 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1445 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1446 arg9_type arg9) const;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001447 private:\
1448 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
shiqian326aa562009-01-09 21:43:57 +00001449 };\
1450 template <typename F> operator ::testing::Action<F>() const {\
1451 return ::testing::Action<F>(new gmock_Impl<F>());\
1452 }\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001453 private:\
1454 GTEST_DISALLOW_ASSIGN_(name##Action);\
shiqian326aa562009-01-09 21:43:57 +00001455 };\
1456 inline name##Action name() {\
1457 return name##Action();\
1458 }\
1459 template <typename F>\
1460 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1461 typename arg3_type, typename arg4_type, typename arg5_type, \
1462 typename arg6_type, typename arg7_type, typename arg8_type, \
1463 typename arg9_type>\
1464 typename ::testing::internal::Function<F>::Result\
zhanyong.wan33c0af02009-04-03 00:10:12 +00001465 name##Action::gmock_Impl<F>::gmock_PerformImpl(\
1466 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
shiqian326aa562009-01-09 21:43:57 +00001467
1468#define ACTION_P(name, p0)\
1469 template <typename p0##_type>\
1470 class name##ActionP {\
1471 public:\
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001472 explicit name##ActionP(p0##_type gmock_p0) : \
1473 p0(::testing::internal::forward<p0##_type>(gmock_p0)) {}\
shiqian326aa562009-01-09 21:43:57 +00001474 template <typename F>\
1475 class gmock_Impl : public ::testing::ActionInterface<F> {\
1476 public:\
1477 typedef F function_type;\
1478 typedef typename ::testing::internal::Function<F>::Result return_type;\
1479 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1480 args_type;\
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001481 explicit gmock_Impl(p0##_type gmock_p0) : \
1482 p0(::testing::internal::forward<p0##_type>(gmock_p0)) {}\
shiqian326aa562009-01-09 21:43:57 +00001483 virtual return_type Perform(const args_type& args) {\
1484 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1485 Perform(this, args);\
1486 }\
1487 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1488 typename arg3_type, typename arg4_type, typename arg5_type, \
1489 typename arg6_type, typename arg7_type, typename arg8_type, \
1490 typename arg9_type>\
1491 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1492 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1493 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1494 arg9_type arg9) const;\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001495 p0##_type p0;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001496 private:\
1497 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
shiqian326aa562009-01-09 21:43:57 +00001498 };\
1499 template <typename F> operator ::testing::Action<F>() const {\
1500 return ::testing::Action<F>(new gmock_Impl<F>(p0));\
1501 }\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001502 p0##_type p0;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001503 private:\
1504 GTEST_DISALLOW_ASSIGN_(name##ActionP);\
shiqian326aa562009-01-09 21:43:57 +00001505 };\
1506 template <typename p0##_type>\
1507 inline name##ActionP<p0##_type> name(p0##_type p0) {\
1508 return name##ActionP<p0##_type>(p0);\
1509 }\
1510 template <typename p0##_type>\
1511 template <typename F>\
1512 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1513 typename arg3_type, typename arg4_type, typename arg5_type, \
1514 typename arg6_type, typename arg7_type, typename arg8_type, \
1515 typename arg9_type>\
1516 typename ::testing::internal::Function<F>::Result\
zhanyong.wan33c0af02009-04-03 00:10:12 +00001517 name##ActionP<p0##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1518 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
shiqian326aa562009-01-09 21:43:57 +00001519
1520#define ACTION_P2(name, p0, p1)\
1521 template <typename p0##_type, typename p1##_type>\
1522 class name##ActionP2 {\
1523 public:\
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001524 name##ActionP2(p0##_type gmock_p0, \
1525 p1##_type gmock_p1) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1526 p1(::testing::internal::forward<p1##_type>(gmock_p1)) {}\
shiqian326aa562009-01-09 21:43:57 +00001527 template <typename F>\
1528 class gmock_Impl : public ::testing::ActionInterface<F> {\
1529 public:\
1530 typedef F function_type;\
1531 typedef typename ::testing::internal::Function<F>::Result return_type;\
1532 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1533 args_type;\
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001534 gmock_Impl(p0##_type gmock_p0, \
1535 p1##_type gmock_p1) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1536 p1(::testing::internal::forward<p1##_type>(gmock_p1)) {}\
shiqian326aa562009-01-09 21:43:57 +00001537 virtual return_type Perform(const args_type& args) {\
1538 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1539 Perform(this, args);\
1540 }\
1541 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1542 typename arg3_type, typename arg4_type, typename arg5_type, \
1543 typename arg6_type, typename arg7_type, typename arg8_type, \
1544 typename arg9_type>\
1545 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1546 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1547 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1548 arg9_type arg9) const;\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001549 p0##_type p0;\
1550 p1##_type p1;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001551 private:\
1552 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
shiqian326aa562009-01-09 21:43:57 +00001553 };\
1554 template <typename F> operator ::testing::Action<F>() const {\
1555 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1));\
1556 }\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001557 p0##_type p0;\
1558 p1##_type p1;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001559 private:\
1560 GTEST_DISALLOW_ASSIGN_(name##ActionP2);\
shiqian326aa562009-01-09 21:43:57 +00001561 };\
1562 template <typename p0##_type, typename p1##_type>\
1563 inline name##ActionP2<p0##_type, p1##_type> name(p0##_type p0, \
1564 p1##_type p1) {\
1565 return name##ActionP2<p0##_type, p1##_type>(p0, p1);\
1566 }\
1567 template <typename p0##_type, typename p1##_type>\
1568 template <typename F>\
1569 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1570 typename arg3_type, typename arg4_type, typename arg5_type, \
1571 typename arg6_type, typename arg7_type, typename arg8_type, \
1572 typename arg9_type>\
1573 typename ::testing::internal::Function<F>::Result\
zhanyong.wan33c0af02009-04-03 00:10:12 +00001574 name##ActionP2<p0##_type, p1##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1575 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
shiqian326aa562009-01-09 21:43:57 +00001576
1577#define ACTION_P3(name, p0, p1, p2)\
1578 template <typename p0##_type, typename p1##_type, typename p2##_type>\
1579 class name##ActionP3 {\
1580 public:\
1581 name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001582 p2##_type gmock_p2) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1583 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1584 p2(::testing::internal::forward<p2##_type>(gmock_p2)) {}\
shiqian326aa562009-01-09 21:43:57 +00001585 template <typename F>\
1586 class gmock_Impl : public ::testing::ActionInterface<F> {\
1587 public:\
1588 typedef F function_type;\
1589 typedef typename ::testing::internal::Function<F>::Result return_type;\
1590 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1591 args_type;\
1592 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001593 p2##_type gmock_p2) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1594 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1595 p2(::testing::internal::forward<p2##_type>(gmock_p2)) {}\
shiqian326aa562009-01-09 21:43:57 +00001596 virtual return_type Perform(const args_type& args) {\
1597 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1598 Perform(this, args);\
1599 }\
1600 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1601 typename arg3_type, typename arg4_type, typename arg5_type, \
1602 typename arg6_type, typename arg7_type, typename arg8_type, \
1603 typename arg9_type>\
1604 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1605 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1606 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1607 arg9_type arg9) const;\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001608 p0##_type p0;\
1609 p1##_type p1;\
1610 p2##_type p2;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001611 private:\
1612 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
shiqian326aa562009-01-09 21:43:57 +00001613 };\
1614 template <typename F> operator ::testing::Action<F>() const {\
1615 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2));\
1616 }\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001617 p0##_type p0;\
1618 p1##_type p1;\
1619 p2##_type p2;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001620 private:\
1621 GTEST_DISALLOW_ASSIGN_(name##ActionP3);\
shiqian326aa562009-01-09 21:43:57 +00001622 };\
1623 template <typename p0##_type, typename p1##_type, typename p2##_type>\
1624 inline name##ActionP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
1625 p1##_type p1, p2##_type p2) {\
1626 return name##ActionP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
1627 }\
1628 template <typename p0##_type, typename p1##_type, typename p2##_type>\
1629 template <typename F>\
1630 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1631 typename arg3_type, typename arg4_type, typename arg5_type, \
1632 typename arg6_type, typename arg7_type, typename arg8_type, \
1633 typename arg9_type>\
1634 typename ::testing::internal::Function<F>::Result\
zhanyong.wan33c0af02009-04-03 00:10:12 +00001635 name##ActionP3<p0##_type, p1##_type, \
1636 p2##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1637 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
shiqian326aa562009-01-09 21:43:57 +00001638
1639#define ACTION_P4(name, p0, p1, p2, p3)\
1640 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1641 typename p3##_type>\
1642 class name##ActionP4 {\
1643 public:\
1644 name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001645 p2##_type gmock_p2, \
1646 p3##_type gmock_p3) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1647 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1648 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1649 p3(::testing::internal::forward<p3##_type>(gmock_p3)) {}\
shiqian326aa562009-01-09 21:43:57 +00001650 template <typename F>\
1651 class gmock_Impl : public ::testing::ActionInterface<F> {\
1652 public:\
1653 typedef F function_type;\
1654 typedef typename ::testing::internal::Function<F>::Result return_type;\
1655 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1656 args_type;\
1657 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001658 p3##_type gmock_p3) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1659 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1660 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1661 p3(::testing::internal::forward<p3##_type>(gmock_p3)) {}\
shiqian326aa562009-01-09 21:43:57 +00001662 virtual return_type Perform(const args_type& args) {\
1663 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1664 Perform(this, args);\
1665 }\
1666 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1667 typename arg3_type, typename arg4_type, typename arg5_type, \
1668 typename arg6_type, typename arg7_type, typename arg8_type, \
1669 typename arg9_type>\
1670 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1671 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1672 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1673 arg9_type arg9) const;\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001674 p0##_type p0;\
1675 p1##_type p1;\
1676 p2##_type p2;\
1677 p3##_type p3;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001678 private:\
1679 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
shiqian326aa562009-01-09 21:43:57 +00001680 };\
1681 template <typename F> operator ::testing::Action<F>() const {\
1682 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3));\
1683 }\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001684 p0##_type p0;\
1685 p1##_type p1;\
1686 p2##_type p2;\
1687 p3##_type p3;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001688 private:\
1689 GTEST_DISALLOW_ASSIGN_(name##ActionP4);\
shiqian326aa562009-01-09 21:43:57 +00001690 };\
1691 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1692 typename p3##_type>\
1693 inline name##ActionP4<p0##_type, p1##_type, p2##_type, \
1694 p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1695 p3##_type p3) {\
1696 return name##ActionP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, p1, \
1697 p2, p3);\
1698 }\
1699 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1700 typename p3##_type>\
1701 template <typename F>\
1702 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1703 typename arg3_type, typename arg4_type, typename arg5_type, \
1704 typename arg6_type, typename arg7_type, typename arg8_type, \
1705 typename arg9_type>\
1706 typename ::testing::internal::Function<F>::Result\
zhanyong.wan33c0af02009-04-03 00:10:12 +00001707 name##ActionP4<p0##_type, p1##_type, p2##_type, \
1708 p3##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1709 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
shiqian326aa562009-01-09 21:43:57 +00001710
1711#define ACTION_P5(name, p0, p1, p2, p3, p4)\
1712 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1713 typename p3##_type, typename p4##_type>\
1714 class name##ActionP5 {\
1715 public:\
1716 name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \
1717 p2##_type gmock_p2, p3##_type gmock_p3, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001718 p4##_type gmock_p4) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1719 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1720 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1721 p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1722 p4(::testing::internal::forward<p4##_type>(gmock_p4)) {}\
shiqian326aa562009-01-09 21:43:57 +00001723 template <typename F>\
1724 class gmock_Impl : public ::testing::ActionInterface<F> {\
1725 public:\
1726 typedef F function_type;\
1727 typedef typename ::testing::internal::Function<F>::Result return_type;\
1728 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1729 args_type;\
1730 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001731 p3##_type gmock_p3, \
1732 p4##_type gmock_p4) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1733 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1734 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1735 p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1736 p4(::testing::internal::forward<p4##_type>(gmock_p4)) {}\
shiqian326aa562009-01-09 21:43:57 +00001737 virtual return_type Perform(const args_type& args) {\
1738 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1739 Perform(this, args);\
1740 }\
1741 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1742 typename arg3_type, typename arg4_type, typename arg5_type, \
1743 typename arg6_type, typename arg7_type, typename arg8_type, \
1744 typename arg9_type>\
1745 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1746 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1747 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1748 arg9_type arg9) const;\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001749 p0##_type p0;\
1750 p1##_type p1;\
1751 p2##_type p2;\
1752 p3##_type p3;\
1753 p4##_type p4;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001754 private:\
1755 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
shiqian326aa562009-01-09 21:43:57 +00001756 };\
1757 template <typename F> operator ::testing::Action<F>() const {\
1758 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4));\
1759 }\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001760 p0##_type p0;\
1761 p1##_type p1;\
1762 p2##_type p2;\
1763 p3##_type p3;\
1764 p4##_type p4;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001765 private:\
1766 GTEST_DISALLOW_ASSIGN_(name##ActionP5);\
shiqian326aa562009-01-09 21:43:57 +00001767 };\
1768 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1769 typename p3##_type, typename p4##_type>\
1770 inline name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1771 p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1772 p4##_type p4) {\
1773 return name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1774 p4##_type>(p0, p1, p2, p3, p4);\
1775 }\
1776 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1777 typename p3##_type, typename p4##_type>\
1778 template <typename F>\
1779 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1780 typename arg3_type, typename arg4_type, typename arg5_type, \
1781 typename arg6_type, typename arg7_type, typename arg8_type, \
1782 typename arg9_type>\
1783 typename ::testing::internal::Function<F>::Result\
zhanyong.wan33c0af02009-04-03 00:10:12 +00001784 name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1785 p4##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1786 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
shiqian326aa562009-01-09 21:43:57 +00001787
1788#define ACTION_P6(name, p0, p1, p2, p3, p4, p5)\
1789 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1790 typename p3##_type, typename p4##_type, typename p5##_type>\
1791 class name##ActionP6 {\
1792 public:\
1793 name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \
1794 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001795 p5##_type gmock_p5) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1796 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1797 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1798 p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1799 p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
1800 p5(::testing::internal::forward<p5##_type>(gmock_p5)) {}\
shiqian326aa562009-01-09 21:43:57 +00001801 template <typename F>\
1802 class gmock_Impl : public ::testing::ActionInterface<F> {\
1803 public:\
1804 typedef F function_type;\
1805 typedef typename ::testing::internal::Function<F>::Result return_type;\
1806 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1807 args_type;\
1808 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1809 p3##_type gmock_p3, p4##_type gmock_p4, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001810 p5##_type gmock_p5) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1811 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1812 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1813 p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1814 p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
1815 p5(::testing::internal::forward<p5##_type>(gmock_p5)) {}\
shiqian326aa562009-01-09 21:43:57 +00001816 virtual return_type Perform(const args_type& args) {\
1817 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1818 Perform(this, args);\
1819 }\
1820 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1821 typename arg3_type, typename arg4_type, typename arg5_type, \
1822 typename arg6_type, typename arg7_type, typename arg8_type, \
1823 typename arg9_type>\
1824 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1825 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1826 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1827 arg9_type arg9) const;\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001828 p0##_type p0;\
1829 p1##_type p1;\
1830 p2##_type p2;\
1831 p3##_type p3;\
1832 p4##_type p4;\
1833 p5##_type p5;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001834 private:\
1835 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
shiqian326aa562009-01-09 21:43:57 +00001836 };\
1837 template <typename F> operator ::testing::Action<F>() const {\
1838 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5));\
1839 }\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001840 p0##_type p0;\
1841 p1##_type p1;\
1842 p2##_type p2;\
1843 p3##_type p3;\
1844 p4##_type p4;\
1845 p5##_type p5;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001846 private:\
1847 GTEST_DISALLOW_ASSIGN_(name##ActionP6);\
shiqian326aa562009-01-09 21:43:57 +00001848 };\
1849 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1850 typename p3##_type, typename p4##_type, typename p5##_type>\
1851 inline name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1852 p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1853 p3##_type p3, p4##_type p4, p5##_type p5) {\
1854 return name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1855 p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
1856 }\
1857 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1858 typename p3##_type, typename p4##_type, typename p5##_type>\
1859 template <typename F>\
1860 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1861 typename arg3_type, typename arg4_type, typename arg5_type, \
1862 typename arg6_type, typename arg7_type, typename arg8_type, \
1863 typename arg9_type>\
1864 typename ::testing::internal::Function<F>::Result\
1865 name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
zhanyong.wan33c0af02009-04-03 00:10:12 +00001866 p5##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1867 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
shiqian326aa562009-01-09 21:43:57 +00001868
1869#define ACTION_P7(name, p0, p1, p2, p3, p4, p5, p6)\
1870 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1871 typename p3##_type, typename p4##_type, typename p5##_type, \
1872 typename p6##_type>\
1873 class name##ActionP7 {\
1874 public:\
1875 name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \
1876 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001877 p5##_type gmock_p5, \
1878 p6##_type gmock_p6) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1879 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1880 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1881 p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1882 p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
1883 p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
1884 p6(::testing::internal::forward<p6##_type>(gmock_p6)) {}\
shiqian326aa562009-01-09 21:43:57 +00001885 template <typename F>\
1886 class gmock_Impl : public ::testing::ActionInterface<F> {\
1887 public:\
1888 typedef F function_type;\
1889 typedef typename ::testing::internal::Function<F>::Result return_type;\
1890 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1891 args_type;\
1892 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1893 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001894 p6##_type gmock_p6) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1895 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1896 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1897 p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1898 p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
1899 p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
1900 p6(::testing::internal::forward<p6##_type>(gmock_p6)) {}\
shiqian326aa562009-01-09 21:43:57 +00001901 virtual return_type Perform(const args_type& args) {\
1902 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1903 Perform(this, args);\
1904 }\
1905 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1906 typename arg3_type, typename arg4_type, typename arg5_type, \
1907 typename arg6_type, typename arg7_type, typename arg8_type, \
1908 typename arg9_type>\
1909 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1910 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1911 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1912 arg9_type arg9) const;\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001913 p0##_type p0;\
1914 p1##_type p1;\
1915 p2##_type p2;\
1916 p3##_type p3;\
1917 p4##_type p4;\
1918 p5##_type p5;\
1919 p6##_type p6;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001920 private:\
1921 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
shiqian326aa562009-01-09 21:43:57 +00001922 };\
1923 template <typename F> operator ::testing::Action<F>() const {\
1924 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
1925 p6));\
1926 }\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00001927 p0##_type p0;\
1928 p1##_type p1;\
1929 p2##_type p2;\
1930 p3##_type p3;\
1931 p4##_type p4;\
1932 p5##_type p5;\
1933 p6##_type p6;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00001934 private:\
1935 GTEST_DISALLOW_ASSIGN_(name##ActionP7);\
shiqian326aa562009-01-09 21:43:57 +00001936 };\
1937 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1938 typename p3##_type, typename p4##_type, typename p5##_type, \
1939 typename p6##_type>\
1940 inline name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
1941 p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
1942 p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
1943 p6##_type p6) {\
1944 return name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
1945 p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
1946 }\
1947 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1948 typename p3##_type, typename p4##_type, typename p5##_type, \
1949 typename p6##_type>\
1950 template <typename F>\
1951 template <typename arg0_type, typename arg1_type, typename arg2_type, \
1952 typename arg3_type, typename arg4_type, typename arg5_type, \
1953 typename arg6_type, typename arg7_type, typename arg8_type, \
1954 typename arg9_type>\
1955 typename ::testing::internal::Function<F>::Result\
1956 name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
zhanyong.wan33c0af02009-04-03 00:10:12 +00001957 p5##_type, p6##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1958 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
shiqian326aa562009-01-09 21:43:57 +00001959
1960#define ACTION_P8(name, p0, p1, p2, p3, p4, p5, p6, p7)\
1961 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1962 typename p3##_type, typename p4##_type, typename p5##_type, \
1963 typename p6##_type, typename p7##_type>\
1964 class name##ActionP8 {\
1965 public:\
1966 name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \
1967 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1968 p5##_type gmock_p5, p6##_type gmock_p6, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001969 p7##_type gmock_p7) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1970 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1971 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1972 p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1973 p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
1974 p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
1975 p6(::testing::internal::forward<p6##_type>(gmock_p6)), \
1976 p7(::testing::internal::forward<p7##_type>(gmock_p7)) {}\
shiqian326aa562009-01-09 21:43:57 +00001977 template <typename F>\
1978 class gmock_Impl : public ::testing::ActionInterface<F> {\
1979 public:\
1980 typedef F function_type;\
1981 typedef typename ::testing::internal::Function<F>::Result return_type;\
1982 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1983 args_type;\
1984 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1985 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04001986 p6##_type gmock_p6, \
1987 p7##_type gmock_p7) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1988 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1989 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1990 p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1991 p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
1992 p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
1993 p6(::testing::internal::forward<p6##_type>(gmock_p6)), \
1994 p7(::testing::internal::forward<p7##_type>(gmock_p7)) {}\
shiqian326aa562009-01-09 21:43:57 +00001995 virtual return_type Perform(const args_type& args) {\
1996 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1997 Perform(this, args);\
1998 }\
1999 template <typename arg0_type, typename arg1_type, typename arg2_type, \
2000 typename arg3_type, typename arg4_type, typename arg5_type, \
2001 typename arg6_type, typename arg7_type, typename arg8_type, \
2002 typename arg9_type>\
2003 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
2004 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
2005 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
2006 arg9_type arg9) const;\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00002007 p0##_type p0;\
2008 p1##_type p1;\
2009 p2##_type p2;\
2010 p3##_type p3;\
2011 p4##_type p4;\
2012 p5##_type p5;\
2013 p6##_type p6;\
2014 p7##_type p7;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00002015 private:\
2016 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
shiqian326aa562009-01-09 21:43:57 +00002017 };\
2018 template <typename F> operator ::testing::Action<F>() const {\
2019 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
2020 p6, p7));\
2021 }\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00002022 p0##_type p0;\
2023 p1##_type p1;\
2024 p2##_type p2;\
2025 p3##_type p3;\
2026 p4##_type p4;\
2027 p5##_type p5;\
2028 p6##_type p6;\
2029 p7##_type p7;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00002030 private:\
2031 GTEST_DISALLOW_ASSIGN_(name##ActionP8);\
shiqian326aa562009-01-09 21:43:57 +00002032 };\
2033 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2034 typename p3##_type, typename p4##_type, typename p5##_type, \
2035 typename p6##_type, typename p7##_type>\
2036 inline name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
2037 p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
2038 p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
2039 p6##_type p6, p7##_type p7) {\
2040 return name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
2041 p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
2042 p6, p7);\
2043 }\
2044 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2045 typename p3##_type, typename p4##_type, typename p5##_type, \
2046 typename p6##_type, typename p7##_type>\
2047 template <typename F>\
2048 template <typename arg0_type, typename arg1_type, typename arg2_type, \
2049 typename arg3_type, typename arg4_type, typename arg5_type, \
2050 typename arg6_type, typename arg7_type, typename arg8_type, \
2051 typename arg9_type>\
2052 typename ::testing::internal::Function<F>::Result\
2053 name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
zhanyong.wan33c0af02009-04-03 00:10:12 +00002054 p5##_type, p6##_type, \
2055 p7##_type>::gmock_Impl<F>::gmock_PerformImpl(\
2056 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
shiqian326aa562009-01-09 21:43:57 +00002057
2058#define ACTION_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8)\
2059 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2060 typename p3##_type, typename p4##_type, typename p5##_type, \
2061 typename p6##_type, typename p7##_type, typename p8##_type>\
2062 class name##ActionP9 {\
2063 public:\
2064 name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \
2065 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
2066 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04002067 p8##_type gmock_p8) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
2068 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
2069 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
2070 p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
2071 p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
2072 p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
2073 p6(::testing::internal::forward<p6##_type>(gmock_p6)), \
2074 p7(::testing::internal::forward<p7##_type>(gmock_p7)), \
2075 p8(::testing::internal::forward<p8##_type>(gmock_p8)) {}\
shiqian326aa562009-01-09 21:43:57 +00002076 template <typename F>\
2077 class gmock_Impl : public ::testing::ActionInterface<F> {\
2078 public:\
2079 typedef F function_type;\
2080 typedef typename ::testing::internal::Function<F>::Result return_type;\
2081 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
2082 args_type;\
2083 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
2084 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
2085 p6##_type gmock_p6, p7##_type gmock_p7, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04002086 p8##_type gmock_p8) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
2087 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
2088 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
2089 p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
2090 p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
2091 p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
2092 p6(::testing::internal::forward<p6##_type>(gmock_p6)), \
2093 p7(::testing::internal::forward<p7##_type>(gmock_p7)), \
2094 p8(::testing::internal::forward<p8##_type>(gmock_p8)) {}\
shiqian326aa562009-01-09 21:43:57 +00002095 virtual return_type Perform(const args_type& args) {\
2096 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
2097 Perform(this, args);\
2098 }\
2099 template <typename arg0_type, typename arg1_type, typename arg2_type, \
2100 typename arg3_type, typename arg4_type, typename arg5_type, \
2101 typename arg6_type, typename arg7_type, typename arg8_type, \
2102 typename arg9_type>\
2103 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
2104 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
2105 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
2106 arg9_type arg9) const;\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00002107 p0##_type p0;\
2108 p1##_type p1;\
2109 p2##_type p2;\
2110 p3##_type p3;\
2111 p4##_type p4;\
2112 p5##_type p5;\
2113 p6##_type p6;\
2114 p7##_type p7;\
2115 p8##_type p8;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00002116 private:\
2117 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
shiqian326aa562009-01-09 21:43:57 +00002118 };\
2119 template <typename F> operator ::testing::Action<F>() const {\
2120 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
2121 p6, p7, p8));\
2122 }\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00002123 p0##_type p0;\
2124 p1##_type p1;\
2125 p2##_type p2;\
2126 p3##_type p3;\
2127 p4##_type p4;\
2128 p5##_type p5;\
2129 p6##_type p6;\
2130 p7##_type p7;\
2131 p8##_type p8;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00002132 private:\
2133 GTEST_DISALLOW_ASSIGN_(name##ActionP9);\
shiqian326aa562009-01-09 21:43:57 +00002134 };\
2135 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2136 typename p3##_type, typename p4##_type, typename p5##_type, \
2137 typename p6##_type, typename p7##_type, typename p8##_type>\
2138 inline name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
2139 p4##_type, p5##_type, p6##_type, p7##_type, \
2140 p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
2141 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
2142 p8##_type p8) {\
2143 return name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
2144 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
2145 p3, p4, p5, p6, p7, p8);\
2146 }\
2147 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2148 typename p3##_type, typename p4##_type, typename p5##_type, \
2149 typename p6##_type, typename p7##_type, typename p8##_type>\
2150 template <typename F>\
2151 template <typename arg0_type, typename arg1_type, typename arg2_type, \
2152 typename arg3_type, typename arg4_type, typename arg5_type, \
2153 typename arg6_type, typename arg7_type, typename arg8_type, \
2154 typename arg9_type>\
2155 typename ::testing::internal::Function<F>::Result\
2156 name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
zhanyong.wan33c0af02009-04-03 00:10:12 +00002157 p5##_type, p6##_type, p7##_type, \
2158 p8##_type>::gmock_Impl<F>::gmock_PerformImpl(\
2159 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
shiqian326aa562009-01-09 21:43:57 +00002160
2161#define ACTION_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)\
2162 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2163 typename p3##_type, typename p4##_type, typename p5##_type, \
2164 typename p6##_type, typename p7##_type, typename p8##_type, \
2165 typename p9##_type>\
2166 class name##ActionP10 {\
2167 public:\
2168 name##ActionP10(p0##_type gmock_p0, p1##_type gmock_p1, \
2169 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
2170 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04002171 p8##_type gmock_p8, \
2172 p9##_type gmock_p9) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
2173 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
2174 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
2175 p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
2176 p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
2177 p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
2178 p6(::testing::internal::forward<p6##_type>(gmock_p6)), \
2179 p7(::testing::internal::forward<p7##_type>(gmock_p7)), \
2180 p8(::testing::internal::forward<p8##_type>(gmock_p8)), \
2181 p9(::testing::internal::forward<p9##_type>(gmock_p9)) {}\
shiqian326aa562009-01-09 21:43:57 +00002182 template <typename F>\
2183 class gmock_Impl : public ::testing::ActionInterface<F> {\
2184 public:\
2185 typedef F function_type;\
2186 typedef typename ::testing::internal::Function<F>::Result return_type;\
2187 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
2188 args_type;\
2189 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
2190 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
2191 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
Gennadiy Civile1071eb2018-04-10 15:57:16 -04002192 p9##_type gmock_p9) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
2193 p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
2194 p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
2195 p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
2196 p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
2197 p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
2198 p6(::testing::internal::forward<p6##_type>(gmock_p6)), \
2199 p7(::testing::internal::forward<p7##_type>(gmock_p7)), \
2200 p8(::testing::internal::forward<p8##_type>(gmock_p8)), \
2201 p9(::testing::internal::forward<p9##_type>(gmock_p9)) {}\
shiqian326aa562009-01-09 21:43:57 +00002202 virtual return_type Perform(const args_type& args) {\
2203 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
2204 Perform(this, args);\
2205 }\
2206 template <typename arg0_type, typename arg1_type, typename arg2_type, \
2207 typename arg3_type, typename arg4_type, typename arg5_type, \
2208 typename arg6_type, typename arg7_type, typename arg8_type, \
2209 typename arg9_type>\
2210 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
2211 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
2212 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
2213 arg9_type arg9) const;\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00002214 p0##_type p0;\
2215 p1##_type p1;\
2216 p2##_type p2;\
2217 p3##_type p3;\
2218 p4##_type p4;\
2219 p5##_type p5;\
2220 p6##_type p6;\
2221 p7##_type p7;\
2222 p8##_type p8;\
2223 p9##_type p9;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00002224 private:\
2225 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
shiqian326aa562009-01-09 21:43:57 +00002226 };\
2227 template <typename F> operator ::testing::Action<F>() const {\
2228 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
2229 p6, p7, p8, p9));\
2230 }\
zhanyong.wanc069d7f2009-02-02 20:51:53 +00002231 p0##_type p0;\
2232 p1##_type p1;\
2233 p2##_type p2;\
2234 p3##_type p3;\
2235 p4##_type p4;\
2236 p5##_type p5;\
2237 p6##_type p6;\
2238 p7##_type p7;\
2239 p8##_type p8;\
2240 p9##_type p9;\
zhanyong.wan32de5f52009-12-23 00:13:23 +00002241 private:\
2242 GTEST_DISALLOW_ASSIGN_(name##ActionP10);\
shiqian326aa562009-01-09 21:43:57 +00002243 };\
2244 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2245 typename p3##_type, typename p4##_type, typename p5##_type, \
2246 typename p6##_type, typename p7##_type, typename p8##_type, \
2247 typename p9##_type>\
2248 inline name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2249 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
2250 p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
2251 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
2252 p9##_type p9) {\
2253 return name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2254 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
2255 p1, p2, p3, p4, p5, p6, p7, p8, p9);\
2256 }\
2257 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2258 typename p3##_type, typename p4##_type, typename p5##_type, \
2259 typename p6##_type, typename p7##_type, typename p8##_type, \
2260 typename p9##_type>\
2261 template <typename F>\
2262 template <typename arg0_type, typename arg1_type, typename arg2_type, \
2263 typename arg3_type, typename arg4_type, typename arg5_type, \
2264 typename arg6_type, typename arg7_type, typename arg8_type, \
2265 typename arg9_type>\
2266 typename ::testing::internal::Function<F>::Result\
2267 name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
zhanyong.wan33c0af02009-04-03 00:10:12 +00002268 p5##_type, p6##_type, p7##_type, p8##_type, \
2269 p9##_type>::gmock_Impl<F>::gmock_PerformImpl(\
2270 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
shiqian326aa562009-01-09 21:43:57 +00002271
zhanyong.wane1cdce52009-02-06 01:09:43 +00002272namespace testing {
2273
kosak67c377d2015-07-19 20:39:47 +00002274
zhanyong.wan32de5f52009-12-23 00:13:23 +00002275// The ACTION*() macros trigger warning C4100 (unreferenced formal
2276// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
2277// the macro definition, as the warnings are generated when the macro
2278// is expanded and macro expansion cannot contain #pragma. Therefore
2279// we suppress them here.
2280#ifdef _MSC_VER
zhanyong.wan658ac0b2011-02-24 07:29:13 +00002281# pragma warning(push)
2282# pragma warning(disable:4100)
zhanyong.wan32de5f52009-12-23 00:13:23 +00002283#endif
2284
zhanyong.wan16cf4732009-05-14 20:55:30 +00002285// Various overloads for InvokeArgument<N>().
2286//
2287// The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th
2288// (0-based) argument, which must be a k-ary callable, of the mock
2289// function, with arguments a1, a2, ..., a_k.
2290//
2291// Notes:
2292//
2293// 1. The arguments are passed by value by default. If you need to
2294// pass an argument by reference, wrap it inside ByRef(). For
2295// example,
2296//
2297// InvokeArgument<1>(5, string("Hello"), ByRef(foo))
2298//
2299// passes 5 and string("Hello") by value, and passes foo by
2300// reference.
2301//
2302// 2. If the callable takes an argument by reference but ByRef() is
2303// not used, it will receive the reference to a copy of the value,
2304// instead of the original value. For example, when the 0-th
2305// argument of the mock function takes a const string&, the action
2306//
2307// InvokeArgument<0>(string("Hello"))
2308//
2309// makes a copy of the temporary string("Hello") object and passes a
2310// reference of the copy, instead of the original temporary object,
2311// to the callable. This makes it easy for a user to define an
2312// InvokeArgument action from temporary values and have it performed
2313// later.
zhanyong.wan7f4c2c02009-02-19 22:38:27 +00002314
kosak67c377d2015-07-19 20:39:47 +00002315namespace internal {
2316namespace invoke_argument {
2317
2318// Appears in InvokeArgumentAdl's argument list to help avoid
2319// accidental calls to user functions of the same name.
2320struct AdlTag {};
2321
2322// InvokeArgumentAdl - a helper for InvokeArgument.
2323// The basic overloads are provided here for generic functors.
2324// Overloads for other custom-callables are provided in the
2325// internal/custom/callback-actions.h header.
2326
2327template <typename R, typename F>
2328R InvokeArgumentAdl(AdlTag, F f) {
2329 return f();
2330}
2331template <typename R, typename F, typename A1>
2332R InvokeArgumentAdl(AdlTag, F f, A1 a1) {
2333 return f(a1);
2334}
2335template <typename R, typename F, typename A1, typename A2>
2336R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2) {
2337 return f(a1, a2);
2338}
2339template <typename R, typename F, typename A1, typename A2, typename A3>
2340R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3) {
2341 return f(a1, a2, a3);
2342}
2343template <typename R, typename F, typename A1, typename A2, typename A3,
2344 typename A4>
2345R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4) {
2346 return f(a1, a2, a3, a4);
2347}
2348template <typename R, typename F, typename A1, typename A2, typename A3,
2349 typename A4, typename A5>
2350R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
2351 return f(a1, a2, a3, a4, a5);
2352}
2353template <typename R, typename F, typename A1, typename A2, typename A3,
2354 typename A4, typename A5, typename A6>
2355R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
2356 return f(a1, a2, a3, a4, a5, a6);
2357}
2358template <typename R, typename F, typename A1, typename A2, typename A3,
2359 typename A4, typename A5, typename A6, typename A7>
2360R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
2361 A7 a7) {
2362 return f(a1, a2, a3, a4, a5, a6, a7);
2363}
2364template <typename R, typename F, typename A1, typename A2, typename A3,
2365 typename A4, typename A5, typename A6, typename A7, typename A8>
2366R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
2367 A7 a7, A8 a8) {
2368 return f(a1, a2, a3, a4, a5, a6, a7, a8);
2369}
2370template <typename R, typename F, typename A1, typename A2, typename A3,
2371 typename A4, typename A5, typename A6, typename A7, typename A8,
2372 typename A9>
2373R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
2374 A7 a7, A8 a8, A9 a9) {
2375 return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
2376}
2377template <typename R, typename F, typename A1, typename A2, typename A3,
2378 typename A4, typename A5, typename A6, typename A7, typename A8,
2379 typename A9, typename A10>
2380R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
2381 A7 a7, A8 a8, A9 a9, A10 a10) {
2382 return f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
2383}
2384} // namespace invoke_argument
2385} // namespace internal
2386
zhanyong.wan16cf4732009-05-14 20:55:30 +00002387ACTION_TEMPLATE(InvokeArgument,
2388 HAS_1_TEMPLATE_PARAMS(int, k),
2389 AND_0_VALUE_PARAMS()) {
kosak67c377d2015-07-19 20:39:47 +00002390 using internal::invoke_argument::InvokeArgumentAdl;
2391 return InvokeArgumentAdl<return_type>(
2392 internal::invoke_argument::AdlTag(),
kosakbd018832014-04-02 20:30:00 +00002393 ::testing::get<k>(args));
zhanyong.wan7f4c2c02009-02-19 22:38:27 +00002394}
2395
zhanyong.wan16cf4732009-05-14 20:55:30 +00002396ACTION_TEMPLATE(InvokeArgument,
2397 HAS_1_TEMPLATE_PARAMS(int, k),
2398 AND_1_VALUE_PARAMS(p0)) {
kosak67c377d2015-07-19 20:39:47 +00002399 using internal::invoke_argument::InvokeArgumentAdl;
2400 return InvokeArgumentAdl<return_type>(
2401 internal::invoke_argument::AdlTag(),
kosakbd018832014-04-02 20:30:00 +00002402 ::testing::get<k>(args), p0);
zhanyong.wan16cf4732009-05-14 20:55:30 +00002403}
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002404
zhanyong.wan16cf4732009-05-14 20:55:30 +00002405ACTION_TEMPLATE(InvokeArgument,
2406 HAS_1_TEMPLATE_PARAMS(int, k),
2407 AND_2_VALUE_PARAMS(p0, p1)) {
kosak67c377d2015-07-19 20:39:47 +00002408 using internal::invoke_argument::InvokeArgumentAdl;
2409 return InvokeArgumentAdl<return_type>(
2410 internal::invoke_argument::AdlTag(),
kosakbd018832014-04-02 20:30:00 +00002411 ::testing::get<k>(args), p0, p1);
zhanyong.wan16cf4732009-05-14 20:55:30 +00002412}
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002413
zhanyong.wan16cf4732009-05-14 20:55:30 +00002414ACTION_TEMPLATE(InvokeArgument,
2415 HAS_1_TEMPLATE_PARAMS(int, k),
2416 AND_3_VALUE_PARAMS(p0, p1, p2)) {
kosak67c377d2015-07-19 20:39:47 +00002417 using internal::invoke_argument::InvokeArgumentAdl;
2418 return InvokeArgumentAdl<return_type>(
2419 internal::invoke_argument::AdlTag(),
kosakbd018832014-04-02 20:30:00 +00002420 ::testing::get<k>(args), p0, p1, p2);
zhanyong.wan16cf4732009-05-14 20:55:30 +00002421}
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002422
zhanyong.wan16cf4732009-05-14 20:55:30 +00002423ACTION_TEMPLATE(InvokeArgument,
2424 HAS_1_TEMPLATE_PARAMS(int, k),
2425 AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
kosak67c377d2015-07-19 20:39:47 +00002426 using internal::invoke_argument::InvokeArgumentAdl;
2427 return InvokeArgumentAdl<return_type>(
2428 internal::invoke_argument::AdlTag(),
kosakbd018832014-04-02 20:30:00 +00002429 ::testing::get<k>(args), p0, p1, p2, p3);
zhanyong.wan16cf4732009-05-14 20:55:30 +00002430}
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002431
zhanyong.wan16cf4732009-05-14 20:55:30 +00002432ACTION_TEMPLATE(InvokeArgument,
2433 HAS_1_TEMPLATE_PARAMS(int, k),
2434 AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
kosak67c377d2015-07-19 20:39:47 +00002435 using internal::invoke_argument::InvokeArgumentAdl;
2436 return InvokeArgumentAdl<return_type>(
2437 internal::invoke_argument::AdlTag(),
kosakbd018832014-04-02 20:30:00 +00002438 ::testing::get<k>(args), p0, p1, p2, p3, p4);
zhanyong.wan16cf4732009-05-14 20:55:30 +00002439}
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002440
zhanyong.wan16cf4732009-05-14 20:55:30 +00002441ACTION_TEMPLATE(InvokeArgument,
2442 HAS_1_TEMPLATE_PARAMS(int, k),
2443 AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
kosak67c377d2015-07-19 20:39:47 +00002444 using internal::invoke_argument::InvokeArgumentAdl;
2445 return InvokeArgumentAdl<return_type>(
2446 internal::invoke_argument::AdlTag(),
kosakbd018832014-04-02 20:30:00 +00002447 ::testing::get<k>(args), p0, p1, p2, p3, p4, p5);
zhanyong.wan16cf4732009-05-14 20:55:30 +00002448}
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002449
zhanyong.wan16cf4732009-05-14 20:55:30 +00002450ACTION_TEMPLATE(InvokeArgument,
2451 HAS_1_TEMPLATE_PARAMS(int, k),
2452 AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
kosak67c377d2015-07-19 20:39:47 +00002453 using internal::invoke_argument::InvokeArgumentAdl;
2454 return InvokeArgumentAdl<return_type>(
2455 internal::invoke_argument::AdlTag(),
kosakbd018832014-04-02 20:30:00 +00002456 ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6);
zhanyong.wan16cf4732009-05-14 20:55:30 +00002457}
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002458
zhanyong.wan16cf4732009-05-14 20:55:30 +00002459ACTION_TEMPLATE(InvokeArgument,
2460 HAS_1_TEMPLATE_PARAMS(int, k),
2461 AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
kosak67c377d2015-07-19 20:39:47 +00002462 using internal::invoke_argument::InvokeArgumentAdl;
2463 return InvokeArgumentAdl<return_type>(
2464 internal::invoke_argument::AdlTag(),
kosakbd018832014-04-02 20:30:00 +00002465 ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7);
zhanyong.wan16cf4732009-05-14 20:55:30 +00002466}
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002467
zhanyong.wan16cf4732009-05-14 20:55:30 +00002468ACTION_TEMPLATE(InvokeArgument,
2469 HAS_1_TEMPLATE_PARAMS(int, k),
2470 AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
kosak67c377d2015-07-19 20:39:47 +00002471 using internal::invoke_argument::InvokeArgumentAdl;
2472 return InvokeArgumentAdl<return_type>(
2473 internal::invoke_argument::AdlTag(),
kosakbd018832014-04-02 20:30:00 +00002474 ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8);
zhanyong.wan16cf4732009-05-14 20:55:30 +00002475}
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002476
zhanyong.wan16cf4732009-05-14 20:55:30 +00002477ACTION_TEMPLATE(InvokeArgument,
2478 HAS_1_TEMPLATE_PARAMS(int, k),
2479 AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
kosak67c377d2015-07-19 20:39:47 +00002480 using internal::invoke_argument::InvokeArgumentAdl;
2481 return InvokeArgumentAdl<return_type>(
2482 internal::invoke_argument::AdlTag(),
kosakbd018832014-04-02 20:30:00 +00002483 ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
zhanyong.wan16cf4732009-05-14 20:55:30 +00002484}
zhanyong.wan7f4c2c02009-02-19 22:38:27 +00002485
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002486// Various overloads for ReturnNew<T>().
2487//
2488// The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
2489// instance of type T, constructed on the heap with constructor arguments
2490// a1, a2, ..., and a_k. The caller assumes ownership of the returned value.
zhanyong.wan16cf4732009-05-14 20:55:30 +00002491ACTION_TEMPLATE(ReturnNew,
2492 HAS_1_TEMPLATE_PARAMS(typename, T),
2493 AND_0_VALUE_PARAMS()) {
2494 return new T();
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002495}
2496
zhanyong.wan16cf4732009-05-14 20:55:30 +00002497ACTION_TEMPLATE(ReturnNew,
2498 HAS_1_TEMPLATE_PARAMS(typename, T),
2499 AND_1_VALUE_PARAMS(p0)) {
2500 return new T(p0);
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002501}
2502
zhanyong.wan16cf4732009-05-14 20:55:30 +00002503ACTION_TEMPLATE(ReturnNew,
2504 HAS_1_TEMPLATE_PARAMS(typename, T),
2505 AND_2_VALUE_PARAMS(p0, p1)) {
2506 return new T(p0, p1);
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002507}
2508
zhanyong.wan16cf4732009-05-14 20:55:30 +00002509ACTION_TEMPLATE(ReturnNew,
2510 HAS_1_TEMPLATE_PARAMS(typename, T),
2511 AND_3_VALUE_PARAMS(p0, p1, p2)) {
2512 return new T(p0, p1, p2);
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002513}
2514
zhanyong.wan16cf4732009-05-14 20:55:30 +00002515ACTION_TEMPLATE(ReturnNew,
2516 HAS_1_TEMPLATE_PARAMS(typename, T),
2517 AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
2518 return new T(p0, p1, p2, p3);
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002519}
2520
zhanyong.wan16cf4732009-05-14 20:55:30 +00002521ACTION_TEMPLATE(ReturnNew,
2522 HAS_1_TEMPLATE_PARAMS(typename, T),
2523 AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
2524 return new T(p0, p1, p2, p3, p4);
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002525}
2526
zhanyong.wan16cf4732009-05-14 20:55:30 +00002527ACTION_TEMPLATE(ReturnNew,
2528 HAS_1_TEMPLATE_PARAMS(typename, T),
2529 AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
2530 return new T(p0, p1, p2, p3, p4, p5);
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002531}
2532
zhanyong.wan16cf4732009-05-14 20:55:30 +00002533ACTION_TEMPLATE(ReturnNew,
2534 HAS_1_TEMPLATE_PARAMS(typename, T),
2535 AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
2536 return new T(p0, p1, p2, p3, p4, p5, p6);
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002537}
2538
zhanyong.wan16cf4732009-05-14 20:55:30 +00002539ACTION_TEMPLATE(ReturnNew,
2540 HAS_1_TEMPLATE_PARAMS(typename, T),
2541 AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
2542 return new T(p0, p1, p2, p3, p4, p5, p6, p7);
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002543}
2544
zhanyong.wan16cf4732009-05-14 20:55:30 +00002545ACTION_TEMPLATE(ReturnNew,
2546 HAS_1_TEMPLATE_PARAMS(typename, T),
2547 AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
2548 return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8);
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002549}
2550
zhanyong.wan16cf4732009-05-14 20:55:30 +00002551ACTION_TEMPLATE(ReturnNew,
2552 HAS_1_TEMPLATE_PARAMS(typename, T),
2553 AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
2554 return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
zhanyong.wan1c8eb1c2009-04-09 07:29:58 +00002555}
2556
zhanyong.wan32de5f52009-12-23 00:13:23 +00002557#ifdef _MSC_VER
zhanyong.wan658ac0b2011-02-24 07:29:13 +00002558# pragma warning(pop)
zhanyong.wan32de5f52009-12-23 00:13:23 +00002559#endif
2560
zhanyong.wane1cdce52009-02-06 01:09:43 +00002561} // namespace testing
2562
Gennadiy Civile1071eb2018-04-10 15:57:16 -04002563// Include any custom callback actions added by the local installation.
kosak67c377d2015-07-19 20:39:47 +00002564// We must include this header at the end to make sure it can use the
2565// declarations from this file.
kosak6e108722015-07-28 00:53:13 +00002566#include "gmock/internal/custom/gmock-generated-actions.h"
kosak67c377d2015-07-19 20:39:47 +00002567
shiqiane35fdd92008-12-10 05:08:54 +00002568#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_