00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
00041 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
00042
00043 #include "gmock/gmock-spec-builders.h"
00044 #include "gmock/internal/gmock-internal-utils.h"
00045
00046 #if GTEST_HAS_STD_FUNCTION_
00047 # include <functional>
00048 #endif
00049
00050 namespace testing {
00051 namespace internal {
00052
00053 template <typename F>
00054 class FunctionMockerBase;
00055
00056
00057
00058
00059
00060
00061 template <typename F>
00062 class FunctionMocker;
00063
00064 template <typename R>
00065 class FunctionMocker<R()> : public
00066 internal::FunctionMockerBase<R()> {
00067 public:
00068 typedef R F();
00069 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
00070
00071 MockSpec<F>& With() {
00072 return this->current_spec();
00073 }
00074
00075 R Invoke() {
00076
00077
00078
00079
00080 return this->InvokeWith(ArgumentTuple());
00081 }
00082 };
00083
00084 template <typename R, typename A1>
00085 class FunctionMocker<R(A1)> : public
00086 internal::FunctionMockerBase<R(A1)> {
00087 public:
00088 typedef R F(A1);
00089 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
00090
00091 MockSpec<F>& With(const Matcher<A1>& m1) {
00092 this->current_spec().SetMatchers(::testing::make_tuple(m1));
00093 return this->current_spec();
00094 }
00095
00096 R Invoke(A1 a1) {
00097
00098
00099
00100
00101 return this->InvokeWith(ArgumentTuple(a1));
00102 }
00103 };
00104
00105 template <typename R, typename A1, typename A2>
00106 class FunctionMocker<R(A1, A2)> : public
00107 internal::FunctionMockerBase<R(A1, A2)> {
00108 public:
00109 typedef R F(A1, A2);
00110 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
00111
00112 MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2) {
00113 this->current_spec().SetMatchers(::testing::make_tuple(m1, m2));
00114 return this->current_spec();
00115 }
00116
00117 R Invoke(A1 a1, A2 a2) {
00118
00119
00120
00121
00122 return this->InvokeWith(ArgumentTuple(a1, a2));
00123 }
00124 };
00125
00126 template <typename R, typename A1, typename A2, typename A3>
00127 class FunctionMocker<R(A1, A2, A3)> : public
00128 internal::FunctionMockerBase<R(A1, A2, A3)> {
00129 public:
00130 typedef R F(A1, A2, A3);
00131 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
00132
00133 MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
00134 const Matcher<A3>& m3) {
00135 this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3));
00136 return this->current_spec();
00137 }
00138
00139 R Invoke(A1 a1, A2 a2, A3 a3) {
00140
00141
00142
00143
00144 return this->InvokeWith(ArgumentTuple(a1, a2, a3));
00145 }
00146 };
00147
00148 template <typename R, typename A1, typename A2, typename A3, typename A4>
00149 class FunctionMocker<R(A1, A2, A3, A4)> : public
00150 internal::FunctionMockerBase<R(A1, A2, A3, A4)> {
00151 public:
00152 typedef R F(A1, A2, A3, A4);
00153 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
00154
00155 MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
00156 const Matcher<A3>& m3, const Matcher<A4>& m4) {
00157 this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4));
00158 return this->current_spec();
00159 }
00160
00161 R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) {
00162
00163
00164
00165
00166 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4));
00167 }
00168 };
00169
00170 template <typename R, typename A1, typename A2, typename A3, typename A4,
00171 typename A5>
00172 class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
00173 internal::FunctionMockerBase<R(A1, A2, A3, A4, A5)> {
00174 public:
00175 typedef R F(A1, A2, A3, A4, A5);
00176 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
00177
00178 MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
00179 const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5) {
00180 this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5));
00181 return this->current_spec();
00182 }
00183
00184 R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
00185
00186
00187
00188
00189 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5));
00190 }
00191 };
00192
00193 template <typename R, typename A1, typename A2, typename A3, typename A4,
00194 typename A5, typename A6>
00195 class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
00196 internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6)> {
00197 public:
00198 typedef R F(A1, A2, A3, A4, A5, A6);
00199 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
00200
00201 MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
00202 const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
00203 const Matcher<A6>& m6) {
00204 this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
00205 m6));
00206 return this->current_spec();
00207 }
00208
00209 R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
00210
00211
00212
00213
00214 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6));
00215 }
00216 };
00217
00218 template <typename R, typename A1, typename A2, typename A3, typename A4,
00219 typename A5, typename A6, typename A7>
00220 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
00221 internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7)> {
00222 public:
00223 typedef R F(A1, A2, A3, A4, A5, A6, A7);
00224 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
00225
00226 MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
00227 const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
00228 const Matcher<A6>& m6, const Matcher<A7>& m7) {
00229 this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
00230 m6, m7));
00231 return this->current_spec();
00232 }
00233
00234 R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) {
00235
00236
00237
00238
00239 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7));
00240 }
00241 };
00242
00243 template <typename R, typename A1, typename A2, typename A3, typename A4,
00244 typename A5, typename A6, typename A7, typename A8>
00245 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
00246 internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
00247 public:
00248 typedef R F(A1, A2, A3, A4, A5, A6, A7, A8);
00249 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
00250
00251 MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
00252 const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
00253 const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8) {
00254 this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
00255 m6, m7, m8));
00256 return this->current_spec();
00257 }
00258
00259 R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) {
00260
00261
00262
00263
00264 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8));
00265 }
00266 };
00267
00268 template <typename R, typename A1, typename A2, typename A3, typename A4,
00269 typename A5, typename A6, typename A7, typename A8, typename A9>
00270 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
00271 internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
00272 public:
00273 typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9);
00274 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
00275
00276 MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
00277 const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
00278 const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
00279 const Matcher<A9>& m9) {
00280 this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
00281 m6, m7, m8, m9));
00282 return this->current_spec();
00283 }
00284
00285 R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) {
00286
00287
00288
00289
00290 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9));
00291 }
00292 };
00293
00294 template <typename R, typename A1, typename A2, typename A3, typename A4,
00295 typename A5, typename A6, typename A7, typename A8, typename A9,
00296 typename A10>
00297 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
00298 internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> {
00299 public:
00300 typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
00301 typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
00302
00303 MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
00304 const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
00305 const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
00306 const Matcher<A9>& m9, const Matcher<A10>& m10) {
00307 this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
00308 m6, m7, m8, m9, m10));
00309 return this->current_spec();
00310 }
00311
00312 R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
00313 A10 a10) {
00314
00315
00316
00317
00318 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9,
00319 a10));
00320 }
00321 };
00322
00323 }
00324
00325
00326
00327
00328
00329
00330 using internal::FunctionMocker;
00331
00332
00333
00334
00335
00336
00337 #define GMOCK_RESULT_(tn, ...) \
00338 tn ::testing::internal::Function<__VA_ARGS__>::Result
00339
00340
00341
00342 #define GMOCK_ARG_(tn, N, ...) \
00343 tn ::testing::internal::Function<__VA_ARGS__>::Argument##N
00344
00345
00346
00347 #define GMOCK_MATCHER_(tn, N, ...) \
00348 const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&
00349
00350
00351
00352 #define GMOCK_MOCKER_(arity, constness, Method) \
00353 GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
00354
00355
00356 #define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
00357 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
00358 ) constness { \
00359 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
00360 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
00361 == 0), \
00362 this_method_does_not_take_0_arguments); \
00363 GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \
00364 return GMOCK_MOCKER_(0, constness, Method).Invoke(); \
00365 } \
00366 ::testing::MockSpec<__VA_ARGS__>& \
00367 gmock_##Method() constness { \
00368 GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \
00369 return GMOCK_MOCKER_(0, constness, Method).With(); \
00370 } \
00371 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \
00372 Method)
00373
00374
00375 #define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
00376 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
00377 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
00378 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
00379 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
00380 == 1), \
00381 this_method_does_not_take_1_argument); \
00382 GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \
00383 return GMOCK_MOCKER_(1, constness, Method).Invoke(gmock_a1); \
00384 } \
00385 ::testing::MockSpec<__VA_ARGS__>& \
00386 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
00387 GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \
00388 return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \
00389 } \
00390 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \
00391 Method)
00392
00393
00394 #define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \
00395 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
00396 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
00397 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
00398 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
00399 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
00400 == 2), \
00401 this_method_does_not_take_2_arguments); \
00402 GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \
00403 return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2); \
00404 } \
00405 ::testing::MockSpec<__VA_ARGS__>& \
00406 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
00407 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
00408 GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \
00409 return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \
00410 } \
00411 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \
00412 Method)
00413
00414
00415 #define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \
00416 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
00417 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
00418 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
00419 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
00420 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
00421 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
00422 == 3), \
00423 this_method_does_not_take_3_arguments); \
00424 GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \
00425 return GMOCK_MOCKER_(3, constness, Method).Invoke(gmock_a1, gmock_a2, \
00426 gmock_a3); \
00427 } \
00428 ::testing::MockSpec<__VA_ARGS__>& \
00429 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
00430 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
00431 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
00432 GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \
00433 return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \
00434 gmock_a3); \
00435 } \
00436 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \
00437 Method)
00438
00439
00440 #define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \
00441 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
00442 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
00443 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
00444 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
00445 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
00446 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
00447 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
00448 == 4), \
00449 this_method_does_not_take_4_arguments); \
00450 GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \
00451 return GMOCK_MOCKER_(4, constness, Method).Invoke(gmock_a1, gmock_a2, \
00452 gmock_a3, gmock_a4); \
00453 } \
00454 ::testing::MockSpec<__VA_ARGS__>& \
00455 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
00456 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
00457 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
00458 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
00459 GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \
00460 return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \
00461 gmock_a3, gmock_a4); \
00462 } \
00463 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \
00464 Method)
00465
00466
00467 #define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \
00468 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
00469 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
00470 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
00471 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
00472 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
00473 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
00474 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
00475 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
00476 == 5), \
00477 this_method_does_not_take_5_arguments); \
00478 GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \
00479 return GMOCK_MOCKER_(5, constness, Method).Invoke(gmock_a1, gmock_a2, \
00480 gmock_a3, gmock_a4, gmock_a5); \
00481 } \
00482 ::testing::MockSpec<__VA_ARGS__>& \
00483 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
00484 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
00485 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
00486 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
00487 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
00488 GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \
00489 return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \
00490 gmock_a3, gmock_a4, gmock_a5); \
00491 } \
00492 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \
00493 Method)
00494
00495
00496 #define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \
00497 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
00498 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
00499 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
00500 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
00501 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
00502 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
00503 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
00504 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
00505 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
00506 == 6), \
00507 this_method_does_not_take_6_arguments); \
00508 GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \
00509 return GMOCK_MOCKER_(6, constness, Method).Invoke(gmock_a1, gmock_a2, \
00510 gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
00511 } \
00512 ::testing::MockSpec<__VA_ARGS__>& \
00513 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
00514 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
00515 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
00516 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
00517 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
00518 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
00519 GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \
00520 return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \
00521 gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
00522 } \
00523 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \
00524 Method)
00525
00526
00527 #define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \
00528 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
00529 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
00530 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
00531 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
00532 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
00533 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
00534 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
00535 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
00536 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
00537 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
00538 == 7), \
00539 this_method_does_not_take_7_arguments); \
00540 GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \
00541 return GMOCK_MOCKER_(7, constness, Method).Invoke(gmock_a1, gmock_a2, \
00542 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
00543 } \
00544 ::testing::MockSpec<__VA_ARGS__>& \
00545 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
00546 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
00547 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
00548 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
00549 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
00550 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
00551 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
00552 GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \
00553 return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \
00554 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
00555 } \
00556 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \
00557 Method)
00558
00559
00560 #define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \
00561 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
00562 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
00563 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
00564 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
00565 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
00566 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
00567 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
00568 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
00569 GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
00570 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
00571 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
00572 == 8), \
00573 this_method_does_not_take_8_arguments); \
00574 GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \
00575 return GMOCK_MOCKER_(8, constness, Method).Invoke(gmock_a1, gmock_a2, \
00576 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
00577 } \
00578 ::testing::MockSpec<__VA_ARGS__>& \
00579 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
00580 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
00581 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
00582 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
00583 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
00584 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
00585 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
00586 GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
00587 GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \
00588 return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \
00589 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
00590 } \
00591 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \
00592 Method)
00593
00594
00595 #define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \
00596 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
00597 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
00598 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
00599 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
00600 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
00601 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
00602 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
00603 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
00604 GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
00605 GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
00606 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
00607 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
00608 == 9), \
00609 this_method_does_not_take_9_arguments); \
00610 GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \
00611 return GMOCK_MOCKER_(9, constness, Method).Invoke(gmock_a1, gmock_a2, \
00612 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
00613 gmock_a9); \
00614 } \
00615 ::testing::MockSpec<__VA_ARGS__>& \
00616 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
00617 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
00618 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
00619 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
00620 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
00621 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
00622 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
00623 GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
00624 GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
00625 GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \
00626 return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \
00627 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
00628 gmock_a9); \
00629 } \
00630 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \
00631 Method)
00632
00633
00634 #define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \
00635 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
00636 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
00637 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
00638 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
00639 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
00640 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
00641 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
00642 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
00643 GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
00644 GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
00645 GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
00646 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
00647 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
00648 == 10), \
00649 this_method_does_not_take_10_arguments); \
00650 GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \
00651 return GMOCK_MOCKER_(10, constness, Method).Invoke(gmock_a1, gmock_a2, \
00652 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
00653 gmock_a10); \
00654 } \
00655 ::testing::MockSpec<__VA_ARGS__>& \
00656 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
00657 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
00658 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
00659 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
00660 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
00661 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
00662 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
00663 GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
00664 GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \
00665 GMOCK_MATCHER_(tn, 10, \
00666 __VA_ARGS__) gmock_a10) constness { \
00667 GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \
00668 return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \
00669 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
00670 gmock_a10); \
00671 } \
00672 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \
00673 Method)
00674
00675 #define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__)
00676 #define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__)
00677 #define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)
00678 #define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__)
00679 #define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__)
00680 #define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__)
00681 #define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__)
00682 #define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__)
00683 #define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__)
00684 #define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__)
00685 #define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__)
00686
00687 #define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__)
00688 #define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__)
00689 #define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__)
00690 #define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__)
00691 #define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__)
00692 #define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__)
00693 #define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__)
00694 #define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__)
00695 #define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__)
00696 #define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__)
00697 #define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__)
00698
00699 #define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__)
00700 #define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__)
00701 #define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__)
00702 #define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__)
00703 #define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__)
00704 #define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__)
00705 #define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__)
00706 #define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__)
00707 #define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__)
00708 #define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__)
00709 #define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__)
00710
00711 #define MOCK_CONST_METHOD0_T(m, ...) \
00712 GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__)
00713 #define MOCK_CONST_METHOD1_T(m, ...) \
00714 GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__)
00715 #define MOCK_CONST_METHOD2_T(m, ...) \
00716 GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__)
00717 #define MOCK_CONST_METHOD3_T(m, ...) \
00718 GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__)
00719 #define MOCK_CONST_METHOD4_T(m, ...) \
00720 GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__)
00721 #define MOCK_CONST_METHOD5_T(m, ...) \
00722 GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__)
00723 #define MOCK_CONST_METHOD6_T(m, ...) \
00724 GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__)
00725 #define MOCK_CONST_METHOD7_T(m, ...) \
00726 GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__)
00727 #define MOCK_CONST_METHOD8_T(m, ...) \
00728 GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__)
00729 #define MOCK_CONST_METHOD9_T(m, ...) \
00730 GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__)
00731 #define MOCK_CONST_METHOD10_T(m, ...) \
00732 GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__)
00733
00734 #define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \
00735 GMOCK_METHOD0_(, , ct, m, __VA_ARGS__)
00736 #define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \
00737 GMOCK_METHOD1_(, , ct, m, __VA_ARGS__)
00738 #define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \
00739 GMOCK_METHOD2_(, , ct, m, __VA_ARGS__)
00740 #define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \
00741 GMOCK_METHOD3_(, , ct, m, __VA_ARGS__)
00742 #define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \
00743 GMOCK_METHOD4_(, , ct, m, __VA_ARGS__)
00744 #define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \
00745 GMOCK_METHOD5_(, , ct, m, __VA_ARGS__)
00746 #define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \
00747 GMOCK_METHOD6_(, , ct, m, __VA_ARGS__)
00748 #define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \
00749 GMOCK_METHOD7_(, , ct, m, __VA_ARGS__)
00750 #define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \
00751 GMOCK_METHOD8_(, , ct, m, __VA_ARGS__)
00752 #define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \
00753 GMOCK_METHOD9_(, , ct, m, __VA_ARGS__)
00754 #define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \
00755 GMOCK_METHOD10_(, , ct, m, __VA_ARGS__)
00756
00757 #define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \
00758 GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__)
00759 #define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \
00760 GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__)
00761 #define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \
00762 GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__)
00763 #define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \
00764 GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__)
00765 #define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \
00766 GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__)
00767 #define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \
00768 GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__)
00769 #define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \
00770 GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__)
00771 #define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \
00772 GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__)
00773 #define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \
00774 GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__)
00775 #define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \
00776 GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__)
00777 #define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \
00778 GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__)
00779
00780 #define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
00781 GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__)
00782 #define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
00783 GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__)
00784 #define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
00785 GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__)
00786 #define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
00787 GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__)
00788 #define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
00789 GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__)
00790 #define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
00791 GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__)
00792 #define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
00793 GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__)
00794 #define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
00795 GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__)
00796 #define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
00797 GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__)
00798 #define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
00799 GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__)
00800 #define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
00801 GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__)
00802
00803 #define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
00804 GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__)
00805 #define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
00806 GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__)
00807 #define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
00808 GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__)
00809 #define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
00810 GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__)
00811 #define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
00812 GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__)
00813 #define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
00814 GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__)
00815 #define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
00816 GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__)
00817 #define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
00818 GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__)
00819 #define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
00820 GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__)
00821 #define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
00822 GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__)
00823 #define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
00824 GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__)
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872 template <typename F>
00873 class MockFunction;
00874
00875 template <typename R>
00876 class MockFunction<R()> {
00877 public:
00878 MockFunction() {}
00879
00880 MOCK_METHOD0_T(Call, R());
00881
00882 #if GTEST_HAS_STD_FUNCTION_
00883 std::function<R()> AsStdFunction() {
00884 return [this]() -> R {
00885 return this->Call();
00886 };
00887 }
00888 #endif // GTEST_HAS_STD_FUNCTION_
00889
00890 private:
00891 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
00892 };
00893
00894 template <typename R, typename A0>
00895 class MockFunction<R(A0)> {
00896 public:
00897 MockFunction() {}
00898
00899 MOCK_METHOD1_T(Call, R(A0));
00900
00901 #if GTEST_HAS_STD_FUNCTION_
00902 std::function<R(A0)> AsStdFunction() {
00903 return [this](A0 a0) -> R {
00904 return this->Call(a0);
00905 };
00906 }
00907 #endif // GTEST_HAS_STD_FUNCTION_
00908
00909 private:
00910 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
00911 };
00912
00913 template <typename R, typename A0, typename A1>
00914 class MockFunction<R(A0, A1)> {
00915 public:
00916 MockFunction() {}
00917
00918 MOCK_METHOD2_T(Call, R(A0, A1));
00919
00920 #if GTEST_HAS_STD_FUNCTION_
00921 std::function<R(A0, A1)> AsStdFunction() {
00922 return [this](A0 a0, A1 a1) -> R {
00923 return this->Call(a0, a1);
00924 };
00925 }
00926 #endif // GTEST_HAS_STD_FUNCTION_
00927
00928 private:
00929 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
00930 };
00931
00932 template <typename R, typename A0, typename A1, typename A2>
00933 class MockFunction<R(A0, A1, A2)> {
00934 public:
00935 MockFunction() {}
00936
00937 MOCK_METHOD3_T(Call, R(A0, A1, A2));
00938
00939 #if GTEST_HAS_STD_FUNCTION_
00940 std::function<R(A0, A1, A2)> AsStdFunction() {
00941 return [this](A0 a0, A1 a1, A2 a2) -> R {
00942 return this->Call(a0, a1, a2);
00943 };
00944 }
00945 #endif // GTEST_HAS_STD_FUNCTION_
00946
00947 private:
00948 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
00949 };
00950
00951 template <typename R, typename A0, typename A1, typename A2, typename A3>
00952 class MockFunction<R(A0, A1, A2, A3)> {
00953 public:
00954 MockFunction() {}
00955
00956 MOCK_METHOD4_T(Call, R(A0, A1, A2, A3));
00957
00958 #if GTEST_HAS_STD_FUNCTION_
00959 std::function<R(A0, A1, A2, A3)> AsStdFunction() {
00960 return [this](A0 a0, A1 a1, A2 a2, A3 a3) -> R {
00961 return this->Call(a0, a1, a2, a3);
00962 };
00963 }
00964 #endif // GTEST_HAS_STD_FUNCTION_
00965
00966 private:
00967 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
00968 };
00969
00970 template <typename R, typename A0, typename A1, typename A2, typename A3,
00971 typename A4>
00972 class MockFunction<R(A0, A1, A2, A3, A4)> {
00973 public:
00974 MockFunction() {}
00975
00976 MOCK_METHOD5_T(Call, R(A0, A1, A2, A3, A4));
00977
00978 #if GTEST_HAS_STD_FUNCTION_
00979 std::function<R(A0, A1, A2, A3, A4)> AsStdFunction() {
00980 return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) -> R {
00981 return this->Call(a0, a1, a2, a3, a4);
00982 };
00983 }
00984 #endif // GTEST_HAS_STD_FUNCTION_
00985
00986 private:
00987 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
00988 };
00989
00990 template <typename R, typename A0, typename A1, typename A2, typename A3,
00991 typename A4, typename A5>
00992 class MockFunction<R(A0, A1, A2, A3, A4, A5)> {
00993 public:
00994 MockFunction() {}
00995
00996 MOCK_METHOD6_T(Call, R(A0, A1, A2, A3, A4, A5));
00997
00998 #if GTEST_HAS_STD_FUNCTION_
00999 std::function<R(A0, A1, A2, A3, A4, A5)> AsStdFunction() {
01000 return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -> R {
01001 return this->Call(a0, a1, a2, a3, a4, a5);
01002 };
01003 }
01004 #endif // GTEST_HAS_STD_FUNCTION_
01005
01006 private:
01007 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
01008 };
01009
01010 template <typename R, typename A0, typename A1, typename A2, typename A3,
01011 typename A4, typename A5, typename A6>
01012 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> {
01013 public:
01014 MockFunction() {}
01015
01016 MOCK_METHOD7_T(Call, R(A0, A1, A2, A3, A4, A5, A6));
01017
01018 #if GTEST_HAS_STD_FUNCTION_
01019 std::function<R(A0, A1, A2, A3, A4, A5, A6)> AsStdFunction() {
01020 return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -> R {
01021 return this->Call(a0, a1, a2, a3, a4, a5, a6);
01022 };
01023 }
01024 #endif // GTEST_HAS_STD_FUNCTION_
01025
01026 private:
01027 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
01028 };
01029
01030 template <typename R, typename A0, typename A1, typename A2, typename A3,
01031 typename A4, typename A5, typename A6, typename A7>
01032 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> {
01033 public:
01034 MockFunction() {}
01035
01036 MOCK_METHOD8_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7));
01037
01038 #if GTEST_HAS_STD_FUNCTION_
01039 std::function<R(A0, A1, A2, A3, A4, A5, A6, A7)> AsStdFunction() {
01040 return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -> R {
01041 return this->Call(a0, a1, a2, a3, a4, a5, a6, a7);
01042 };
01043 }
01044 #endif // GTEST_HAS_STD_FUNCTION_
01045
01046 private:
01047 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
01048 };
01049
01050 template <typename R, typename A0, typename A1, typename A2, typename A3,
01051 typename A4, typename A5, typename A6, typename A7, typename A8>
01052 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> {
01053 public:
01054 MockFunction() {}
01055
01056 MOCK_METHOD9_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8));
01057
01058 #if GTEST_HAS_STD_FUNCTION_
01059 std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> AsStdFunction() {
01060 return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
01061 A8 a8) -> R {
01062 return this->Call(a0, a1, a2, a3, a4, a5, a6, a7, a8);
01063 };
01064 }
01065 #endif // GTEST_HAS_STD_FUNCTION_
01066
01067 private:
01068 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
01069 };
01070
01071 template <typename R, typename A0, typename A1, typename A2, typename A3,
01072 typename A4, typename A5, typename A6, typename A7, typename A8,
01073 typename A9>
01074 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
01075 public:
01076 MockFunction() {}
01077
01078 MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));
01079
01080 #if GTEST_HAS_STD_FUNCTION_
01081 std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> AsStdFunction() {
01082 return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
01083 A8 a8, A9 a9) -> R {
01084 return this->Call(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
01085 };
01086 }
01087 #endif // GTEST_HAS_STD_FUNCTION_
01088
01089 private:
01090 GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
01091 };
01092
01093 }
01094
01095 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_