40 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ 41 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ 52 class FunctionMockerBase;
63 class FunctionMocker<R()> :
public 64 internal::FunctionMockerBase<R()>
72 return this->current_spec();
81 return this->InvokeWith(ArgumentTuple());
85 template <
typename R,
typename A1>
96 return this->current_spec();
105 return this->InvokeWith(ArgumentTuple(a1));
109 template <
typename R,
typename A1,
typename A2>
120 return this->current_spec();
129 return this->InvokeWith(ArgumentTuple(a1, a2));
133 template <
typename R,
typename A1,
typename A2,
typename A3>
138 typedef R
F(A1, A2, A3);
145 return this->current_spec();
154 return this->InvokeWith(ArgumentTuple(a1, a2, a3));
158 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4>
163 typedef R
F(A1, A2, A3, A4);
170 return this->current_spec();
179 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4));
183 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
189 typedef R
F(A1, A2, A3, A4, A5);
197 return this->current_spec();
200 R
Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
206 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5));
210 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
211 typename A5,
typename A6>
216 typedef R
F(A1, A2, A3, A4, A5, A6);
225 return this->current_spec();
228 R
Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
234 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6));
238 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
239 typename A5,
typename A6,
typename A7>
244 typedef R
F(A1, A2, A3, A4, A5, A6, A7);
253 return this->current_spec();
256 R
Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
262 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7));
266 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
267 typename A5,
typename A6,
typename A7,
typename A8>
272 typedef R
F(A1, A2, A3, A4, A5, A6, A7, A8);
281 return this->current_spec();
284 R
Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
290 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8));
294 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
295 typename A5,
typename A6,
typename A7,
typename A8,
typename A9>
296 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> :
public 300 typedef R
F(A1, A2, A3, A4, A5, A6, A7, A8, A9);
310 return this->current_spec();
313 R
Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
319 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9));
323 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
324 typename A5,
typename A6,
typename A7,
typename A8,
typename A9,
326 class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> :
public 330 typedef R
F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
339 m6, m7, m8, m9, m10));
340 return this->current_spec();
343 R
Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
350 return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9,
369 #define GMOCK_RESULT_(tn, ...) \ 370 tn ::testing::internal::Function<__VA_ARGS__>::Result 374 #define GMOCK_ARG_(tn, N, ...) \ 375 tn ::testing::internal::Function<__VA_ARGS__>::Argument##N 379 #define GMOCK_MATCHER_(tn, N, ...) \ 380 const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>& 384 #define GMOCK_MOCKER_(arity, constness, Method) \ 385 GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__) 388 #define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \ 389 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ 391 GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ 392 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ 394 this_method_does_not_take_0_arguments); \ 395 GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \ 396 return GMOCK_MOCKER_(0, constness, Method).Invoke(); \ 398 ::testing::MockSpec<__VA_ARGS__>& \ 399 gmock_##Method() constness { \ 400 GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \ 401 return GMOCK_MOCKER_(0, constness, Method).With(); \ 403 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \ 407 #define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \ 408 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ 409 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ 410 GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ 411 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ 413 this_method_does_not_take_1_argument); \ 414 GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \ 415 return GMOCK_MOCKER_(1, constness, Method).Invoke(gmock_a1); \ 417 ::testing::MockSpec<__VA_ARGS__>& \ 418 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ 419 GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \ 420 return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \ 422 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \ 426 #define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \ 427 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ 428 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ 429 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ 430 GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ 431 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ 433 this_method_does_not_take_2_arguments); \ 434 GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \ 435 return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2); \ 437 ::testing::MockSpec<__VA_ARGS__>& \ 438 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ 439 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ 440 GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \ 441 return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \ 443 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \ 447 #define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \ 448 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ 449 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ 450 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ 451 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ 452 GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ 453 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ 455 this_method_does_not_take_3_arguments); \ 456 GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \ 457 return GMOCK_MOCKER_(3, constness, Method).Invoke(gmock_a1, gmock_a2, \ 460 ::testing::MockSpec<__VA_ARGS__>& \ 461 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ 462 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ 463 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ 464 GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \ 465 return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \ 468 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \ 472 #define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \ 473 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ 474 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ 475 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ 476 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ 477 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ 478 GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ 479 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ 481 this_method_does_not_take_4_arguments); \ 482 GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \ 483 return GMOCK_MOCKER_(4, constness, Method).Invoke(gmock_a1, gmock_a2, \ 484 gmock_a3, gmock_a4); \ 486 ::testing::MockSpec<__VA_ARGS__>& \ 487 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ 488 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ 489 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ 490 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ 491 GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \ 492 return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \ 493 gmock_a3, gmock_a4); \ 495 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \ 499 #define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \ 500 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ 501 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ 502 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ 503 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ 504 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ 505 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ 506 GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ 507 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ 509 this_method_does_not_take_5_arguments); \ 510 GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \ 511 return GMOCK_MOCKER_(5, constness, Method).Invoke(gmock_a1, gmock_a2, \ 512 gmock_a3, gmock_a4, gmock_a5); \ 514 ::testing::MockSpec<__VA_ARGS__>& \ 515 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ 516 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ 517 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ 518 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ 519 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ 520 GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \ 521 return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \ 522 gmock_a3, gmock_a4, gmock_a5); \ 524 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \ 528 #define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \ 529 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ 530 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ 531 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ 532 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ 533 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ 534 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ 535 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ 536 GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ 537 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ 539 this_method_does_not_take_6_arguments); \ 540 GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \ 541 return GMOCK_MOCKER_(6, constness, Method).Invoke(gmock_a1, gmock_a2, \ 542 gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ 544 ::testing::MockSpec<__VA_ARGS__>& \ 545 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ 546 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ 547 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ 548 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ 549 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ 550 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ 551 GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \ 552 return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \ 553 gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ 555 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \ 559 #define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \ 560 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ 561 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ 562 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ 563 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ 564 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ 565 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ 566 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ 567 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ 568 GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ 569 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ 571 this_method_does_not_take_7_arguments); \ 572 GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \ 573 return GMOCK_MOCKER_(7, constness, Method).Invoke(gmock_a1, gmock_a2, \ 574 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \ 576 ::testing::MockSpec<__VA_ARGS__>& \ 577 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ 578 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ 579 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ 580 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ 581 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ 582 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ 583 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ 584 GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \ 585 return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \ 586 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \ 588 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \ 592 #define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \ 593 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ 594 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ 595 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ 596 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ 597 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ 598 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ 599 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ 600 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ 601 GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ 602 GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ 603 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ 605 this_method_does_not_take_8_arguments); \ 606 GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \ 607 return GMOCK_MOCKER_(8, constness, Method).Invoke(gmock_a1, gmock_a2, \ 608 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \ 610 ::testing::MockSpec<__VA_ARGS__>& \ 611 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ 612 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ 613 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ 614 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ 615 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ 616 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ 617 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ 618 GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ 619 GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \ 620 return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \ 621 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \ 623 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \ 627 #define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \ 628 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ 629 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ 630 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ 631 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ 632 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ 633 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ 634 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ 635 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ 636 GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \ 637 GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ 638 GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ 639 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ 641 this_method_does_not_take_9_arguments); \ 642 GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \ 643 return GMOCK_MOCKER_(9, constness, Method).Invoke(gmock_a1, gmock_a2, \ 644 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \ 647 ::testing::MockSpec<__VA_ARGS__>& \ 648 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ 649 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ 650 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ 651 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ 652 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ 653 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ 654 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ 655 GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ 656 GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ 657 GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \ 658 return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \ 659 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \ 662 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \ 666 #define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \ 667 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ 668 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ 669 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ 670 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ 671 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ 672 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ 673 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ 674 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ 675 GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \ 676 GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \ 677 GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \ 678 GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ 679 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ 681 this_method_does_not_take_10_arguments); \ 682 GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \ 683 return GMOCK_MOCKER_(10, constness, Method).Invoke(gmock_a1, gmock_a2, \ 684 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \ 687 ::testing::MockSpec<__VA_ARGS__>& \ 688 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ 689 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ 690 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ 691 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ 692 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ 693 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ 694 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ 695 GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ 696 GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \ 697 GMOCK_MATCHER_(tn, 10, \ 698 __VA_ARGS__) gmock_a10) constness { \ 699 GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \ 700 return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \ 701 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \ 704 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \ 707 #define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__) 708 #define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__) 709 #define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__) 710 #define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__) 711 #define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__) 712 #define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__) 713 #define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__) 714 #define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__) 715 #define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__) 716 #define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__) 717 #define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__) 719 #define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__) 720 #define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__) 721 #define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__) 722 #define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__) 723 #define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__) 724 #define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__) 725 #define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__) 726 #define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__) 727 #define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__) 728 #define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__) 729 #define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__) 731 #define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__) 732 #define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__) 733 #define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__) 734 #define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__) 735 #define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__) 736 #define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__) 737 #define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__) 738 #define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__) 739 #define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__) 740 #define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__) 741 #define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__) 743 #define MOCK_CONST_METHOD0_T(m, ...) \ 744 GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__) 745 #define MOCK_CONST_METHOD1_T(m, ...) \ 746 GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__) 747 #define MOCK_CONST_METHOD2_T(m, ...) \ 748 GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__) 749 #define MOCK_CONST_METHOD3_T(m, ...) \ 750 GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__) 751 #define MOCK_CONST_METHOD4_T(m, ...) \ 752 GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__) 753 #define MOCK_CONST_METHOD5_T(m, ...) \ 754 GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__) 755 #define MOCK_CONST_METHOD6_T(m, ...) \ 756 GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__) 757 #define MOCK_CONST_METHOD7_T(m, ...) \ 758 GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__) 759 #define MOCK_CONST_METHOD8_T(m, ...) \ 760 GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__) 761 #define MOCK_CONST_METHOD9_T(m, ...) \ 762 GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__) 763 #define MOCK_CONST_METHOD10_T(m, ...) \ 764 GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__) 766 #define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \ 767 GMOCK_METHOD0_(, , ct, m, __VA_ARGS__) 768 #define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \ 769 GMOCK_METHOD1_(, , ct, m, __VA_ARGS__) 770 #define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \ 771 GMOCK_METHOD2_(, , ct, m, __VA_ARGS__) 772 #define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \ 773 GMOCK_METHOD3_(, , ct, m, __VA_ARGS__) 774 #define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \ 775 GMOCK_METHOD4_(, , ct, m, __VA_ARGS__) 776 #define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \ 777 GMOCK_METHOD5_(, , ct, m, __VA_ARGS__) 778 #define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \ 779 GMOCK_METHOD6_(, , ct, m, __VA_ARGS__) 780 #define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \ 781 GMOCK_METHOD7_(, , ct, m, __VA_ARGS__) 782 #define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \ 783 GMOCK_METHOD8_(, , ct, m, __VA_ARGS__) 784 #define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \ 785 GMOCK_METHOD9_(, , ct, m, __VA_ARGS__) 786 #define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \ 787 GMOCK_METHOD10_(, , ct, m, __VA_ARGS__) 789 #define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \ 790 GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__) 791 #define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \ 792 GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__) 793 #define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \ 794 GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__) 795 #define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \ 796 GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__) 797 #define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \ 798 GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__) 799 #define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \ 800 GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__) 801 #define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \ 802 GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__) 803 #define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \ 804 GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__) 805 #define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \ 806 GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__) 807 #define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \ 808 GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__) 809 #define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \ 810 GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__) 812 #define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \ 813 GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__) 814 #define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \ 815 GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__) 816 #define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \ 817 GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__) 818 #define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \ 819 GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__) 820 #define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \ 821 GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__) 822 #define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \ 823 GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__) 824 #define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \ 825 GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__) 826 #define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \ 827 GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__) 828 #define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \ 829 GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__) 830 #define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \ 831 GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__) 832 #define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \ 833 GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__) 835 #define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \ 836 GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__) 837 #define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \ 838 GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__) 839 #define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \ 840 GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__) 841 #define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \ 842 GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__) 843 #define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \ 844 GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__) 845 #define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \ 846 GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__) 847 #define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \ 848 GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__) 849 #define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \ 850 GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__) 851 #define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \ 852 GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__) 853 #define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \ 854 GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__) 855 #define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \ 856 GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__) 893 template <
typename F>
896 template <
typename R>
897 class MockFunction<R()>
908 template <
typename R,
typename A0>
920 template <
typename R,
typename A0,
typename A1>
932 template <
typename R,
typename A0,
typename A1,
typename A2>
944 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3>
956 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
969 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
970 typename A4,
typename A5>
982 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
983 typename A4,
typename A5,
typename A6>
995 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
996 typename A4,
typename A5,
typename A6,
typename A7>
1008 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
1009 typename A4,
typename A5,
typename A6,
typename A7,
typename A8>
1010 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)>
1021 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
1022 typename A4,
typename A5,
typename A6,
typename A7,
typename A8,
1024 class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)>
1029 MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));
1037 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ #define MOCK_METHOD8_T(m,...)
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
#define MOCK_METHOD2_T(m,...)
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10)
MockSpec< F > & With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4, const Matcher< A5 > &m5, const Matcher< A6 > &m6, const Matcher< A7 > &m7, const Matcher< A8 > &m8)
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
MockSpec< F > & With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4, const Matcher< A5 > &m5, const Matcher< A6 > &m6)
#define MOCK_METHOD4_T(m,...)
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, A8)
internal::Function< F >::ArgumentTuple ArgumentTuple
#define MOCK_METHOD3_T(m,...)
MockSpec< F > & With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4, const Matcher< A5 > &m5, const Matcher< A6 > &m6, const Matcher< A7 > &m7)
internal::Function< F >::ArgumentTuple ArgumentTuple
#define MOCK_METHOD9_T(m,...)
#define MOCK_METHOD10_T(m,...)
#define MOCK_METHOD1_T(m,...)
internal::Function< F >::ArgumentTuple ArgumentTuple
internal::Function< F >::ArgumentTuple ArgumentTuple
internal::Function< F >::ArgumentTuple ArgumentTuple
MockSpec< F > & With(const Matcher< A1 > &m1, const Matcher< A2 > &m2)
#define MOCK_METHOD6_T(m,...)
MockSpec< F > & With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4, const Matcher< A5 > &m5, const Matcher< A6 > &m6, const Matcher< A7 > &m7, const Matcher< A8 > &m8, const Matcher< A9 > &m9)
#define MOCK_METHOD5_T(m,...)
R Invoke(A1 a1, A2 a2, A3 a3)
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
internal::Function< F >::ArgumentTuple ArgumentTuple
#define MOCK_METHOD0_T(m,...)
internal::Function< F >::ArgumentTuple ArgumentTuple
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
MockSpec< F > & With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3)
MockSpec< F > & With(const Matcher< A1 > &m1)
#define MOCK_METHOD7_T(m,...)
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
R F(A1, A2, A3, A4, A5, A6, A7, A8, A9)
R F(A1, A2, A3, A4, A5, A6, A7)
MockSpec< F > & With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4, const Matcher< A5 > &m5)
internal::Function< F >::ArgumentTuple ArgumentTuple
MockSpec< F > & With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4, const Matcher< A5 > &m5, const Matcher< A6 > &m6, const Matcher< A7 > &m7, const Matcher< A8 > &m8, const Matcher< A9 > &m9, const Matcher< A10 > &m10)
R F(A1, A2, A3, A4, A5, A6)
internal::Function< F >::ArgumentTuple ArgumentTuple
MockSpec< F > & With(const Matcher< A1 > &m1, const Matcher< A2 > &m2, const Matcher< A3 > &m3, const Matcher< A4 > &m4)
internal::Function< F >::ArgumentTuple ArgumentTuple
internal::Function< F >::ArgumentTuple ArgumentTuple
R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)