40#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
41#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
46#if GTEST_HAS_STD_FUNCTION_
54class FunctionMockerBase;
84template <
typename R,
typename A1>
92 return MockSpec<F>(
this, ::testing::make_tuple(m1));
100 return this->InvokeWith(
ArgumentTuple(internal::forward<A1>(a1)));
104template <
typename R,
typename A1,
typename A2>
112 return MockSpec<F>(
this, ::testing::make_tuple(m1, m2));
120 return this->InvokeWith(
ArgumentTuple(internal::forward<A1>(a1),
121 internal::forward<A2>(a2)));
125template <
typename R,
typename A1,
typename A2,
typename A3>
129 typedef R F(A1, A2, A3);
134 return MockSpec<F>(
this, ::testing::make_tuple(m1, m2, m3));
142 return this->InvokeWith(
ArgumentTuple(internal::forward<A1>(a1),
143 internal::forward<A2>(a2), internal::forward<A3>(a3)));
147template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4>
151 typedef R F(A1, A2, A3, A4);
156 return MockSpec<F>(
this, ::testing::make_tuple(m1, m2, m3, m4));
164 return this->InvokeWith(
ArgumentTuple(internal::forward<A1>(a1),
165 internal::forward<A2>(a2), internal::forward<A3>(a3),
166 internal::forward<A4>(a4)));
170template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
175 typedef R F(A1, A2, A3, A4, A5);
180 return MockSpec<F>(
this, ::testing::make_tuple(m1, m2, m3, m4, m5));
188 return this->InvokeWith(
ArgumentTuple(internal::forward<A1>(a1),
189 internal::forward<A2>(a2), internal::forward<A3>(a3),
190 internal::forward<A4>(a4), internal::forward<A5>(a5)));
194template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
195 typename A5,
typename A6>
199 typedef R F(A1, A2, A3, A4, A5, A6);
205 return MockSpec<F>(
this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6));
208 R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
213 return this->InvokeWith(
ArgumentTuple(internal::forward<A1>(a1),
214 internal::forward<A2>(a2), internal::forward<A3>(a3),
215 internal::forward<A4>(a4), internal::forward<A5>(a5),
216 internal::forward<A6>(a6)));
220template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
221 typename A5,
typename A6,
typename A7>
225 typedef R F(A1, A2, A3, A4, A5, A6, A7);
231 return MockSpec<F>(
this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7));
234 R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) {
239 return this->InvokeWith(
ArgumentTuple(internal::forward<A1>(a1),
240 internal::forward<A2>(a2), internal::forward<A3>(a3),
241 internal::forward<A4>(a4), internal::forward<A5>(a5),
242 internal::forward<A6>(a6), internal::forward<A7>(a7)));
246template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
247 typename A5,
typename A6,
typename A7,
typename A8>
251 typedef R F(A1, A2, A3, A4, A5, A6, A7, A8);
257 return MockSpec<F>(
this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7,
261 R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) {
266 return this->InvokeWith(
ArgumentTuple(internal::forward<A1>(a1),
267 internal::forward<A2>(a2), internal::forward<A3>(a3),
268 internal::forward<A4>(a4), internal::forward<A5>(a5),
269 internal::forward<A6>(a6), internal::forward<A7>(a7),
270 internal::forward<A8>(a8)));
274template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
275 typename A5,
typename A6,
typename A7,
typename A8,
typename A9>
279 typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9);
286 return MockSpec<F>(
this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7,
290 R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) {
295 return this->InvokeWith(
ArgumentTuple(internal::forward<A1>(a1),
296 internal::forward<A2>(a2), internal::forward<A3>(a3),
297 internal::forward<A4>(a4), internal::forward<A5>(a5),
298 internal::forward<A6>(a6), internal::forward<A7>(a7),
299 internal::forward<A8>(a8), internal::forward<A9>(a9)));
303template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
304 typename A5,
typename A6,
typename A7,
typename A8,
typename A9,
309 typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
316 return MockSpec<F>(
this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7,
320 R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
326 return this->InvokeWith(
ArgumentTuple(internal::forward<A1>(a1),
327 internal::forward<A2>(a2), internal::forward<A3>(a3),
328 internal::forward<A4>(a4), internal::forward<A5>(a5),
329 internal::forward<A6>(a6), internal::forward<A7>(a7),
330 internal::forward<A8>(a8), internal::forward<A9>(a9),
331 internal::forward<A10>(a10)));
375template <
typename MockType>
382template <
typename MockType>
384 return const_cast<MockType*
>(mock);
394using internal::FunctionMocker;
401#define GMOCK_RESULT_(tn, ...) \
402 tn ::testing::internal::Function<__VA_ARGS__>::Result
406#define GMOCK_ARG_(tn, N, ...) \
407 tn ::testing::internal::Function<__VA_ARGS__>::Argument##N
411#define GMOCK_MATCHER_(tn, N, ...) \
412 const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&
416#define GMOCK_MOCKER_(arity, constness, Method) \
417 GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
420#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
421 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method() constness { \
422 GTEST_COMPILE_ASSERT_( \
423 (::testing::tuple_size<tn ::testing::internal::Function< \
424 __VA_ARGS__>::ArgumentTuple>::value == 0), \
425 this_method_does_not_take_0_arguments); \
426 GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \
427 return GMOCK_MOCKER_(0, constness, Method).Invoke(); \
429 ::testing::MockSpec<__VA_ARGS__> gmock_##Method() constness { \
430 GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \
431 return GMOCK_MOCKER_(0, constness, Method).With(); \
433 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
434 const ::testing::internal::WithoutMatchers&, \
435 constness ::testing::internal::Function<__VA_ARGS__>*) const { \
436 return ::testing::internal::AdjustConstness_##constness(this) \
437 ->gmock_##Method(); \
439 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \
443#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
444 GMOCK_RESULT_(tn, __VA_ARGS__) \
445 ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
446 GTEST_COMPILE_ASSERT_( \
447 (::testing::tuple_size<tn ::testing::internal::Function< \
448 __VA_ARGS__>::ArgumentTuple>::value == 1), \
449 this_method_does_not_take_1_argument); \
450 GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \
451 return GMOCK_MOCKER_(1, constness, Method) \
452 .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
455 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
456 GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
457 GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \
458 return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \
460 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
461 const ::testing::internal::WithoutMatchers&, \
462 constness ::testing::internal::Function<__VA_ARGS__>*) const { \
463 return ::testing::internal::AdjustConstness_##constness(this) \
464 ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>()); \
466 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \
470#define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \
471 GMOCK_RESULT_(tn, __VA_ARGS__) \
472 ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
473 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
474 GTEST_COMPILE_ASSERT_( \
475 (::testing::tuple_size<tn ::testing::internal::Function< \
476 __VA_ARGS__>::ArgumentTuple>::value == 2), \
477 this_method_does_not_take_2_arguments); \
478 GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \
479 return GMOCK_MOCKER_(2, constness, Method) \
480 .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
482 ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
485 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
486 GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
487 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
488 GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \
489 return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \
491 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
492 const ::testing::internal::WithoutMatchers&, \
493 constness ::testing::internal::Function<__VA_ARGS__>*) const { \
494 return ::testing::internal::AdjustConstness_##constness(this) \
495 ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
496 ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>()); \
498 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \
502#define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \
503 GMOCK_RESULT_(tn, __VA_ARGS__) \
504 ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
505 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
506 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
507 GTEST_COMPILE_ASSERT_( \
508 (::testing::tuple_size<tn ::testing::internal::Function< \
509 __VA_ARGS__>::ArgumentTuple>::value == 3), \
510 this_method_does_not_take_3_arguments); \
511 GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \
512 return GMOCK_MOCKER_(3, constness, Method) \
513 .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
515 ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
517 ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
520 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
521 GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
522 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
523 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
524 GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \
525 return GMOCK_MOCKER_(3, constness, Method) \
526 .With(gmock_a1, gmock_a2, gmock_a3); \
528 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
529 const ::testing::internal::WithoutMatchers&, \
530 constness ::testing::internal::Function<__VA_ARGS__>*) const { \
531 return ::testing::internal::AdjustConstness_##constness(this) \
532 ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
533 ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
534 ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>()); \
536 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \
540#define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \
541 GMOCK_RESULT_(tn, __VA_ARGS__) \
542 ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
543 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
544 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
545 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
546 GTEST_COMPILE_ASSERT_( \
547 (::testing::tuple_size<tn ::testing::internal::Function< \
548 __VA_ARGS__>::ArgumentTuple>::value == 4), \
549 this_method_does_not_take_4_arguments); \
550 GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \
551 return GMOCK_MOCKER_(4, constness, Method) \
552 .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
554 ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
556 ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
558 ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
561 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
562 GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
563 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
564 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
565 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
566 GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \
567 return GMOCK_MOCKER_(4, constness, Method) \
568 .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4); \
570 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
571 const ::testing::internal::WithoutMatchers&, \
572 constness ::testing::internal::Function<__VA_ARGS__>*) const { \
573 return ::testing::internal::AdjustConstness_##constness(this) \
574 ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
575 ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
576 ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
577 ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>()); \
579 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \
583#define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \
584 GMOCK_RESULT_(tn, __VA_ARGS__) \
585 ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
586 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
587 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
588 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
589 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
590 GTEST_COMPILE_ASSERT_( \
591 (::testing::tuple_size<tn ::testing::internal::Function< \
592 __VA_ARGS__>::ArgumentTuple>::value == 5), \
593 this_method_does_not_take_5_arguments); \
594 GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \
595 return GMOCK_MOCKER_(5, constness, Method) \
596 .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
598 ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
600 ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
602 ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
604 ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
607 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
608 GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
609 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
610 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
611 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
612 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
613 GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \
614 return GMOCK_MOCKER_(5, constness, Method) \
615 .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5); \
617 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
618 const ::testing::internal::WithoutMatchers&, \
619 constness ::testing::internal::Function<__VA_ARGS__>*) const { \
620 return ::testing::internal::AdjustConstness_##constness(this) \
621 ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
622 ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
623 ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
624 ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
625 ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>()); \
627 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \
631#define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \
632 GMOCK_RESULT_(tn, __VA_ARGS__) \
633 ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
634 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
635 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
636 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
637 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
638 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
639 GTEST_COMPILE_ASSERT_( \
640 (::testing::tuple_size<tn ::testing::internal::Function< \
641 __VA_ARGS__>::ArgumentTuple>::value == 6), \
642 this_method_does_not_take_6_arguments); \
643 GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \
644 return GMOCK_MOCKER_(6, constness, Method) \
645 .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
647 ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
649 ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
651 ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
653 ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
655 ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
658 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
659 GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
660 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
661 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
662 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
663 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
664 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
665 GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \
666 return GMOCK_MOCKER_(6, constness, Method) \
667 .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
669 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
670 const ::testing::internal::WithoutMatchers&, \
671 constness ::testing::internal::Function<__VA_ARGS__>*) const { \
672 return ::testing::internal::AdjustConstness_##constness(this) \
673 ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
674 ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
675 ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
676 ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
677 ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
678 ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>()); \
680 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \
684#define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \
685 GMOCK_RESULT_(tn, __VA_ARGS__) \
686 ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
687 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
688 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
689 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
690 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
691 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
692 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
693 GTEST_COMPILE_ASSERT_( \
694 (::testing::tuple_size<tn ::testing::internal::Function< \
695 __VA_ARGS__>::ArgumentTuple>::value == 7), \
696 this_method_does_not_take_7_arguments); \
697 GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \
698 return GMOCK_MOCKER_(7, constness, Method) \
699 .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
701 ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
703 ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
705 ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
707 ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
709 ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
711 ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \
714 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
715 GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
716 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
717 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
718 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
719 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
720 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
721 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
722 GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \
723 return GMOCK_MOCKER_(7, constness, Method) \
724 .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \
727 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
728 const ::testing::internal::WithoutMatchers&, \
729 constness ::testing::internal::Function<__VA_ARGS__>*) const { \
730 return ::testing::internal::AdjustConstness_##constness(this) \
731 ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
732 ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
733 ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
734 ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
735 ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
736 ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
737 ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>()); \
739 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \
743#define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \
744 GMOCK_RESULT_(tn, __VA_ARGS__) \
745 ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
746 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
747 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
748 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
749 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
750 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
751 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
752 GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
753 GTEST_COMPILE_ASSERT_( \
754 (::testing::tuple_size<tn ::testing::internal::Function< \
755 __VA_ARGS__>::ArgumentTuple>::value == 8), \
756 this_method_does_not_take_8_arguments); \
757 GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \
758 return GMOCK_MOCKER_(8, constness, Method) \
759 .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
761 ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
763 ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
765 ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
767 ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
769 ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
771 ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \
773 ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \
776 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
777 GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
778 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
779 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
780 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
781 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
782 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
783 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
784 GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
785 GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \
786 return GMOCK_MOCKER_(8, constness, Method) \
787 .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \
788 gmock_a7, gmock_a8); \
790 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
791 const ::testing::internal::WithoutMatchers&, \
792 constness ::testing::internal::Function<__VA_ARGS__>*) const { \
793 return ::testing::internal::AdjustConstness_##constness(this) \
794 ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
795 ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
796 ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
797 ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
798 ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
799 ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
800 ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \
801 ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>()); \
803 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \
807#define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \
808 GMOCK_RESULT_(tn, __VA_ARGS__) \
809 ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
810 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
811 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
812 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
813 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
814 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
815 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
816 GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
817 GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
818 GTEST_COMPILE_ASSERT_( \
819 (::testing::tuple_size<tn ::testing::internal::Function< \
820 __VA_ARGS__>::ArgumentTuple>::value == 9), \
821 this_method_does_not_take_9_arguments); \
822 GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \
823 return GMOCK_MOCKER_(9, constness, Method) \
824 .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
826 ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
828 ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
830 ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
832 ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
834 ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
836 ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \
838 ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \
840 ::testing::internal::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>( \
843 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
844 GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
845 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
846 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
847 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
848 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
849 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
850 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
851 GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
852 GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
853 GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \
854 return GMOCK_MOCKER_(9, constness, Method) \
855 .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \
856 gmock_a7, gmock_a8, gmock_a9); \
858 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
859 const ::testing::internal::WithoutMatchers&, \
860 constness ::testing::internal::Function<__VA_ARGS__>*) const { \
861 return ::testing::internal::AdjustConstness_##constness(this) \
862 ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
863 ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
864 ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
865 ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
866 ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
867 ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
868 ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \
869 ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \
870 ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>()); \
872 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \
876#define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \
877 GMOCK_RESULT_(tn, __VA_ARGS__) \
878 ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
879 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
880 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
881 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
882 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
883 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
884 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
885 GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
886 GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
887 GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
888 GTEST_COMPILE_ASSERT_( \
889 (::testing::tuple_size<tn ::testing::internal::Function< \
890 __VA_ARGS__>::ArgumentTuple>::value == 10), \
891 this_method_does_not_take_10_arguments); \
892 GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \
893 return GMOCK_MOCKER_(10, constness, Method) \
894 .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \
896 ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \
898 ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \
900 ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \
902 ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \
904 ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \
906 ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \
908 ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \
910 ::testing::internal::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>( \
912 ::testing::internal::forward<GMOCK_ARG_(tn, 10, __VA_ARGS__)>( \
915 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
916 GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
917 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
918 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
919 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
920 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
921 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
922 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
923 GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
924 GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \
925 GMOCK_MATCHER_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
926 GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \
927 return GMOCK_MOCKER_(10, constness, Method) \
928 .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \
929 gmock_a7, gmock_a8, gmock_a9, gmock_a10); \
931 ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \
932 const ::testing::internal::WithoutMatchers&, \
933 constness ::testing::internal::Function<__VA_ARGS__>*) const { \
934 return ::testing::internal::AdjustConstness_##constness(this) \
935 ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \
936 ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \
937 ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \
938 ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \
939 ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \
940 ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \
941 ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \
942 ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \
943 ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(), \
944 ::testing::A<GMOCK_ARG_(tn, 10, __VA_ARGS__)>()); \
946 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \
949#define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__)
950#define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__)
951#define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)
952#define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__)
953#define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__)
954#define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__)
955#define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__)
956#define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__)
957#define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__)
958#define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__)
959#define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__)
961#define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__)
962#define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__)
963#define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__)
964#define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__)
965#define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__)
966#define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__)
967#define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__)
968#define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__)
969#define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__)
970#define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__)
971#define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__)
973#define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__)
974#define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__)
975#define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__)
976#define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__)
977#define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__)
978#define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__)
979#define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__)
980#define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__)
981#define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__)
982#define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__)
983#define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__)
985#define MOCK_CONST_METHOD0_T(m, ...) \
986 GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__)
987#define MOCK_CONST_METHOD1_T(m, ...) \
988 GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__)
989#define MOCK_CONST_METHOD2_T(m, ...) \
990 GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__)
991#define MOCK_CONST_METHOD3_T(m, ...) \
992 GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__)
993#define MOCK_CONST_METHOD4_T(m, ...) \
994 GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__)
995#define MOCK_CONST_METHOD5_T(m, ...) \
996 GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__)
997#define MOCK_CONST_METHOD6_T(m, ...) \
998 GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__)
999#define MOCK_CONST_METHOD7_T(m, ...) \
1000 GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__)
1001#define MOCK_CONST_METHOD8_T(m, ...) \
1002 GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__)
1003#define MOCK_CONST_METHOD9_T(m, ...) \
1004 GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__)
1005#define MOCK_CONST_METHOD10_T(m, ...) \
1006 GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__)
1008#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \
1009 GMOCK_METHOD0_(, , ct, m, __VA_ARGS__)
1010#define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \
1011 GMOCK_METHOD1_(, , ct, m, __VA_ARGS__)
1012#define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \
1013 GMOCK_METHOD2_(, , ct, m, __VA_ARGS__)
1014#define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \
1015 GMOCK_METHOD3_(, , ct, m, __VA_ARGS__)
1016#define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \
1017 GMOCK_METHOD4_(, , ct, m, __VA_ARGS__)
1018#define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \
1019 GMOCK_METHOD5_(, , ct, m, __VA_ARGS__)
1020#define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \
1021 GMOCK_METHOD6_(, , ct, m, __VA_ARGS__)
1022#define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \
1023 GMOCK_METHOD7_(, , ct, m, __VA_ARGS__)
1024#define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \
1025 GMOCK_METHOD8_(, , ct, m, __VA_ARGS__)
1026#define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \
1027 GMOCK_METHOD9_(, , ct, m, __VA_ARGS__)
1028#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \
1029 GMOCK_METHOD10_(, , ct, m, __VA_ARGS__)
1031#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \
1032 GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__)
1033#define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \
1034 GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__)
1035#define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \
1036 GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__)
1037#define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \
1038 GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__)
1039#define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \
1040 GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__)
1041#define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \
1042 GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__)
1043#define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \
1044 GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__)
1045#define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \
1046 GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__)
1047#define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \
1048 GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__)
1049#define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \
1050 GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__)
1051#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \
1052 GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__)
1054#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
1055 GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__)
1056#define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
1057 GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__)
1058#define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
1059 GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__)
1060#define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
1061 GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__)
1062#define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
1063 GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__)
1064#define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
1065 GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__)
1066#define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
1067 GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__)
1068#define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
1069 GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__)
1070#define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
1071 GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__)
1072#define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
1073 GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__)
1074#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
1075 GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__)
1077#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
1078 GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__)
1079#define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
1080 GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__)
1081#define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
1082 GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__)
1083#define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
1084 GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__)
1085#define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
1086 GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__)
1087#define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
1088 GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__)
1089#define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
1090 GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__)
1091#define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
1092 GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__)
1093#define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
1094 GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__)
1095#define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
1096 GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__)
1097#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
1098 GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__)
1146template <
typename F>
1149template <
typename R>
1156#if GTEST_HAS_STD_FUNCTION_
1157 ::std::function<
R()> AsStdFunction() {
1158 return [
this]() ->
R {
1159 return this->
Call();
1168template <
typename R,
typename A0>
1175#if GTEST_HAS_STD_FUNCTION_
1176 ::std::function<
R(A0)> AsStdFunction() {
1177 return [
this](A0 a0) ->
R {
1178 return this->
Call(::std::move(a0));
1187template <
typename R,
typename A0,
typename A1>
1194#if GTEST_HAS_STD_FUNCTION_
1195 ::std::function<
R(A0, A1)> AsStdFunction() {
1196 return [
this](A0 a0, A1 a1) ->
R {
1197 return this->
Call(::std::move(a0), ::std::move(a1));
1206template <
typename R,
typename A0,
typename A1,
typename A2>
1213#if GTEST_HAS_STD_FUNCTION_
1214 ::std::function<
R(A0, A1, A2)> AsStdFunction() {
1215 return [
this](A0 a0, A1 a1, A2 a2) ->
R {
1216 return this->
Call(::std::move(a0), ::std::move(a1), ::std::move(a2));
1225template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3>
1232#if GTEST_HAS_STD_FUNCTION_
1233 ::std::function<
R(A0, A1, A2, A3)> AsStdFunction() {
1234 return [
this](A0 a0, A1 a1, A2 a2, A3 a3) ->
R {
1235 return this->
Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
1245template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
1253#if GTEST_HAS_STD_FUNCTION_
1254 ::std::function<
R(A0, A1, A2, A3, A4)> AsStdFunction() {
1255 return [
this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) ->
R {
1256 return this->
Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
1257 ::std::move(a3), ::std::move(a4));
1266template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
1267 typename A4,
typename A5>
1274#if GTEST_HAS_STD_FUNCTION_
1275 ::std::function<
R(A0, A1, A2, A3, A4, A5)> AsStdFunction() {
1276 return [
this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) ->
R {
1277 return this->
Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
1278 ::std::move(a3), ::std::move(a4), ::std::move(a5));
1287template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
1288 typename A4,
typename A5,
typename A6>
1295#if GTEST_HAS_STD_FUNCTION_
1296 ::std::function<
R(A0, A1, A2, A3, A4, A5, A6)> AsStdFunction() {
1297 return [
this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) ->
R {
1298 return this->
Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
1299 ::std::move(a3), ::std::move(a4), ::std::move(a5), ::std::move(a6));
1308template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
1309 typename A4,
typename A5,
typename A6,
typename A7>
1316#if GTEST_HAS_STD_FUNCTION_
1317 ::std::function<
R(A0, A1, A2, A3, A4, A5, A6, A7)> AsStdFunction() {
1318 return [
this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) ->
R {
1319 return this->
Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
1320 ::std::move(a3), ::std::move(a4), ::std::move(a5), ::std::move(a6),
1330template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
1331 typename A4,
typename A5,
typename A6,
typename A7,
typename A8>
1338#if GTEST_HAS_STD_FUNCTION_
1339 ::std::function<
R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> AsStdFunction() {
1340 return [
this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
1342 return this->
Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
1343 ::std::move(a3), ::std::move(a4), ::std::move(a5), ::std::move(a6),
1344 ::std::move(a7), ::std::move(a8));
1353template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
1354 typename A4,
typename A5,
typename A6,
typename A7,
typename A8,
1360 MOCK_METHOD10_T(
Call,
R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));
1362#if GTEST_HAS_STD_FUNCTION_
1363 ::std::function<
R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> AsStdFunction() {
1364 return [
this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
1365 A8 a8, A9 a9) ->
R {
1366 return this->
Call(::std::move(a0), ::std::move(a1), ::std::move(a2),
1367 ::std::move(a3), ::std::move(a4), ::std::move(a5), ::std::move(a6),
1368 ::std::move(a7), ::std::move(a8), ::std::move(a9));
MOCK_METHOD0_T(Call, R())
MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9))
MOCK_METHOD9_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8))
MOCK_METHOD8_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7))
MOCK_METHOD7_T(Call, R(A0, A1, A2, A3, A4, A5, A6))
MOCK_METHOD6_T(Call, R(A0, A1, A2, A3, A4, A5))
MOCK_METHOD5_T(Call, R(A0, A1, A2, A3, A4))
MOCK_METHOD4_T(Call, R(A0, A1, A2, A3))
MOCK_METHOD3_T(Call, R(A0, A1, A2))
MOCK_METHOD2_T(Call, R(A0, A1))
MOCK_METHOD1_T(Call, R(A0))
internal::Function< F >::ArgumentTuple ArgumentTuple
MockSpec< F > With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4, const Matcher< A5 > &m5, const Matcher< A6 > &m6, const Matcher< A7 > &m7, const Matcher< A8 > &m8, const Matcher< A9 > &m9, const Matcher< A10 > &m10)
R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10)
internal::Function< F >::ArgumentTuple ArgumentTuple
R F(A1, A2, A3, A4, A5, A6, A7, A8)
internal::Function< F >::ArgumentTuple ArgumentTuple
MockSpec< F > With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4, const Matcher< A5 > &m5, const Matcher< A6 > &m6, const Matcher< A7 > &m7, const Matcher< A8 > &m8)
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
MockSpec< F > With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4, const Matcher< A5 > &m5, const Matcher< A6 > &m6, const Matcher< A7 > &m7)
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
R F(A1, A2, A3, A4, A5, A6, A7)
internal::Function< F >::ArgumentTuple ArgumentTuple
internal::Function< F >::ArgumentTuple ArgumentTuple
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
R F(A1, A2, A3, A4, A5, A6)
MockSpec< F > With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4, const Matcher< A5 > &m5, const Matcher< A6 > &m6)
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
R F(A1, A2, A3, A4, A5, A6, A7, A8, A9)
MockSpec< F > With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4, const Matcher< A5 > &m5, const Matcher< A6 > &m6, const Matcher< A7 > &m7, const Matcher< A8 > &m8, const Matcher< A9 > &m9)
internal::Function< F >::ArgumentTuple ArgumentTuple
MockSpec< F > With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4, const Matcher< A5 > &m5)
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
internal::Function< F >::ArgumentTuple ArgumentTuple
internal::Function< F >::ArgumentTuple ArgumentTuple
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4)
MockSpec< F > With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4)
R Invoke(A1 a1, A2 a2, A3 a3)
MockSpec< F > With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3)
internal::Function< F >::ArgumentTuple ArgumentTuple
MockSpec< F > With(const Matcher< A1 > &m1, const Matcher< A2 > &m2)
internal::Function< F >::ArgumentTuple ArgumentTuple
internal::Function< F >::ArgumentTuple ArgumentTuple
MockSpec< F > With(const Matcher< A1 > &m1)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
MockType * AdjustConstness_(const MockType *mock)
const MockType * AdjustConstness_const(const MockType *mock)