36 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_H_
37 #define GMOCK_INCLUDE_GMOCK_GMOCK_H_
93 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
94 #define GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
140 #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
141 #define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
187 #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
188 #define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
228 #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
229 #define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
242 #include "gtest/gtest.h"
285 #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
286 #define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
288 #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
297 #if defined(_MSC_VER) && _MSC_VER < 1310
298 # error "At least Visual C++ 2003 (7.1) is required to compile Google Mock."
303 #define GMOCK_FLAG(name) FLAGS_gmock_##name
305 #if !defined(GMOCK_DECLARE_bool_)
308 #define GMOCK_DECLARE_bool_(name) extern GTEST_API_ bool GMOCK_FLAG(name)
309 #define GMOCK_DECLARE_int32_(name) \
310 extern GTEST_API_ ::testing::internal::Int32 GMOCK_FLAG(name)
311 #define GMOCK_DECLARE_string_(name) \
312 extern GTEST_API_ ::std::string GMOCK_FLAG(name)
315 #define GMOCK_DEFINE_bool_(name, default_val, doc) \
316 GTEST_API_ bool GMOCK_FLAG(name) = (default_val)
317 #define GMOCK_DEFINE_int32_(name, default_val, doc) \
318 GTEST_API_ ::testing::internal::Int32 GMOCK_FLAG(name) = (default_val)
319 #define GMOCK_DEFINE_string_(name, default_val, doc) \
320 GTEST_API_ ::std::string GMOCK_FLAG(name) = (default_val)
322 #endif // !defined(GMOCK_DECLARE_bool_)
324 #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
328 template <
typename T>
342 template <
typename T>
348 template <
typename Tuple>
353 typedef ::testing::tuple< >
type;
356 template <
typename A1>
358 typedef ::testing::tuple<Matcher<A1> >
type;
361 template <
typename A1,
typename A2>
366 template <
typename A1,
typename A2,
typename A3>
371 template <
typename A1,
typename A2,
typename A3,
typename A4>
377 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
383 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
390 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
391 typename A6,
typename A7>
397 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
398 typename A6,
typename A7,
typename A8>
399 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
404 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
405 typename A6,
typename A7,
typename A8,
typename A9>
406 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
411 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
412 typename A6,
typename A7,
typename A8,
typename A9,
typename A10>
413 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
433 template <
typename F>
436 template <
typename R>
445 template <
typename R,
typename A1>
455 template <
typename R,
typename A1,
typename A2>
465 template <
typename R,
typename A1,
typename A2,
typename A3>
475 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4>
485 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
496 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
497 typename A5,
typename A6>
507 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
508 typename A5,
typename A6,
typename A7>
510 :
Function<R(A1, A2, A3, A4, A5, A6)> {
518 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
519 typename A5,
typename A6,
typename A7,
typename A8>
521 :
Function<R(A1, A2, A3, A4, A5, A6, A7)> {
529 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
530 typename A5,
typename A6,
typename A7,
typename A8,
typename A9>
531 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
532 :
Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
541 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
542 typename A5,
typename A6,
typename A7,
typename A8,
typename A9,
544 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
545 :
Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
547 typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
559 #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
574 template <
typename Po
inter>
578 typedef typename Pointer::element_type
type;
581 template <
typename T>
587 template <
typename Po
inter>
592 template <
typename Element>
596 template <
typename T>
598 bool operator()(const ::testing::internal::linked_ptr<T>& lhs,
599 const ::testing::internal::linked_ptr<T>& rhs)
const {
600 return lhs.get() < rhs.get();
612 #if (GTEST_OS_SYMBIAN && defined(_STLP_NO_WCHAR_T)) || \
613 (defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED))
616 # define GMOCK_WCHAR_T_IS_NATIVE_ 1
630 # define GMOCK_HAS_SIGNED_WCHAR_T_ 1
643 template <
typename T>
struct KindOf {
648 #define GMOCK_DECLARE_KIND_(type, kind) \
649 template <> struct KindOf<type> { enum { value = kind }; }
664 #if GMOCK_WCHAR_T_IS_NATIVE_
677 #undef GMOCK_DECLARE_KIND_
680 #define GMOCK_KIND_OF_(type) \
681 static_cast< ::testing::internal::TypeKind>( \
682 ::testing::internal::KindOf<type>::value)
685 #define GMOCK_IS_SIGNED_(T) (static_cast<T>(-1) < 0)
696 template <TypeKind kFromKind,
typename From, TypeKind kToKind,
typename To>
705 template <
typename To>
710 template <
typename To>
715 template <
typename From>
721 template <
typename From,
typename To>
726 ((sizeof(From) < sizeof(To)) &&
727 (!GMOCK_IS_SIGNED_(From) || GMOCK_IS_SIGNED_(To))) ||
729 ((sizeof(From) == sizeof(To)) &&
730 (GMOCK_IS_SIGNED_(From) == GMOCK_IS_SIGNED_(To)))> {};
732 #undef GMOCK_IS_SIGNED_
736 template <typename From, typename To>
737 struct LosslessArithmeticConvertibleImpl<kInteger, From, kFloatingPoint, To>
738 : public false_type {};
741 template <typename From>
742 struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kBool, bool>
743 : public false_type {};
746 template <typename From, typename To>
747 struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To>
748 : public false_type {};
752 template <typename From, typename To>
753 struct LosslessArithmeticConvertibleImpl<
754 kFloatingPoint, From, kFloatingPoint, To>
755 : public bool_constant<sizeof(From) <= sizeof(To)> {};
764 template <typename From, typename To>
765 struct LosslessArithmeticConvertible
766 : public LosslessArithmeticConvertibleImpl<
767 GMOCK_KIND_OF_(From), From, GMOCK_KIND_OF_(To), To> {};
771 class FailureReporterInterface {
778 virtual ~FailureReporterInterface() {}
781 virtual void ReportFailure(FailureType type, const char* file, int line,
782 const string& message) = 0;
786 GTEST_API_ FailureReporterInterface* GetFailureReporter();
793 inline void Assert(bool condition, const char* file, int line,
796 GetFailureReporter()->ReportFailure(FailureReporterInterface::kFatal,
800 inline void Assert(bool condition, const char* file, int line) {
801 Assert(condition, file, line, "Assertion failed.");
806 inline void Expect(bool condition, const char* file, int line,
809 GetFailureReporter()->ReportFailure(FailureReporterInterface::kNonfatal,
813 inline void
Expect(bool condition, const char* file, int line) {
845 int stack_frames_to_skip);
852 template <
typename T>
struct is_reference :
public false_type {};
853 template <
typename T>
struct is_reference<
T&> :
public true_type {};
856 template <
typename T1,
typename T2>
struct type_equals :
public false_type {};
857 template <
typename T>
struct type_equals<
T,
T> :
public true_type {};
866 template <
typename T,
size_t N>
struct DecayArray<
T[
N]> {
867 typedef const T*
type;
872 template <
typename T>
struct DecayArray<
T[]> {
873 typedef const T*
type;
879 # pragma warning(push)
880 # pragma warning(disable:4717)
888 template <
typename T>
890 Assert(
false,
"", -1,
"Internal error: attempt to return invalid value");
898 # pragma warning(pop)
917 template <
class RawContainer>
918 class StlContainerView {
933 template <
typename Element,
size_t N>
934 class StlContainerView<Element[
N]> {
947 testing::StaticAssertTypeEq<Element, RawElement>();
962 return type(
const_cast<Element*
>(&
array[0]),
N,
966 #endif // GTEST_OS_SYMBIAN
973 #endif // GTEST_OS_SYMBIAN
979 template <
typename ElementPo
inter,
typename Size>
988 const ::testing::tuple<ElementPointer, Size>&
array) {
998 template <
typename T>
class StlContainerView<
T&>;
1003 template <
typename T>
1004 struct RemoveConstFromKey {
1009 template <
typename K,
typename V>
1016 template <
bool kValue>
1022 #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
1025 #if GTEST_HAS_STD_TYPE_TRAITS_ // Defined by gtest-port.h via gmock-port.h.
1026 #include <type_traits>
1042 template <
typename F1,
typename F2>
1050 template <
typename T,
bool kDefaultConstructible>
1054 template <
typename T>
1055 struct BuiltInDefaultValueGetter<
T,
false> {
1057 Assert(
false, __FILE__, __LINE__,
1058 "Default action undefined for the function return type.");
1059 return internal::Invalid<T>();
1072 template <
typename T>
1073 class BuiltInDefaultValue {
1075 #if GTEST_HAS_STD_TYPE_TRAITS_
1082 return BuiltInDefaultValueGetter<
1086 #else // GTEST_HAS_STD_TYPE_TRAITS_
1096 #endif // GTEST_HAS_STD_TYPE_TRAITS_
1101 template <
typename T>
1102 class BuiltInDefaultValue<
const T> {
1110 template <
typename T>
1111 class BuiltInDefaultValue<
T*> {
1119 #define GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(type, value) \
1121 class BuiltInDefaultValue<type> { \
1123 static bool Exists() { return true; } \
1124 static type Get() { return value; } \
1128 #if GTEST_HAS_GLOBAL_STRING
1130 #endif // GTEST_HAS_GLOBAL_STRING
1143 #if GMOCK_WCHAR_T_IS_NATIVE_
1158 #undef GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_
1175 template <
typename T>
1218 class ValueProducer {
1224 class FixedValueProducer :
public ValueProducer {
1234 class FactoryValueProducer :
public ValueProducer {
1250 template <
typename T>
1294 template <
typename T>
1298 template <
typename T>
1302 template <
typename F>
1303 class ActionInterface {
1330 template <
typename F>
1351 template <
typename Func>
1366 "You are using DoDefault() inside a composite action like "
1367 "DoAll() or WithArgs(). This is not supported for technical "
1368 "reasons. Please instead spell out the default action, or "
1369 "assign the default action to an Action variable and use "
1370 "the variable in various places.");
1375 template <
typename F1,
typename F2>
1402 template <
typename Impl>
1407 template <
typename F>
1413 template <
typename F>
1422 return impl_.template Perform<Result>(
args);
1438 template <
typename F>
1439 Action<F>
MakeAction(ActionInterface<F>* impl) {
1440 return Action<F>(impl);
1450 template <
typename Impl>
1452 return PolymorphicAction<Impl>(impl);
1459 template <
typename F1,
typename F2>
1460 class ActionAdaptor :
public ActionInterface<F1> {
1479 template <
typename T>
1509 template <
typename R>
1510 class ReturnAction {
1519 template <
typename F>
1532 use_ReturnRef_instead_of_Return_to_return_a_reference);
1538 template <
typename R_,
typename F>
1559 Result_cannot_be_a_reference_type);
1570 template <
typename R_,
typename F>
1581 <<
"A ByMove() action should only be performed once.";
1604 template <
typename Result,
typename ArgumentTuple>
1606 #if GTEST_LANG_CXX11
1610 ReturnNull_can_be_used_to_return_a_pointer_only);
1612 #endif // GTEST_LANG_CXX11
1617 class ReturnVoidAction {
1620 template <
typename Result,
typename ArgumentTuple>
1629 template <
typename T>
1630 class ReturnRefAction {
1637 template <
typename F>
1644 use_Return_instead_of_ReturnRef_to_return_a_value);
1650 template <
typename F>
1676 template <
typename T>
1677 class ReturnRefOfCopyAction {
1685 template <
typename F>
1693 use_Return_instead_of_ReturnRefOfCopy_to_return_a_value);
1699 template <
typename F>
1723 class DoDefaultAction {
1727 template <
typename F>
1733 template <
typename T1,
typename T2>
1734 class AssignAction {
1738 template <
typename Result,
typename ArgumentTuple>
1750 #if !GTEST_OS_WINDOWS_MOBILE
1754 template <
typename T>
1755 class SetErrnoAndReturnAction {
1760 template <
typename Result,
typename ArgumentTuple>
1773 #endif // !GTEST_OS_WINDOWS_MOBILE
1779 template <
size_t N,
typename A,
bool kIsProto>
1780 class SetArgumentPointeeAction {
1786 template <
typename Result,
typename ArgumentTuple>
1798 template <
size_t N,
typename Proto>
1799 class SetArgumentPointeeAction<
N, Proto,
true> {
1806 proto_->CopyFrom(proto);
1809 template <
typename Result,
typename ArgumentTuple>
1812 ::testing::get<N>(
args)->CopyFrom(*proto_);
1826 template <
typename FunctionImpl>
1836 template <
typename Result,
typename ArgumentTuple>
1846 template <
class Class,
typename MethodPtr>
1852 template <
typename Result,
typename ArgumentTuple>
1865 template <
typename A>
1870 template <
typename F>
1889 template <
typename F>
1925 template <
typename T>
1939 template <
typename T>
1947 template <
typename Action1,
typename Action2>
1955 template <
typename F>
1962 template <
typename F>
2028 template <
typename To>
2029 template <
typename From>
2036 template <
typename R>
2042 inline PolymorphicAction<internal::ReturnNullAction>
ReturnNull() {
2047 inline PolymorphicAction<internal::ReturnVoidAction>
Return() {
2052 template <
typename R>
2053 inline internal::ReturnRefAction<R>
ReturnRef(R&
x) {
2054 return internal::ReturnRefAction<R>(
x);
2060 template <
typename R>
2062 return internal::ReturnRefOfCopyAction<R>(
x);
2069 template <
typename R>
2070 internal::ByMoveWrapper<R>
ByMove(R
x) {
2075 inline internal::DoDefaultAction
DoDefault() {
2076 return internal::DoDefaultAction();
2081 template <
size_t N,
typename T>
2083 internal::SetArgumentPointeeAction<
2090 #if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)
2096 internal::SetArgumentPointeeAction<N, const char*, false> >
2099 N,
const char*,
false>(
p));
2104 internal::SetArgumentPointeeAction<N, const wchar_t*, false> >
2107 N,
const wchar_t*,
false>(
p));
2112 template <
size_t N,
typename T>
2114 internal::SetArgumentPointeeAction<
2122 template <
typename T1,
typename T2>
2123 PolymorphicAction<internal::AssignAction<T1, T2> >
Assign(
T1*
ptr,
T2 val) {
2127 #if !GTEST_OS_WINDOWS_MOBILE
2130 template <
typename T>
2131 PolymorphicAction<internal::SetErrnoAndReturnAction<T> >
2134 internal::SetErrnoAndReturnAction<T>(errval,
result));
2137 #endif // !GTEST_OS_WINDOWS_MOBILE
2142 template <
typename FunctionImpl>
2143 PolymorphicAction<internal::InvokeWithoutArgsAction<FunctionImpl> >
2151 template <
class Class,
typename MethodPtr>
2152 PolymorphicAction<internal::InvokeMethodWithoutArgsAction<Class, MethodPtr> >
2156 obj_ptr, method_ptr));
2162 template <
typename A>
2163 inline internal::IgnoreResultAction<A>
IgnoreResult(
const A& an_action) {
2164 return internal::IgnoreResultAction<A>(an_action);
2174 template <
typename T>
2181 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
2219 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
2220 #define GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
2254 virtual void DescribeTo(::std::ostream* os)
const = 0;
2278 return impl_->IsSatisfiedByCallCount(call_count);
2283 return impl_->IsSaturatedByCallCount(call_count);
2289 return impl_->IsSaturatedByCallCount(call_count) &&
2290 !
impl_->IsSatisfiedByCallCount(call_count);
2297 static void DescribeActualCallCountTo(
int actual_call_count,
2298 ::std::ostream* os);
2326 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
2364 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
2365 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
2374 template <
typename Result,
typename ArgumentTuple>
2377 template <
typename R>
2380 template <
typename Function>
2385 template <
class Class,
typename MethodPtr>
2387 MethodPtr method_ptr,
2388 const ::testing::tuple<>&) {
2389 return (obj_ptr->*method_ptr)();
2393 template <
typename R,
typename A1>
2396 template <
typename Function>
2398 return function(get<0>(
args));
2401 template <
class Class,
typename MethodPtr>
2403 MethodPtr method_ptr,
2404 const ::testing::tuple<A1>&
args) {
2405 return (obj_ptr->*method_ptr)(get<0>(
args));
2409 template <
typename R,
typename A1,
typename A2>
2412 template <
typename Function>
2414 return function(get<0>(
args), get<1>(
args));
2417 template <
class Class,
typename MethodPtr>
2419 MethodPtr method_ptr,
2420 const ::testing::tuple<A1, A2>&
args) {
2421 return (obj_ptr->*method_ptr)(get<0>(
args), get<1>(
args));
2425 template <
typename R,
typename A1,
typename A2,
typename A3>
2428 template <
typename Function>
2430 return function(get<0>(
args), get<1>(
args), get<2>(
args));
2433 template <
class Class,
typename MethodPtr>
2435 MethodPtr method_ptr,
2436 const ::testing::tuple<A1, A2, A3>&
args) {
2437 return (obj_ptr->*method_ptr)(get<0>(
args), get<1>(
args),
2442 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4>
2445 template <
typename Function>
2448 return function(get<0>(
args), get<1>(
args), get<2>(
args),
2452 template <
class Class,
typename MethodPtr>
2454 MethodPtr method_ptr,
2455 const ::testing::tuple<A1, A2, A3, A4>&
args) {
2456 return (obj_ptr->*method_ptr)(get<0>(
args), get<1>(
args),
2461 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
2465 template <
typename Function>
2468 return function(get<0>(
args), get<1>(
args), get<2>(
args),
2472 template <
class Class,
typename MethodPtr>
2474 MethodPtr method_ptr,
2475 const ::testing::tuple<A1, A2, A3, A4, A5>&
args) {
2476 return (obj_ptr->*method_ptr)(get<0>(
args), get<1>(
args),
2481 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
2482 typename A5,
typename A6>
2485 template <
typename Function>
2488 return function(get<0>(
args), get<1>(
args), get<2>(
args),
2492 template <
class Class,
typename MethodPtr>
2494 MethodPtr method_ptr,
2495 const ::testing::tuple<A1, A2, A3, A4, A5, A6>&
args) {
2496 return (obj_ptr->*method_ptr)(get<0>(
args), get<1>(
args),
2501 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
2502 typename A5,
typename A6,
typename A7>
2505 template <
typename Function>
2508 return function(get<0>(
args), get<1>(
args), get<2>(
args),
2512 template <
class Class,
typename MethodPtr>
2514 MethodPtr method_ptr,
2515 const ::testing::tuple<A1, A2, A3, A4, A5, A6,
2517 return (obj_ptr->*method_ptr)(get<0>(
args), get<1>(
args),
2523 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
2524 typename A5,
typename A6,
typename A7,
typename A8>
2527 template <
typename Function>
2529 A6, A7, A8>&
args) {
2530 return function(get<0>(
args), get<1>(
args), get<2>(
args),
2535 template <
class Class,
typename MethodPtr>
2537 MethodPtr method_ptr,
2538 const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7,
2540 return (obj_ptr->*method_ptr)(get<0>(
args), get<1>(
args),
2546 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
2547 typename A5,
typename A6,
typename A7,
typename A8,
typename A9>
2548 class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
2550 template <
typename Function>
2552 A6, A7, A8, A9>&
args) {
2553 return function(get<0>(
args), get<1>(
args), get<2>(
args),
2558 template <
class Class,
typename MethodPtr>
2560 MethodPtr method_ptr,
2561 const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
2563 return (obj_ptr->*method_ptr)(get<0>(
args), get<1>(
args),
2569 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
2570 typename A5,
typename A6,
typename A7,
typename A8,
typename A9,
2572 class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
2575 template <
typename Function>
2577 A6, A7, A8, A9, A10>&
args) {
2578 return function(get<0>(
args), get<1>(
args), get<2>(
args),
2583 template <
class Class,
typename MethodPtr>
2585 MethodPtr method_ptr,
2586 const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
2588 return (obj_ptr->*method_ptr)(get<0>(
args), get<1>(
args),
2596 #define GMOCK_FIELD_(Tuple, N) \
2597 typename ::testing::tuple_element<N, Tuple>::type
2617 template <
typename Result,
typename ArgumentTuple,
int k1,
int k2,
int k3,
2618 int k4,
int k5,
int k6,
int k7,
int k8,
int k9,
int k10>
2635 template <
typename Result,
typename ArgumentTuple>
2637 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
2646 template <
typename Result,
typename ArgumentTuple,
int k1>
2648 k1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
2657 template <
typename Result,
typename ArgumentTuple,
int k1,
int k2>
2659 k1,
k2, -1, -1, -1, -1, -1, -1, -1, -1> {
2669 template <
typename Result,
typename ArgumentTuple,
int k1,
int k2,
int k3>
2671 k1,
k2, k3, -1, -1, -1, -1, -1, -1, -1> {
2681 template <
typename Result,
typename ArgumentTuple,
int k1,
int k2,
int k3,
2684 k1,
k2, k3, k4, -1, -1, -1, -1, -1, -1> {
2696 template <
typename Result,
typename ArgumentTuple,
int k1,
int k2,
int k3,
2699 k1,
k2, k3, k4, k5, -1, -1, -1, -1, -1> {
2711 template <
typename Result,
typename ArgumentTuple,
int k1,
int k2,
int k3,
2712 int k4,
int k5,
int k6>
2714 k1,
k2, k3, k4, k5, k6, -1, -1, -1, -1> {
2727 template <
typename Result,
typename ArgumentTuple,
int k1,
int k2,
int k3,
2728 int k4,
int k5,
int k6,
int k7>
2730 k1,
k2, k3, k4, k5, k6, k7, -1, -1, -1> {
2743 template <
typename Result,
typename ArgumentTuple,
int k1,
int k2,
int k3,
2744 int k4,
int k5,
int k6,
int k7,
int k8>
2746 k1,
k2, k3, k4, k5, k6, k7, k8, -1, -1> {
2761 template <
typename Result,
typename ArgumentTuple,
int k1,
int k2,
int k3,
2762 int k4,
int k5,
int k6,
int k7,
int k8,
int k9>
2764 k1,
k2, k3, k4, k5, k6, k7, k8, k9, -1> {
2782 template <
typename InnerAction,
int k1 = -1,
int k2 = -1,
int k3 = -1,
2783 int k4 = -1,
int k5 = -1,
int k6 = -1,
int k7 = -1,
int k8 = -1,
2784 int k9 = -1,
int k10 = -1>
2785 class WithArgsAction {
2789 template <
typename F>
2793 template <
typename F>
2803 k5, k6, k7, k8, k9, k10>::Select(
args));
2835 template <
typename Result,
class Impl>
2836 class ActionHelper {
2845 template <
typename A0>
2847 return impl->template gmock_PerformImpl<A0>(
args, get<0>(
args),
2853 template <
typename A0,
typename A1>
2855 return impl->template gmock_PerformImpl<A0, A1>(
args, get<0>(
args),
2861 template <
typename A0,
typename A1,
typename A2>
2863 return impl->template gmock_PerformImpl<A0, A1, A2>(
args, get<0>(
args),
2869 template <
typename A0,
typename A1,
typename A2,
typename A3>
2872 return impl->template gmock_PerformImpl<A0, A1, A2, A3>(
args, get<0>(
args),
2878 template <
typename A0,
typename A1,
typename A2,
typename A3,
typename A4>
2881 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(
args,
2887 template <
typename A0,
typename A1,
typename A2,
typename A3,
typename A4,
2891 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(
args,
2897 template <
typename A0,
typename A1,
typename A2,
typename A3,
typename A4,
2898 typename A5,
typename A6>
2901 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(
args,
2907 template <
typename A0,
typename A1,
typename A2,
typename A3,
typename A4,
2908 typename A5,
typename A6,
typename A7>
2910 A5, A6, A7>&
args) {
2911 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6,
2917 template <
typename A0,
typename A1,
typename A2,
typename A3,
typename A4,
2918 typename A5,
typename A6,
typename A7,
typename A8>
2920 A5, A6, A7, A8>&
args) {
2921 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7,
2927 template <
typename A0,
typename A1,
typename A2,
typename A3,
typename A4,
2928 typename A5,
typename A6,
typename A7,
typename A8,
typename A9>
2930 A5, A6, A7, A8, A9>&
args) {
2931 return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8,
2947 template <
int k1,
typename InnerAction>
2948 inline internal::WithArgsAction<InnerAction, k1>
2953 template <
int k1,
int k2,
typename InnerAction>
2954 inline internal::WithArgsAction<InnerAction, k1, k2>
2959 template <
int k1,
int k2,
int k3,
typename InnerAction>
2960 inline internal::WithArgsAction<InnerAction, k1, k2, k3>
2965 template <
int k1,
int k2,
int k3,
int k4,
typename InnerAction>
2966 inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4>
2971 template <
int k1,
int k2,
int k3,
int k4,
int k5,
typename InnerAction>
2972 inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>
2977 template <
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
typename InnerAction>
2978 inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>
2983 template <
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
int k7,
2984 typename InnerAction>
2985 inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7>
2991 template <
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
int k7,
int k8,
2992 typename InnerAction>
2993 inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8>
2999 template <
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
int k7,
int k8,
3000 int k9,
typename InnerAction>
3001 inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8, k9>
3007 template <
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
int k7,
int k8,
3008 int k9,
int k10,
typename InnerAction>
3009 inline internal::WithArgsAction<InnerAction,
k1,
k2, k3, k4, k5, k6, k7, k8,
3018 template <
typename Action1,
typename Action2>
3019 inline internal::DoBothAction<Action1, Action2>
3024 template <
typename Action1,
typename Action2,
typename Action3>
3025 inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
3031 template <
typename Action1,
typename Action2,
typename Action3,
3033 inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
3034 internal::DoBothAction<Action3, Action4> > >
3039 template <
typename Action1,
typename Action2,
typename Action3,
3040 typename Action4,
typename Action5>
3041 inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
3042 internal::DoBothAction<Action3, internal::DoBothAction<Action4,
3044 DoAll(Action1
a1, Action2
a2, Action3 a3, Action4 a4, Action5 a5) {
3048 template <
typename Action1,
typename Action2,
typename Action3,
3049 typename Action4,
typename Action5,
typename Action6>
3050 inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
3051 internal::DoBothAction<Action3, internal::DoBothAction<Action4,
3052 internal::DoBothAction<Action5, Action6> > > > >
3053 DoAll(Action1
a1, Action2
a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6) {
3057 template <
typename Action1,
typename Action2,
typename Action3,
3058 typename Action4,
typename Action5,
typename Action6,
typename Action7>
3059 inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
3060 internal::DoBothAction<Action3, internal::DoBothAction<Action4,
3061 internal::DoBothAction<Action5, internal::DoBothAction<Action6,
3063 DoAll(Action1
a1, Action2
a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
3068 template <
typename Action1,
typename Action2,
typename Action3,
3069 typename Action4,
typename Action5,
typename Action6,
typename Action7,
3071 inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
3072 internal::DoBothAction<Action3, internal::DoBothAction<Action4,
3073 internal::DoBothAction<Action5, internal::DoBothAction<Action6,
3074 internal::DoBothAction<Action7, Action8> > > > > > >
3075 DoAll(Action1
a1, Action2
a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
3076 Action7 a7, Action8 a8) {
3080 template <
typename Action1,
typename Action2,
typename Action3,
3081 typename Action4,
typename Action5,
typename Action6,
typename Action7,
3082 typename Action8,
typename Action9>
3083 inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
3084 internal::DoBothAction<Action3, internal::DoBothAction<Action4,
3085 internal::DoBothAction<Action5, internal::DoBothAction<Action6,
3086 internal::DoBothAction<Action7, internal::DoBothAction<Action8,
3087 Action9> > > > > > > >
3088 DoAll(Action1
a1, Action2
a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
3089 Action7 a7, Action8 a8, Action9 a9) {
3093 template <
typename Action1,
typename Action2,
typename Action3,
3094 typename Action4,
typename Action5,
typename Action6,
typename Action7,
3095 typename Action8,
typename Action9,
typename Action10>
3096 inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
3097 internal::DoBothAction<Action3, internal::DoBothAction<Action4,
3098 internal::DoBothAction<Action5, internal::DoBothAction<Action6,
3099 internal::DoBothAction<Action7, internal::DoBothAction<Action8,
3100 internal::DoBothAction<Action9, Action10> > > > > > > > >
3101 DoAll(Action1
a1, Action2
a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
3102 Action7 a7, Action8 a8, Action9 a9, Action10 a10) {
3205 #define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
3206 const args_type& args GTEST_ATTRIBUTE_UNUSED_, \
3207 arg0_type arg0 GTEST_ATTRIBUTE_UNUSED_, \
3208 arg1_type arg1 GTEST_ATTRIBUTE_UNUSED_, \
3209 arg2_type arg2 GTEST_ATTRIBUTE_UNUSED_, \
3210 arg3_type arg3 GTEST_ATTRIBUTE_UNUSED_, \
3211 arg4_type arg4 GTEST_ATTRIBUTE_UNUSED_, \
3212 arg5_type arg5 GTEST_ATTRIBUTE_UNUSED_, \
3213 arg6_type arg6 GTEST_ATTRIBUTE_UNUSED_, \
3214 arg7_type arg7 GTEST_ATTRIBUTE_UNUSED_, \
3215 arg8_type arg8 GTEST_ATTRIBUTE_UNUSED_, \
3216 arg9_type arg9 GTEST_ATTRIBUTE_UNUSED_
3300 #define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0
3301 #define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
3302 name1) kind0 name0, kind1 name1
3303 #define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3304 kind2, name2) kind0 name0, kind1 name1, kind2 name2
3305 #define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3306 kind2, name2, kind3, name3) kind0 name0, kind1 name1, kind2 name2, \
3308 #define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3309 kind2, name2, kind3, name3, kind4, name4) kind0 name0, kind1 name1, \
3310 kind2 name2, kind3 name3, kind4 name4
3311 #define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3312 kind2, name2, kind3, name3, kind4, name4, kind5, name5) kind0 name0, \
3313 kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5
3314 #define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3315 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
3316 name6) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
3317 kind5 name5, kind6 name6
3318 #define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3319 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
3320 kind7, name7) kind0 name0, kind1 name1, kind2 name2, kind3 name3, \
3321 kind4 name4, kind5 name5, kind6 name6, kind7 name7
3322 #define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3323 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
3324 kind7, name7, kind8, name8) kind0 name0, kind1 name1, kind2 name2, \
3325 kind3 name3, kind4 name4, kind5 name5, kind6 name6, kind7 name7, \
3327 #define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
3328 name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
3329 name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \
3330 kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \
3331 kind6 name6, kind7 name7, kind8 name8, kind9 name9
3334 #define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0
3335 #define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
3337 #define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3338 kind2, name2) name0, name1, name2
3339 #define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3340 kind2, name2, kind3, name3) name0, name1, name2, name3
3341 #define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3342 kind2, name2, kind3, name3, kind4, name4) name0, name1, name2, name3, \
3344 #define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3345 kind2, name2, kind3, name3, kind4, name4, kind5, name5) name0, name1, \
3346 name2, name3, name4, name5
3347 #define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3348 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
3349 name6) name0, name1, name2, name3, name4, name5, name6
3350 #define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3351 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
3352 kind7, name7) name0, name1, name2, name3, name4, name5, name6, name7
3353 #define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
3354 kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
3355 kind7, name7, kind8, name8) name0, name1, name2, name3, name4, name5, \
3357 #define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
3358 name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
3359 name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \
3360 name3, name4, name5, name6, name7, name8, name9
3363 #define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
3364 #define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type
3365 #define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) , \
3366 typename p0##_type, typename p1##_type
3367 #define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , \
3368 typename p0##_type, typename p1##_type, typename p2##_type
3369 #define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
3370 typename p0##_type, typename p1##_type, typename p2##_type, \
3372 #define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
3373 typename p0##_type, typename p1##_type, typename p2##_type, \
3374 typename p3##_type, typename p4##_type
3375 #define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
3376 typename p0##_type, typename p1##_type, typename p2##_type, \
3377 typename p3##_type, typename p4##_type, typename p5##_type
3378 #define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
3379 p6) , typename p0##_type, typename p1##_type, typename p2##_type, \
3380 typename p3##_type, typename p4##_type, typename p5##_type, \
3382 #define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
3383 p6, p7) , typename p0##_type, typename p1##_type, typename p2##_type, \
3384 typename p3##_type, typename p4##_type, typename p5##_type, \
3385 typename p6##_type, typename p7##_type
3386 #define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
3387 p6, p7, p8) , typename p0##_type, typename p1##_type, typename p2##_type, \
3388 typename p3##_type, typename p4##_type, typename p5##_type, \
3389 typename p6##_type, typename p7##_type, typename p8##_type
3390 #define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
3391 p6, p7, p8, p9) , typename p0##_type, typename p1##_type, \
3392 typename p2##_type, typename p3##_type, typename p4##_type, \
3393 typename p5##_type, typename p6##_type, typename p7##_type, \
3394 typename p8##_type, typename p9##_type
3397 #define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\
3399 #define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\
3400 (p0##_type gmock_p0) : p0(gmock_p0)
3401 #define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\
3402 (p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), p1(gmock_p1)
3403 #define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\
3404 (p0##_type gmock_p0, p1##_type gmock_p1, \
3405 p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2)
3406 #define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\
3407 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
3408 p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
3410 #define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\
3411 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
3412 p3##_type gmock_p3, p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), \
3413 p2(gmock_p2), p3(gmock_p3), p4(gmock_p4)
3414 #define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\
3415 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
3416 p3##_type gmock_p3, p4##_type gmock_p4, \
3417 p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
3418 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5)
3419 #define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\
3420 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
3421 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
3422 p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
3423 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6)
3424 #define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\
3425 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
3426 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
3427 p6##_type gmock_p6, p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), \
3428 p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
3430 #define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3432 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
3433 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
3434 p6##_type gmock_p6, p7##_type gmock_p7, \
3435 p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
3436 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
3438 #define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3440 (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
3441 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
3442 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
3443 p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
3444 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
3445 p8(gmock_p8), p9(gmock_p9)
3448 #define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
3449 #define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0;
3450 #define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0; \
3452 #define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0; \
3453 p1##_type p1; p2##_type p2;
3454 #define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0; \
3455 p1##_type p1; p2##_type p2; p3##_type p3;
3456 #define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
3457 p4) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4;
3458 #define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
3459 p5) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
3461 #define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
3462 p6) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
3463 p5##_type p5; p6##_type p6;
3464 #define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3465 p7) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
3466 p5##_type p5; p6##_type p6; p7##_type p7;
3467 #define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3468 p7, p8) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
3469 p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8;
3470 #define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3471 p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
3472 p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \
3476 #define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
3477 #define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0
3478 #define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1
3479 #define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2
3480 #define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3
3481 #define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) p0, p1, \
3483 #define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) p0, \
3485 #define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
3486 p6) p0, p1, p2, p3, p4, p5, p6
3487 #define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3488 p7) p0, p1, p2, p3, p4, p5, p6, p7
3489 #define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3490 p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8
3491 #define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3492 p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9
3495 #define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
3496 #define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type
3497 #define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) , p0##_type, \
3499 #define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , p0##_type, \
3500 p1##_type, p2##_type
3501 #define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
3502 p0##_type, p1##_type, p2##_type, p3##_type
3503 #define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
3504 p0##_type, p1##_type, p2##_type, p3##_type, p4##_type
3505 #define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
3506 p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type
3507 #define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
3508 p6) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \
3510 #define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
3511 p6, p7) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
3512 p5##_type, p6##_type, p7##_type
3513 #define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
3514 p6, p7, p8) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
3515 p5##_type, p6##_type, p7##_type, p8##_type
3516 #define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
3517 p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
3518 p5##_type, p6##_type, p7##_type, p8##_type, p9##_type
3521 #define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
3522 #define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0
3523 #define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0, \
3525 #define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0, \
3526 p1##_type p1, p2##_type p2
3527 #define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0, \
3528 p1##_type p1, p2##_type p2, p3##_type p3
3529 #define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
3530 p4) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4
3531 #define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
3532 p5) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
3534 #define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
3535 p6) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
3536 p5##_type p5, p6##_type p6
3537 #define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3538 p7) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
3539 p5##_type p5, p6##_type p6, p7##_type p7
3540 #define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3541 p7, p8) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
3542 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8
3543 #define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3544 p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
3545 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
3549 #define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
3550 #define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P
3551 #define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2
3552 #define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3
3553 #define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4
3554 #define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5
3555 #define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6
3556 #define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7
3557 #define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3559 #define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3561 #define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
3565 #define GMOCK_ACTION_CLASS_(name, value_params)\
3566 GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
3568 #define ACTION_TEMPLATE(name, template_params, value_params)\
3569 template <GMOCK_INTERNAL_DECL_##template_params\
3570 GMOCK_INTERNAL_DECL_TYPE_##value_params>\
3571 class GMOCK_ACTION_CLASS_(name, value_params) {\
3573 explicit GMOCK_ACTION_CLASS_(name, value_params)\
3574 GMOCK_INTERNAL_INIT_##value_params {}\
3575 template <typename F>\
3576 class gmock_Impl : public ::testing::ActionInterface<F> {\
3578 typedef F function_type;\
3579 typedef typename ::testing::internal::Function<F>::Result return_type;\
3580 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3582 explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\
3583 virtual return_type Perform(const args_type& args) {\
3584 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
3585 Perform(this, args);\
3587 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3588 typename arg3_type, typename arg4_type, typename arg5_type, \
3589 typename arg6_type, typename arg7_type, typename arg8_type, \
3590 typename arg9_type>\
3591 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
3592 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
3593 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
3594 arg9_type arg9) const;\
3595 GMOCK_INTERNAL_DEFN_##value_params\
3597 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
3599 template <typename F> operator ::testing::Action<F>() const {\
3600 return ::testing::Action<F>(\
3601 new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
3603 GMOCK_INTERNAL_DEFN_##value_params\
3605 GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
3607 template <GMOCK_INTERNAL_DECL_##template_params\
3608 GMOCK_INTERNAL_DECL_TYPE_##value_params>\
3609 inline GMOCK_ACTION_CLASS_(name, value_params)<\
3610 GMOCK_INTERNAL_LIST_##template_params\
3611 GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\
3612 GMOCK_INTERNAL_DECL_##value_params) {\
3613 return GMOCK_ACTION_CLASS_(name, value_params)<\
3614 GMOCK_INTERNAL_LIST_##template_params\
3615 GMOCK_INTERNAL_LIST_TYPE_##value_params>(\
3616 GMOCK_INTERNAL_LIST_##value_params);\
3618 template <GMOCK_INTERNAL_DECL_##template_params\
3619 GMOCK_INTERNAL_DECL_TYPE_##value_params>\
3620 template <typename F>\
3621 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3622 typename arg3_type, typename arg4_type, typename arg5_type, \
3623 typename arg6_type, typename arg7_type, typename arg8_type, \
3624 typename arg9_type>\
3625 typename ::testing::internal::Function<F>::Result\
3626 GMOCK_ACTION_CLASS_(name, value_params)<\
3627 GMOCK_INTERNAL_LIST_##template_params\
3628 GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\
3630 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
3632 #define ACTION(name)\
3633 class name##Action {\
3636 template <typename F>\
3637 class gmock_Impl : public ::testing::ActionInterface<F> {\
3639 typedef F function_type;\
3640 typedef typename ::testing::internal::Function<F>::Result return_type;\
3641 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3644 virtual return_type Perform(const args_type& args) {\
3645 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
3646 Perform(this, args);\
3648 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3649 typename arg3_type, typename arg4_type, typename arg5_type, \
3650 typename arg6_type, typename arg7_type, typename arg8_type, \
3651 typename arg9_type>\
3652 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
3653 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
3654 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
3655 arg9_type arg9) const;\
3657 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
3659 template <typename F> operator ::testing::Action<F>() const {\
3660 return ::testing::Action<F>(new gmock_Impl<F>());\
3663 GTEST_DISALLOW_ASSIGN_(name##Action);\
3665 inline name##Action name() {\
3666 return name##Action();\
3668 template <typename F>\
3669 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3670 typename arg3_type, typename arg4_type, typename arg5_type, \
3671 typename arg6_type, typename arg7_type, typename arg8_type, \
3672 typename arg9_type>\
3673 typename ::testing::internal::Function<F>::Result\
3674 name##Action::gmock_Impl<F>::gmock_PerformImpl(\
3675 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
3677 #define ACTION_P(name, p0)\
3678 template <typename p0##_type>\
3679 class name##ActionP {\
3681 explicit name##ActionP(p0##_type gmock_p0) : p0(gmock_p0) {}\
3682 template <typename F>\
3683 class gmock_Impl : public ::testing::ActionInterface<F> {\
3685 typedef F function_type;\
3686 typedef typename ::testing::internal::Function<F>::Result return_type;\
3687 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3689 explicit gmock_Impl(p0##_type gmock_p0) : p0(gmock_p0) {}\
3690 virtual return_type Perform(const args_type& args) {\
3691 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
3692 Perform(this, args);\
3694 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3695 typename arg3_type, typename arg4_type, typename arg5_type, \
3696 typename arg6_type, typename arg7_type, typename arg8_type, \
3697 typename arg9_type>\
3698 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
3699 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
3700 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
3701 arg9_type arg9) const;\
3704 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
3706 template <typename F> operator ::testing::Action<F>() const {\
3707 return ::testing::Action<F>(new gmock_Impl<F>(p0));\
3711 GTEST_DISALLOW_ASSIGN_(name##ActionP);\
3713 template <typename p0##_type>\
3714 inline name##ActionP<p0##_type> name(p0##_type p0) {\
3715 return name##ActionP<p0##_type>(p0);\
3717 template <typename p0##_type>\
3718 template <typename F>\
3719 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3720 typename arg3_type, typename arg4_type, typename arg5_type, \
3721 typename arg6_type, typename arg7_type, typename arg8_type, \
3722 typename arg9_type>\
3723 typename ::testing::internal::Function<F>::Result\
3724 name##ActionP<p0##_type>::gmock_Impl<F>::gmock_PerformImpl(\
3725 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
3727 #define ACTION_P2(name, p0, p1)\
3728 template <typename p0##_type, typename p1##_type>\
3729 class name##ActionP2 {\
3731 name##ActionP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
3733 template <typename F>\
3734 class gmock_Impl : public ::testing::ActionInterface<F> {\
3736 typedef F function_type;\
3737 typedef typename ::testing::internal::Function<F>::Result return_type;\
3738 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3740 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
3742 virtual return_type Perform(const args_type& args) {\
3743 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
3744 Perform(this, args);\
3746 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3747 typename arg3_type, typename arg4_type, typename arg5_type, \
3748 typename arg6_type, typename arg7_type, typename arg8_type, \
3749 typename arg9_type>\
3750 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
3751 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
3752 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
3753 arg9_type arg9) const;\
3757 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
3759 template <typename F> operator ::testing::Action<F>() const {\
3760 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1));\
3765 GTEST_DISALLOW_ASSIGN_(name##ActionP2);\
3767 template <typename p0##_type, typename p1##_type>\
3768 inline name##ActionP2<p0##_type, p1##_type> name(p0##_type p0, \
3770 return name##ActionP2<p0##_type, p1##_type>(p0, p1);\
3772 template <typename p0##_type, typename p1##_type>\
3773 template <typename F>\
3774 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3775 typename arg3_type, typename arg4_type, typename arg5_type, \
3776 typename arg6_type, typename arg7_type, typename arg8_type, \
3777 typename arg9_type>\
3778 typename ::testing::internal::Function<F>::Result\
3779 name##ActionP2<p0##_type, p1##_type>::gmock_Impl<F>::gmock_PerformImpl(\
3780 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
3782 #define ACTION_P3(name, p0, p1, p2)\
3783 template <typename p0##_type, typename p1##_type, typename p2##_type>\
3784 class name##ActionP3 {\
3786 name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \
3787 p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
3788 template <typename F>\
3789 class gmock_Impl : public ::testing::ActionInterface<F> {\
3791 typedef F function_type;\
3792 typedef typename ::testing::internal::Function<F>::Result return_type;\
3793 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3795 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \
3796 p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
3797 virtual return_type Perform(const args_type& args) {\
3798 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
3799 Perform(this, args);\
3801 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3802 typename arg3_type, typename arg4_type, typename arg5_type, \
3803 typename arg6_type, typename arg7_type, typename arg8_type, \
3804 typename arg9_type>\
3805 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
3806 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
3807 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
3808 arg9_type arg9) const;\
3813 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
3815 template <typename F> operator ::testing::Action<F>() const {\
3816 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2));\
3822 GTEST_DISALLOW_ASSIGN_(name##ActionP3);\
3824 template <typename p0##_type, typename p1##_type, typename p2##_type>\
3825 inline name##ActionP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
3826 p1##_type p1, p2##_type p2) {\
3827 return name##ActionP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
3829 template <typename p0##_type, typename p1##_type, typename p2##_type>\
3830 template <typename F>\
3831 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3832 typename arg3_type, typename arg4_type, typename arg5_type, \
3833 typename arg6_type, typename arg7_type, typename arg8_type, \
3834 typename arg9_type>\
3835 typename ::testing::internal::Function<F>::Result\
3836 name##ActionP3<p0##_type, p1##_type, \
3837 p2##_type>::gmock_Impl<F>::gmock_PerformImpl(\
3838 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
3840 #define ACTION_P4(name, p0, p1, p2, p3)\
3841 template <typename p0##_type, typename p1##_type, typename p2##_type, \
3842 typename p3##_type>\
3843 class name##ActionP4 {\
3845 name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \
3846 p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \
3847 p2(gmock_p2), p3(gmock_p3) {}\
3848 template <typename F>\
3849 class gmock_Impl : public ::testing::ActionInterface<F> {\
3851 typedef F function_type;\
3852 typedef typename ::testing::internal::Function<F>::Result return_type;\
3853 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3855 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
3856 p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
3858 virtual return_type Perform(const args_type& args) {\
3859 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
3860 Perform(this, args);\
3862 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3863 typename arg3_type, typename arg4_type, typename arg5_type, \
3864 typename arg6_type, typename arg7_type, typename arg8_type, \
3865 typename arg9_type>\
3866 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
3867 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
3868 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
3869 arg9_type arg9) const;\
3875 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
3877 template <typename F> operator ::testing::Action<F>() const {\
3878 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3));\
3885 GTEST_DISALLOW_ASSIGN_(name##ActionP4);\
3887 template <typename p0##_type, typename p1##_type, typename p2##_type, \
3888 typename p3##_type>\
3889 inline name##ActionP4<p0##_type, p1##_type, p2##_type, \
3890 p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
3892 return name##ActionP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, p1, \
3895 template <typename p0##_type, typename p1##_type, typename p2##_type, \
3896 typename p3##_type>\
3897 template <typename F>\
3898 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3899 typename arg3_type, typename arg4_type, typename arg5_type, \
3900 typename arg6_type, typename arg7_type, typename arg8_type, \
3901 typename arg9_type>\
3902 typename ::testing::internal::Function<F>::Result\
3903 name##ActionP4<p0##_type, p1##_type, p2##_type, \
3904 p3##_type>::gmock_Impl<F>::gmock_PerformImpl(\
3905 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
3907 #define ACTION_P5(name, p0, p1, p2, p3, p4)\
3908 template <typename p0##_type, typename p1##_type, typename p2##_type, \
3909 typename p3##_type, typename p4##_type>\
3910 class name##ActionP5 {\
3912 name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \
3913 p2##_type gmock_p2, p3##_type gmock_p3, \
3914 p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
3915 p3(gmock_p3), p4(gmock_p4) {}\
3916 template <typename F>\
3917 class gmock_Impl : public ::testing::ActionInterface<F> {\
3919 typedef F function_type;\
3920 typedef typename ::testing::internal::Function<F>::Result return_type;\
3921 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3923 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
3924 p3##_type gmock_p3, p4##_type gmock_p4) : p0(gmock_p0), \
3925 p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4) {}\
3926 virtual return_type Perform(const args_type& args) {\
3927 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
3928 Perform(this, args);\
3930 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3931 typename arg3_type, typename arg4_type, typename arg5_type, \
3932 typename arg6_type, typename arg7_type, typename arg8_type, \
3933 typename arg9_type>\
3934 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
3935 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
3936 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
3937 arg9_type arg9) const;\
3944 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
3946 template <typename F> operator ::testing::Action<F>() const {\
3947 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4));\
3955 GTEST_DISALLOW_ASSIGN_(name##ActionP5);\
3957 template <typename p0##_type, typename p1##_type, typename p2##_type, \
3958 typename p3##_type, typename p4##_type>\
3959 inline name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
3960 p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
3962 return name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
3963 p4##_type>(p0, p1, p2, p3, p4);\
3965 template <typename p0##_type, typename p1##_type, typename p2##_type, \
3966 typename p3##_type, typename p4##_type>\
3967 template <typename F>\
3968 template <typename arg0_type, typename arg1_type, typename arg2_type, \
3969 typename arg3_type, typename arg4_type, typename arg5_type, \
3970 typename arg6_type, typename arg7_type, typename arg8_type, \
3971 typename arg9_type>\
3972 typename ::testing::internal::Function<F>::Result\
3973 name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
3974 p4##_type>::gmock_Impl<F>::gmock_PerformImpl(\
3975 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
3977 #define ACTION_P6(name, p0, p1, p2, p3, p4, p5)\
3978 template <typename p0##_type, typename p1##_type, typename p2##_type, \
3979 typename p3##_type, typename p4##_type, typename p5##_type>\
3980 class name##ActionP6 {\
3982 name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \
3983 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
3984 p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
3985 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {}\
3986 template <typename F>\
3987 class gmock_Impl : public ::testing::ActionInterface<F> {\
3989 typedef F function_type;\
3990 typedef typename ::testing::internal::Function<F>::Result return_type;\
3991 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
3993 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
3994 p3##_type gmock_p3, p4##_type gmock_p4, \
3995 p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
3996 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {}\
3997 virtual return_type Perform(const args_type& args) {\
3998 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
3999 Perform(this, args);\
4001 template <typename arg0_type, typename arg1_type, typename arg2_type, \
4002 typename arg3_type, typename arg4_type, typename arg5_type, \
4003 typename arg6_type, typename arg7_type, typename arg8_type, \
4004 typename arg9_type>\
4005 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
4006 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
4007 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
4008 arg9_type arg9) const;\
4016 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
4018 template <typename F> operator ::testing::Action<F>() const {\
4019 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5));\
4028 GTEST_DISALLOW_ASSIGN_(name##ActionP6);\
4030 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4031 typename p3##_type, typename p4##_type, typename p5##_type>\
4032 inline name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
4033 p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
4034 p3##_type p3, p4##_type p4, p5##_type p5) {\
4035 return name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
4036 p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
4038 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4039 typename p3##_type, typename p4##_type, typename p5##_type>\
4040 template <typename F>\
4041 template <typename arg0_type, typename arg1_type, typename arg2_type, \
4042 typename arg3_type, typename arg4_type, typename arg5_type, \
4043 typename arg6_type, typename arg7_type, typename arg8_type, \
4044 typename arg9_type>\
4045 typename ::testing::internal::Function<F>::Result\
4046 name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
4047 p5##_type>::gmock_Impl<F>::gmock_PerformImpl(\
4048 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
4050 #define ACTION_P7(name, p0, p1, p2, p3, p4, p5, p6)\
4051 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4052 typename p3##_type, typename p4##_type, typename p5##_type, \
4053 typename p6##_type>\
4054 class name##ActionP7 {\
4056 name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \
4057 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
4058 p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \
4059 p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
4061 template <typename F>\
4062 class gmock_Impl : public ::testing::ActionInterface<F> {\
4064 typedef F function_type;\
4065 typedef typename ::testing::internal::Function<F>::Result return_type;\
4066 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
4068 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
4069 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
4070 p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
4071 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\
4072 virtual return_type Perform(const args_type& args) {\
4073 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
4074 Perform(this, args);\
4076 template <typename arg0_type, typename arg1_type, typename arg2_type, \
4077 typename arg3_type, typename arg4_type, typename arg5_type, \
4078 typename arg6_type, typename arg7_type, typename arg8_type, \
4079 typename arg9_type>\
4080 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
4081 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
4082 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
4083 arg9_type arg9) const;\
4092 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
4094 template <typename F> operator ::testing::Action<F>() const {\
4095 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
4106 GTEST_DISALLOW_ASSIGN_(name##ActionP7);\
4108 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4109 typename p3##_type, typename p4##_type, typename p5##_type, \
4110 typename p6##_type>\
4111 inline name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
4112 p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
4113 p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
4115 return name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
4116 p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
4118 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4119 typename p3##_type, typename p4##_type, typename p5##_type, \
4120 typename p6##_type>\
4121 template <typename F>\
4122 template <typename arg0_type, typename arg1_type, typename arg2_type, \
4123 typename arg3_type, typename arg4_type, typename arg5_type, \
4124 typename arg6_type, typename arg7_type, typename arg8_type, \
4125 typename arg9_type>\
4126 typename ::testing::internal::Function<F>::Result\
4127 name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
4128 p5##_type, p6##_type>::gmock_Impl<F>::gmock_PerformImpl(\
4129 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
4131 #define ACTION_P8(name, p0, p1, p2, p3, p4, p5, p6, p7)\
4132 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4133 typename p3##_type, typename p4##_type, typename p5##_type, \
4134 typename p6##_type, typename p7##_type>\
4135 class name##ActionP8 {\
4137 name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \
4138 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
4139 p5##_type gmock_p5, p6##_type gmock_p6, \
4140 p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
4141 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
4143 template <typename F>\
4144 class gmock_Impl : public ::testing::ActionInterface<F> {\
4146 typedef F function_type;\
4147 typedef typename ::testing::internal::Function<F>::Result return_type;\
4148 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
4150 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
4151 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
4152 p6##_type gmock_p6, p7##_type gmock_p7) : p0(gmock_p0), \
4153 p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), \
4154 p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\
4155 virtual return_type Perform(const args_type& args) {\
4156 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
4157 Perform(this, args);\
4159 template <typename arg0_type, typename arg1_type, typename arg2_type, \
4160 typename arg3_type, typename arg4_type, typename arg5_type, \
4161 typename arg6_type, typename arg7_type, typename arg8_type, \
4162 typename arg9_type>\
4163 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
4164 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
4165 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
4166 arg9_type arg9) const;\
4176 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
4178 template <typename F> operator ::testing::Action<F>() const {\
4179 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
4191 GTEST_DISALLOW_ASSIGN_(name##ActionP8);\
4193 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4194 typename p3##_type, typename p4##_type, typename p5##_type, \
4195 typename p6##_type, typename p7##_type>\
4196 inline name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
4197 p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
4198 p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
4199 p6##_type p6, p7##_type p7) {\
4200 return name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
4201 p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
4204 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4205 typename p3##_type, typename p4##_type, typename p5##_type, \
4206 typename p6##_type, typename p7##_type>\
4207 template <typename F>\
4208 template <typename arg0_type, typename arg1_type, typename arg2_type, \
4209 typename arg3_type, typename arg4_type, typename arg5_type, \
4210 typename arg6_type, typename arg7_type, typename arg8_type, \
4211 typename arg9_type>\
4212 typename ::testing::internal::Function<F>::Result\
4213 name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
4214 p5##_type, p6##_type, \
4215 p7##_type>::gmock_Impl<F>::gmock_PerformImpl(\
4216 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
4218 #define ACTION_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8)\
4219 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4220 typename p3##_type, typename p4##_type, typename p5##_type, \
4221 typename p6##_type, typename p7##_type, typename p8##_type>\
4222 class name##ActionP9 {\
4224 name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \
4225 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
4226 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
4227 p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
4228 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
4230 template <typename F>\
4231 class gmock_Impl : public ::testing::ActionInterface<F> {\
4233 typedef F function_type;\
4234 typedef typename ::testing::internal::Function<F>::Result return_type;\
4235 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
4237 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
4238 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
4239 p6##_type gmock_p6, p7##_type gmock_p7, \
4240 p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
4241 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
4242 p7(gmock_p7), p8(gmock_p8) {}\
4243 virtual return_type Perform(const args_type& args) {\
4244 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
4245 Perform(this, args);\
4247 template <typename arg0_type, typename arg1_type, typename arg2_type, \
4248 typename arg3_type, typename arg4_type, typename arg5_type, \
4249 typename arg6_type, typename arg7_type, typename arg8_type, \
4250 typename arg9_type>\
4251 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
4252 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
4253 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
4254 arg9_type arg9) const;\
4265 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
4267 template <typename F> operator ::testing::Action<F>() const {\
4268 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
4281 GTEST_DISALLOW_ASSIGN_(name##ActionP9);\
4283 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4284 typename p3##_type, typename p4##_type, typename p5##_type, \
4285 typename p6##_type, typename p7##_type, typename p8##_type>\
4286 inline name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
4287 p4##_type, p5##_type, p6##_type, p7##_type, \
4288 p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
4289 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
4291 return name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
4292 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
4293 p3, p4, p5, p6, p7, p8);\
4295 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4296 typename p3##_type, typename p4##_type, typename p5##_type, \
4297 typename p6##_type, typename p7##_type, typename p8##_type>\
4298 template <typename F>\
4299 template <typename arg0_type, typename arg1_type, typename arg2_type, \
4300 typename arg3_type, typename arg4_type, typename arg5_type, \
4301 typename arg6_type, typename arg7_type, typename arg8_type, \
4302 typename arg9_type>\
4303 typename ::testing::internal::Function<F>::Result\
4304 name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
4305 p5##_type, p6##_type, p7##_type, \
4306 p8##_type>::gmock_Impl<F>::gmock_PerformImpl(\
4307 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
4309 #define ACTION_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)\
4310 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4311 typename p3##_type, typename p4##_type, typename p5##_type, \
4312 typename p6##_type, typename p7##_type, typename p8##_type, \
4313 typename p9##_type>\
4314 class name##ActionP10 {\
4316 name##ActionP10(p0##_type gmock_p0, p1##_type gmock_p1, \
4317 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
4318 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
4319 p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \
4320 p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
4321 p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {}\
4322 template <typename F>\
4323 class gmock_Impl : public ::testing::ActionInterface<F> {\
4325 typedef F function_type;\
4326 typedef typename ::testing::internal::Function<F>::Result return_type;\
4327 typedef typename ::testing::internal::Function<F>::ArgumentTuple\
4329 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
4330 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
4331 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
4332 p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
4333 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
4334 p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {}\
4335 virtual return_type Perform(const args_type& args) {\
4336 return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
4337 Perform(this, args);\
4339 template <typename arg0_type, typename arg1_type, typename arg2_type, \
4340 typename arg3_type, typename arg4_type, typename arg5_type, \
4341 typename arg6_type, typename arg7_type, typename arg8_type, \
4342 typename arg9_type>\
4343 return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
4344 arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
4345 arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
4346 arg9_type arg9) const;\
4358 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
4360 template <typename F> operator ::testing::Action<F>() const {\
4361 return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
4375 GTEST_DISALLOW_ASSIGN_(name##ActionP10);\
4377 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4378 typename p3##_type, typename p4##_type, typename p5##_type, \
4379 typename p6##_type, typename p7##_type, typename p8##_type, \
4380 typename p9##_type>\
4381 inline name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
4382 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
4383 p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
4384 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
4386 return name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
4387 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
4388 p1, p2, p3, p4, p5, p6, p7, p8, p9);\
4390 template <typename p0##_type, typename p1##_type, typename p2##_type, \
4391 typename p3##_type, typename p4##_type, typename p5##_type, \
4392 typename p6##_type, typename p7##_type, typename p8##_type, \
4393 typename p9##_type>\
4394 template <typename F>\
4395 template <typename arg0_type, typename arg1_type, typename arg2_type, \
4396 typename arg3_type, typename arg4_type, typename arg5_type, \
4397 typename arg6_type, typename arg7_type, typename arg8_type, \
4398 typename arg9_type>\
4399 typename ::testing::internal::Function<F>::Result\
4400 name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
4401 p5##_type, p6##_type, p7##_type, p8##_type, \
4402 p9##_type>::gmock_Impl<F>::gmock_PerformImpl(\
4403 GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
4414 # pragma warning(push)
4415 # pragma warning(disable:4100)
4449 namespace invoke_argument {
4460 template <
typename R,
typename F>
4464 template <
typename R,
typename F,
typename A1>
4468 template <
typename R,
typename F,
typename A1,
typename A2>
4472 template <
typename R,
typename F,
typename A1,
typename A2,
typename A3>
4474 return f(
a1,
a2, a3);
4476 template <
typename R,
typename F,
typename A1,
typename A2,
typename A3,
4479 return f(
a1,
a2, a3, a4);
4481 template <
typename R,
typename F,
typename A1,
typename A2,
typename A3,
4482 typename A4,
typename A5>
4484 return f(
a1,
a2, a3, a4, a5);
4486 template <
typename R,
typename F,
typename A1,
typename A2,
typename A3,
4487 typename A4,
typename A5,
typename A6>
4489 return f(
a1,
a2, a3, a4, a5, a6);
4491 template <
typename R,
typename F,
typename A1,
typename A2,
typename A3,
4492 typename A4,
typename A5,
typename A6,
typename A7>
4495 return f(
a1,
a2, a3, a4, a5, a6, a7);
4497 template <
typename R,
typename F,
typename A1,
typename A2,
typename A3,
4498 typename A4,
typename A5,
typename A6,
typename A7,
typename A8>
4501 return f(
a1,
a2, a3, a4, a5, a6, a7, a8);
4503 template <
typename R,
typename F,
typename A1,
typename A2,
typename A3,
4504 typename A4,
typename A5,
typename A6,
typename A7,
typename A8,
4507 A7 a7, A8 a8, A9 a9) {
4508 return f(
a1,
a2, a3, a4, a5, a6, a7, a8, a9);
4510 template <
typename R,
typename F,
typename A1,
typename A2,
typename A3,
4511 typename A4,
typename A5,
typename A6,
typename A7,
typename A8,
4512 typename A9,
typename A10>
4514 A7 a7, A8 a8, A9 a9, A10 a10) {
4515 return f(
a1,
a2, a3, a4, a5, a6, a7, a8, a9, a10);
4521 HAS_1_TEMPLATE_PARAMS(
int,
k),
4522 AND_0_VALUE_PARAMS()) {
4524 return InvokeArgumentAdl<return_type>(
4525 internal::invoke_argument::AdlTag(),
4526 ::testing::get<k>(
args));
4530 HAS_1_TEMPLATE_PARAMS(
int,
k),
4531 AND_1_VALUE_PARAMS(p0)) {
4533 return InvokeArgumentAdl<return_type>(
4534 internal::invoke_argument::AdlTag(),
4535 ::testing::get<k>(
args), p0);
4539 HAS_1_TEMPLATE_PARAMS(
int,
k),
4540 AND_2_VALUE_PARAMS(p0, p1)) {
4542 return InvokeArgumentAdl<return_type>(
4543 internal::invoke_argument::AdlTag(),
4544 ::testing::get<k>(
args), p0, p1);
4548 HAS_1_TEMPLATE_PARAMS(
int,
k),
4549 AND_3_VALUE_PARAMS(p0, p1, p2)) {
4551 return InvokeArgumentAdl<return_type>(
4552 internal::invoke_argument::AdlTag(),
4553 ::testing::get<k>(
args), p0, p1, p2);
4557 HAS_1_TEMPLATE_PARAMS(
int,
k),
4558 AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
4560 return InvokeArgumentAdl<return_type>(
4561 internal::invoke_argument::AdlTag(),
4562 ::testing::get<k>(
args), p0, p1, p2, p3);
4566 HAS_1_TEMPLATE_PARAMS(
int,
k),
4567 AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
4569 return InvokeArgumentAdl<return_type>(
4570 internal::invoke_argument::AdlTag(),
4571 ::testing::get<k>(
args), p0, p1, p2, p3, p4);
4575 HAS_1_TEMPLATE_PARAMS(
int,
k),
4576 AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
4578 return InvokeArgumentAdl<return_type>(
4579 internal::invoke_argument::AdlTag(),
4580 ::testing::get<k>(
args), p0, p1, p2, p3, p4, p5);
4584 HAS_1_TEMPLATE_PARAMS(
int,
k),
4585 AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
4587 return InvokeArgumentAdl<return_type>(
4588 internal::invoke_argument::AdlTag(),
4589 ::testing::get<k>(
args), p0, p1, p2, p3, p4, p5, p6);
4593 HAS_1_TEMPLATE_PARAMS(
int,
k),
4594 AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
4596 return InvokeArgumentAdl<return_type>(
4597 internal::invoke_argument::AdlTag(),
4598 ::testing::get<k>(
args), p0, p1, p2, p3, p4, p5, p6, p7);
4602 HAS_1_TEMPLATE_PARAMS(
int,
k),
4603 AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
4605 return InvokeArgumentAdl<return_type>(
4606 internal::invoke_argument::AdlTag(),
4607 ::testing::get<k>(
args), p0, p1, p2, p3, p4, p5, p6, p7, p8);
4611 HAS_1_TEMPLATE_PARAMS(
int,
k),
4612 AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
4614 return InvokeArgumentAdl<return_type>(
4615 internal::invoke_argument::AdlTag(),
4616 ::testing::get<k>(
args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
4625 HAS_1_TEMPLATE_PARAMS(
typename,
T),
4626 AND_0_VALUE_PARAMS()) {
4631 HAS_1_TEMPLATE_PARAMS(
typename,
T),
4632 AND_1_VALUE_PARAMS(p0)) {
4637 HAS_1_TEMPLATE_PARAMS(
typename,
T),
4638 AND_2_VALUE_PARAMS(p0, p1)) {
4639 return new T(p0, p1);
4643 HAS_1_TEMPLATE_PARAMS(
typename,
T),
4644 AND_3_VALUE_PARAMS(p0, p1, p2)) {
4645 return new T(p0, p1, p2);
4649 HAS_1_TEMPLATE_PARAMS(
typename,
T),
4650 AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
4651 return new T(p0, p1, p2, p3);
4655 HAS_1_TEMPLATE_PARAMS(
typename,
T),
4656 AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
4657 return new T(p0, p1, p2, p3, p4);
4661 HAS_1_TEMPLATE_PARAMS(
typename,
T),
4662 AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
4663 return new T(p0, p1, p2, p3, p4, p5);
4667 HAS_1_TEMPLATE_PARAMS(
typename,
T),
4668 AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
4669 return new T(p0, p1, p2, p3, p4, p5, p6);
4673 HAS_1_TEMPLATE_PARAMS(
typename,
T),
4674 AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
4675 return new T(p0, p1, p2, p3, p4, p5, p6, p7);
4679 HAS_1_TEMPLATE_PARAMS(
typename,
T),
4680 AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
4681 return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8);
4685 HAS_1_TEMPLATE_PARAMS(
typename,
T),
4686 AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
4687 return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
4691 # pragma warning(pop)
4703 #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
4704 #define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
4706 #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
4708 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
4748 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
4749 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
4810 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
4811 #define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
4819 #if GTEST_HAS_EXCEPTIONS
4820 # include <stdexcept>
4860 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
4861 #define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
4864 #include <algorithm>
4874 #if GTEST_HAS_STD_INITIALIZER_LIST_
4875 # include <initializer_list>
4909 template <
typename T>
4945 virtual void DescribeTo(::std::ostream* os)
const = 0;
4961 template <
typename T>
5022 template <
typename A,
typename B>
5026 template <
typename A,
typename B>
5030 template <
typename A,
typename B>
5034 template <
typename A,
typename B>
5038 template <
typename A,
typename B>
5042 template <
typename A,
typename B>
5070 template <
typename T>
5076 return impl_->MatchAndExplain(
x, listener);
5090 impl_->DescribeNegationTo(os);
5137 template <
typename T>
5191 #if GTEST_HAS_STRING_PIECE_
5197 :
public internal::MatcherBase<const StringPiece&> {
5201 explicit Matcher(
const MatcherInterface<const StringPiece&>* impl)
5209 Matcher(
const char* s);
5212 Matcher(StringPiece s);
5217 :
public internal::MatcherBase<StringPiece> {
5221 explicit Matcher(
const MatcherInterface<StringPiece>* impl)
5222 :
internal::MatcherBase<StringPiece>(impl) {}
5229 Matcher(
const char* s);
5232 Matcher(StringPiece s);
5234 #endif // GTEST_HAS_STRING_PIECE_
5248 template <
class Impl>
5261 template <
typename T>
5267 template <
typename T>
5273 impl_.DescribeTo(os);
5277 impl_.DescribeNegationTo(os);
5281 return impl_.MatchAndExplain(
x, listener);
5302 template <
typename T>
5314 template <
class Impl>
5333 template <
typename T,
typename M>
5351 polymorphic_matcher_or_value,
5374 return polymorphic_matcher_or_value;
5381 template <
typename T,
typename U>
5392 : source_matcher_(source_matcher) {}
5396 return source_matcher_.MatchAndExplain(
static_cast<U
>(
x), listener);
5400 source_matcher_.DescribeTo(os);
5404 source_matcher_.DescribeNegationTo(os);
5416 template <
typename T>
5428 template <
typename T,
typename M>
5440 template <
typename T>
5445 template <
typename M>
5459 template <
typename U>
5463 T_must_be_implicitly_convertible_to_U);
5468 cannot_convert_non_referentce_arg_to_reference);
5476 kTIsOther || kUIsOther ||
5478 conversion_of_arithmetic_types_must_be_lossless);
5479 return MatcherCast<T>(matcher);
5483 template <
typename T,
typename M>
5489 template <
typename T>
5498 ::std::ostream* os) {
5499 if (explanation !=
"" && os != NULL) {
5500 *os <<
", " << explanation;
5511 type_name.find_first_of(
"<(") == string::npos);
5519 template <
typename Value,
typename T>
5525 return matcher.Matches(
value);
5529 const bool match = matcher.MatchAndExplain(
value, &inner_listener);
5533 const string&
type_name = GetTypeName<Value>();
5550 template <
typename MatcherTuple,
typename ValueTuple>
5552 const ValueTuple& value_tuple) {
5554 &&
get<
N - 1>(matcher_tuple).
Matches(get<N - 1>(value_tuple));
5561 template <
typename MatcherTuple,
typename ValueTuple>
5563 const ValueTuple&
values,
5564 ::std::ostream* os) {
5572 typedef typename tuple_element<
N - 1, ValueTuple>
::type Value;
5575 if (!matcher.MatchAndExplain(
value, &listener)) {
5578 *os <<
" Expected arg #" <<
N - 1 <<
": ";
5580 *os <<
"\n Actual: ";
5597 template <
typename MatcherTuple,
typename ValueTuple>
5599 const ValueTuple& ) {
5603 template <
typename MatcherTuple,
typename ValueTuple>
5606 ::std::ostream* ) {}
5614 template <
typename MatcherTuple,
typename ValueTuple>
5616 const ValueTuple& value_tuple) {
5621 matcher_and_value_have_different_numbers_of_fields);
5623 Matches(matcher_tuple, value_tuple);
5628 template <
typename MatcherTuple,
typename ValueTuple>
5630 const ValueTuple&
values,
5631 ::std::ostream* os) {
5640 template <
typename Tuple,
typename Func,
typename OutIter>
5653 template <
typename Tup,
size_t kRemainingSize>
5656 *
out++ = f(::testing::get<TupleSize::value - kRemainingSize>(t));
5660 template <
typename Tup>
5671 template <
typename Tuple,
typename Func,
typename OutIter>
5677 template <
typename T>
5682 virtual void DescribeTo(::std::ostream* os)
const { *os <<
"is anything"; }
5687 *os <<
"never matches";
5697 template <
typename T>
5711 template <
typename D,
typename Rhs,
typename Op>
5715 template <
typename Lhs>
5721 template <
typename Lhs>
5727 return Op()(lhs,
rhs_);
5730 *os << D::Desc() <<
" ";
5734 *os << D::NegatedDesc() <<
" ";
5745 template <
typename Rhs>
5750 static const char*
Desc() {
return "is equal to"; }
5753 template <
typename Rhs>
5758 static const char*
Desc() {
return "isn't equal to"; }
5761 template <
typename Rhs>
5766 static const char*
Desc() {
return "is <"; }
5769 template <
typename Rhs>
5774 static const char*
Desc() {
return "is >"; }
5777 template <
typename Rhs>
5782 static const char*
Desc() {
return "is <="; }
5785 template <
typename Rhs>
5790 static const char*
Desc() {
return "is >="; }
5798 template <
typename Po
inter>
5801 #if GTEST_LANG_CXX11
5802 return p ==
nullptr;
5803 #else // GTEST_LANG_CXX11
5805 #endif // GTEST_LANG_CXX11
5810 *os <<
"isn't NULL";
5818 template <
typename Po
inter>
5821 #if GTEST_LANG_CXX11
5822 return p !=
nullptr;
5823 #else // GTEST_LANG_CXX11
5825 #endif // GTEST_LANG_CXX11
5828 void DescribeTo(::std::ostream* os)
const { *os <<
"isn't NULL"; }
5847 template <
typename T>
5850 template <
typename T>
5863 template <
typename Super>
5874 template <
typename Super>
5883 *listener <<
"which is located @" <<
static_cast<const void*
>(&
x);
5884 return &
x == &object_;
5888 *os <<
"references the variable ";
5893 *os <<
"does not reference the variable ";
5914 const wchar_t* rhs) {
5920 template <
typename StringType>
5930 const size_t i1 = s1.find(nul),
i2 = s2.find(nul);
5933 if (
i1 == StringType::npos ||
i2 == StringType::npos) {
5944 template <
typename StringType>
5948 bool case_sensitive)
5956 template <
typename CharType>
5968 template <
typename MatcheeStringType>
5987 *os << (expect_eq ?
"is " :
"isn't ");
5990 *os <<
"(ignoring case) ";
6005 template <
typename StringType>
6016 template <
typename CharType>
6025 template <
typename MatcheeStringType>
6029 return s2.find(
substring_) != StringType::npos;
6034 *os <<
"has substring ";
6039 *os <<
"has no substring ";
6052 template <
typename StringType>
6063 template <
typename CharType>
6072 template <
typename MatcheeStringType>
6076 return s2.length() >=
prefix_.length() &&
6081 *os <<
"starts with ";
6086 *os <<
"doesn't start with ";
6099 template <
typename StringType>
6109 template <
typename CharType>
6118 template <
typename MatcheeStringType>
6122 return s2.length() >=
suffix_.length() &&
6127 *os <<
"ends with ";
6132 *os <<
"doesn't end with ";
6155 template <
typename CharType>
6164 template <
class MatcheeStringType>
6174 <<
" regular expression ";
6179 *os <<
"doesn't " << (
full_match_ ?
"match" :
"contain")
6180 <<
" regular expression ";
6199 template <
typename D,
typename Op>
6202 template <
typename T1,
typename T2>
6204 return MakeMatcher(
new Impl< ::testing::tuple<T1, T2> >);
6206 template <
typename T1,
typename T2>
6208 return MakeMatcher(
new Impl<const ::testing::tuple<T1, T2>&>);
6212 static ::std::ostream&
GetDesc(::std::ostream& os) {
6213 return os << D::Desc();
6216 template <
typename Tuple>
6222 return Op()(::testing::get<0>(
args), ::testing::get<1>(
args));
6235 static const char*
Desc() {
return "an equal pair"; }
6239 static const char*
Desc() {
return "an unequal pair"; }
6243 static const char*
Desc() {
return "a pair where the first < the second"; }
6247 static const char*
Desc() {
return "a pair where the first > the second"; }
6251 static const char*
Desc() {
return "a pair where the first <= the second"; }
6255 static const char*
Desc() {
return "a pair where the first >= the second"; }
6262 template <
typename T>
6269 return !
matcher_.MatchAndExplain(
x, listener);
6288 template <
typename InnerMatcher>
6295 template <
typename T>
6310 template <
typename T>
6336 if (!
matcher1_.MatchAndExplain(
x, &listener1)) {
6337 *listener << listener1.
str();
6342 if (!
matcher2_.MatchAndExplain(
x, &listener2)) {
6343 *listener << listener2.
str();
6356 *listener <<
", and " << s2;
6369 #if GTEST_LANG_CXX11
6377 template <
int kSize,
typename Head,
typename... Tail>
6378 struct MatcherList {
6379 typedef MatcherList<kSize - 1, Tail...> MatcherListTail;
6380 typedef ::std::pair<Head, typename MatcherListTail::ListType> ListType;
6386 static ListType BuildList(
const Head& matcher,
const Tail&... tail) {
6387 return ListType(matcher, MatcherListTail::BuildList(tail...));
6394 template <
typename T,
template <
typename >
class CombiningMatcher>
6397 SafeMatcherCast<T>(
matchers.first),
6405 template <
typename Matcher1,
typename Matcher2>
6406 struct MatcherList<2, Matcher1, Matcher2> {
6407 typedef ::std::pair<Matcher1, Matcher2> ListType;
6409 static ListType BuildList(
const Matcher1& matcher1,
6410 const Matcher2& matcher2) {
6411 return ::std::pair<Matcher1, Matcher2>(matcher1, matcher2);
6414 template <
typename T,
template <
typename >
class CombiningMatcher>
6416 return Matcher<T>(
new CombiningMatcher<T>(
6417 SafeMatcherCast<T>(
matchers.first),
6418 SafeMatcherCast<T>(
matchers.second)));
6426 template <
template <
typename T>
class CombiningMatcher,
typename...
Args>
6427 class VariadicMatcher {
6435 template <
typename T>
6436 operator Matcher<T>()
const {
6442 typedef MatcherList<
sizeof...(Args),
Args...> MatcherListType;
6444 const typename MatcherListType::ListType
matchers_;
6449 template <
typename...
Args>
6450 using AllOfMatcher = VariadicMatcher<BothOfMatcherImpl,
Args...>;
6452 #endif // GTEST_LANG_CXX11
6456 template <
typename Matcher1,
typename Matcher2>
6465 template <
typename T>
6482 template <
typename T>
6508 if (
matcher1_.MatchAndExplain(
x, &listener1)) {
6509 *listener << listener1.
str();
6514 if (
matcher2_.MatchAndExplain(
x, &listener2)) {
6515 *listener << listener2.
str();
6528 *listener <<
", and " << s2;
6541 #if GTEST_LANG_CXX11
6543 template <
typename...
Args>
6546 #endif // GTEST_LANG_CXX11
6551 template <
typename Matcher1,
typename Matcher2>
6560 template <
typename T>
6575 template <
typename Predicate>
6584 template <
typename T>
6599 *os <<
"satisfies the given predicate";
6603 *os <<
"doesn't satisfy the given predicate";
6614 template <
typename M>
6625 template <
typename T>
6641 return MatcherCast<const T&>(
matcher_).Matches(
x);
6652 template <
typename M>
6660 template <
typename T>
6678 ::std::stringstream ss;
6679 ss <<
"Value of: " << value_text <<
"\n"
6681 matcher.DescribeTo(&ss);
6682 ss <<
"\n Actual: " << listener.
str();
6696 template <
typename M>
6706 template <
typename FloatType>
6728 <<
", where max_abs_error is" << max_abs_error;
6732 template <
typename T>
6745 if (actual.is_nan() || expected.
is_nan()) {
6746 if (actual.is_nan() && expected.
is_nan()) {
6771 return actual.AlmostEquals(expected);
6779 const ::std::streamsize old_precision = os->precision(
6780 ::std::numeric_limits<FloatType>::digits10 + 2);
6785 *os <<
"never matches";
6788 *os <<
"is approximately " <<
expected_;
6793 os->precision(old_precision);
6798 const ::std::streamsize old_precision = os->precision(
6799 ::std::numeric_limits<FloatType>::digits10 + 2);
6804 *os <<
"is anything";
6807 *os <<
"isn't approximately " <<
expected_;
6813 os->precision(old_precision);
6861 template <
typename InnerMatcher>
6874 template <
typename Po
inter>
6881 template <
typename Po
inter>
6887 explicit Impl(
const InnerMatcher& matcher)
6891 *os <<
"points to a value that ";
6896 *os <<
"does not point to a value that ";
6905 *listener <<
"which points to ";
6926 template <
typename To>
6947 return GetTypeName<To>();
6948 #else // GTEST_HAS_RTTI
6949 return "the target type";
6950 #endif // GTEST_HAS_RTTI
6955 *os <<
"when dynamic_cast to " <<
GetToName() <<
", ";
6963 template <
typename To>
6969 template <
typename From>
6979 template <
typename To>
6985 template <
typename From>
6990 *listener <<
"which cannot be dynamic_cast to " << this->GetToName();
6999 template <
typename Class,
typename FieldType>
7007 *os <<
"is an object whose given field ";
7012 *os <<
"is an object whose given field ";
7016 template <
typename T>
7019 typename ::testing::internal::
7030 *listener <<
"whose given field is ";
7039 *listener <<
"which points to an object ";
7054 template <
typename Class,
typename PropertyType>
7068 *os <<
"is an object whose given property ";
7073 *os <<
"is an object whose given property ";
7077 template <
typename T>
7080 typename ::testing::internal::
7091 *listener <<
"whose given property is ";
7094 #if defined(_PREFAST_ ) && _MSC_VER == 1800
7110 *listener <<
"which points to an object ";
7127 template <
typename Functor>
7133 template <
typename T>
7138 template <
typename ArgType,
typename ResType>
7141 typedef ResType(*StorageType)(ArgType);
7145 <<
"NULL function pointer is passed into ResultOf().";
7147 template <
typename T>
7155 template <
typename Callable>
7165 template <
typename T>
7173 template <
typename T>
7180 *os <<
"is mapped by the given callable to a value that ";
7185 *os <<
"is mapped by the given callable to a value that ";
7190 *listener <<
"which is mapped by the given callable to ";
7217 template <
typename SizeMatcher>
7224 template <
typename Container>
7229 template <
typename Container>
7234 typedef typename ContainerView::type::size_type
SizeType;
7235 explicit Impl(
const SizeMatcher& size_matcher)
7253 <<
"whose size " <<
size << (
result ?
" matches" :
" doesn't match");
7270 template <
typename DistanceMatcher>
7276 template <
typename Container>
7281 template <
typename Container>
7286 typedef typename std::iterator_traits<
7287 typename ContainerView::type::const_iterator>::difference_type
7289 explicit Impl(
const DistanceMatcher& distance_matcher)
7293 *os <<
"distance between begin() and end() ";
7297 *os <<
"distance between begin() and end() ";
7303 #if GTEST_HAS_STD_BEGIN_AND_END_
7313 *listener <<
"whose distance between begin() and end() " << distance
7314 << (
result ?
" matches" :
" doesn't match");
7339 template <
typename Container>
7361 *os <<
"does not equal ";
7365 template <
typename LhsContainer>
7377 ::std::ostream*
const os = listener->
stream();
7380 bool printed_header =
false;
7381 for (
typename LhsStlContainer::const_iterator
it =
7382 lhs_stl_container.begin();
7383 it != lhs_stl_container.end(); ++
it) {
7386 if (printed_header) {
7389 *os <<
"which has these unexpected elements: ";
7390 printed_header =
true;
7397 bool printed_header2 =
false;
7398 for (
typename StlContainer::const_iterator
it =
expected_.begin();
7401 lhs_stl_container.begin(), lhs_stl_container.end(), *
it) ==
7402 lhs_stl_container.end()) {
7403 if (printed_header2) {
7406 *os << (printed_header ?
",\nand" :
"which")
7407 <<
" doesn't have these expected elements: ";
7408 printed_header2 =
true;
7426 template <
typename T,
typename U>
7427 bool operator()(
const T& lhs,
const U& rhs)
const {
return lhs < rhs; }
7431 template <
typename Comparator,
typename ContainerMatcher>
7435 const ContainerMatcher& matcher)
7438 template <
typename LhsContainer>
7443 template <
typename LhsContainer>
7455 Impl(
const Comparator& comparator,
const ContainerMatcher& matcher)
7459 *os <<
"(when sorted) ";
7464 *os <<
"(when sorted) ";
7471 ::std::vector<LhsValue> sorted_container(lhs_stl_container.begin(),
7472 lhs_stl_container.end());
7474 sorted_container.begin(), sorted_container.end(),
comparator_);
7479 return matcher_.Matches(sorted_container);
7482 *listener <<
"which is ";
7484 *listener <<
" when sorted";
7487 const bool match =
matcher_.MatchAndExplain(sorted_container,
7511 template <
typename TupleMatcher,
typename RhsContainer>
7528 template <
typename LhsContainer>
7533 template <
typename LhsContainer>
7553 *os <<
"contains " <<
rhs_.size()
7554 <<
" values, where each value and its corresponding value in ";
7560 *os <<
"doesn't contain exactly " <<
rhs_.size()
7561 <<
" values, or contains a value x at some index i"
7562 <<
" where x and the i-th value of ";
7571 const size_t actual_size = lhs_stl_container.size();
7572 if (actual_size !=
rhs_.size()) {
7573 *listener <<
"which contains " << actual_size <<
" values";
7577 typename LhsStlContainer::const_iterator left = lhs_stl_container.begin();
7578 typename RhsStlContainer::const_iterator right =
rhs_.begin();
7579 for (
size_t i = 0;
i != actual_size; ++
i, ++left, ++right) {
7585 value_pair, &inner_listener)) {
7586 *listener <<
"where the value pair (";
7590 *listener <<
") at index #" <<
i <<
" don't match";
7618 template <
typename Container>
7627 template <
typename InnerMatcher>
7640 for (
typename StlContainer::const_iterator
it = stl_container.begin();
7641 it != stl_container.end(); ++
it, ++
i) {
7645 if (matches != all_elements_should_match) {
7646 *listener <<
"whose element #" <<
i
7647 << (matches ?
" matches" :
" doesn't match");
7649 return !all_elements_should_match;
7652 return all_elements_should_match;
7663 template <
typename Container>
7666 template <
typename InnerMatcher>
7672 *os <<
"contains at least one element that ";
7677 *os <<
"doesn't contain any element that ";
7692 template <
typename Container>
7695 template <
typename InnerMatcher>
7701 *os <<
"only contains elements that ";
7706 *os <<
"contains some element that ";
7720 template <
typename M>
7725 template <
typename Container>
7737 template <
typename M>
7742 template <
typename Container>
7757 template <
typename PairType>
7763 template <
typename InnerMatcher>
7776 if (explanation !=
"") {
7777 *listener <<
"whose first field is a value " << explanation;
7784 *os <<
"has a key that ";
7790 *os <<
"doesn't have a key that ";
7801 template <
typename M>
7806 template <
typename PairType>
7819 template <
typename PairType>
7826 template <
typename FirstMatcher,
typename SecondMatcher>
7836 *os <<
"has a first field that ";
7838 *os <<
", and has a second field that ";
7844 *os <<
"has a first field that ";
7846 *os <<
", or has a second field that ";
7862 &first_inner_listener)) {
7863 *listener <<
"whose first field does not match";
7869 &second_inner_listener)) {
7870 *listener <<
"whose second field does not match";
7883 *listener <<
"whose both fields match";
7884 if (first_explanation !=
"") {
7885 *listener <<
", where the first field is a value " << first_explanation;
7887 if (second_explanation !=
"") {
7889 if (first_explanation !=
"") {
7890 *listener <<
"and ";
7892 *listener <<
"where ";
7894 *listener <<
"the second field is a value " << second_explanation;
7905 template <
typename FirstMatcher,
typename SecondMatcher>
7911 template <
typename PairType>
7926 template <
typename Container>
7937 template <
typename InputIter>
7939 while (
first != last) {
7948 }
else if (
count() == 1) {
7949 *os <<
"has 1 element that ";
7953 for (
size_t i = 0;
i !=
count(); ++
i) {
7954 *os <<
"element #" <<
i <<
" ";
7966 *os <<
"isn't empty";
7971 for (
size_t i = 0;
i !=
count(); ++
i) {
7972 *os <<
"element #" <<
i <<
" ";
7985 const bool listener_interested = listener->
IsInterested();
7988 ::std::vector<internal::string> explanations(
count());
7990 typename StlContainer::const_iterator
it = stl_container.begin();
7991 size_t exam_pos = 0;
7992 bool mismatch_found =
false;
7997 for (;
it != stl_container.end() && exam_pos !=
count(); ++
it, ++exam_pos) {
7999 if (listener_interested) {
8002 explanations[exam_pos] = s.str();
8008 mismatch_found =
true;
8017 size_t actual_count = exam_pos;
8018 for (;
it != stl_container.end(); ++
it) {
8022 if (actual_count !=
count()) {
8027 if (listener_interested && (actual_count != 0)) {
8028 *listener <<
"which has " <<
Elements(actual_count);
8033 if (mismatch_found) {
8035 if (listener_interested) {
8036 *listener <<
"whose element #" << exam_pos <<
" doesn't match";
8044 if (listener_interested) {
8045 bool reason_printed =
false;
8046 for (
size_t i = 0;
i !=
count(); ++
i) {
8049 if (reason_printed) {
8050 *listener <<
",\nand ";
8052 *listener <<
"whose element #" <<
i <<
" matches, " << s;
8053 reason_printed =
true;
8080 num_matchers_(num_matchers),
8081 matched_(num_elements_* num_matchers_, 0) {
8087 return matched_[SpaceIndex(ilhs, irhs)] == 1;
8090 matched_[SpaceIndex(ilhs, irhs)] =
b ? 1 : 0;
8104 return ilhs * num_matchers_ + irhs;
8138 void DescribeToImpl(::std::ostream* os)
const;
8141 void DescribeNegationToImpl(::std::ostream* os)
const;
8143 bool VerifyAllElementsAndMatchersAreMatched(
8144 const ::std::vector<string>& element_printouts,
8149 return matcher_describers_;
8153 return Message() <<
n <<
" element" << (
n == 1 ?
"" :
"s");
8163 template <
typename Container>
8177 template <
typename InputIter>
8198 ::std::vector<string> element_printouts;
8200 stl_container.end(),
8204 const size_t actual_count = matrix.
LhsSize();
8205 if (actual_count == 0 &&
matchers_.empty()) {
8214 *listener <<
"which has " <<
Elements(actual_count);
8220 matrix, listener) &&
8227 template <
typename ElementIter>
8229 ::std::vector<string>* element_printouts,
8231 element_printouts->clear();
8232 ::std::vector<char> did_match;
8234 for (; elem_first != elem_last; ++
num_elements, ++elem_first) {
8238 for (
size_t irhs = 0; irhs !=
matchers_.size(); ++irhs) {
8244 ::std::vector<char>::const_iterator did_match_iter = did_match.begin();
8246 for (
size_t irhs = 0; irhs !=
matchers_.size(); ++irhs) {
8247 matrix.
SetEdge(ilhs, irhs, *did_match_iter++ != 0);
8260 template <
typename Target>
8262 template <
typename Arg>
8264 return MatcherCast<Target>(
a);
8269 template <
typename MatcherTuple>
8275 template <
typename Container>
8280 typedef ::std::vector<Matcher<const Element&> > MatcherVec;
8295 template <
typename MatcherTuple>
8300 template <
typename Container>
8305 typedef ::std::vector<Matcher<const Element&> > MatcherVec;
8320 template <
typename T>
8325 template <
typename Iter>
8329 template <
typename Container>
8343 template <
typename T>
8346 template <
typename Iter>
8349 template <
typename Container>
8370 template <
typename Tuple2Matcher,
typename Second>
8376 template <
typename T>
8394 template <
typename T>
8430 template <
typename Tuple2Matcher,
typename Second>
8432 const Tuple2Matcher&
tm,
const Second&
second) {
8442 const char* matcher_name,
8462 template <
typename Iter>
8463 inline internal::ElementsAreArrayMatcher<
8470 template <
typename T>
8472 const T* pointer,
size_t count) {
8476 template <
typename T,
size_t N>
8482 template <
typename Container>
8483 inline internal::ElementsAreArrayMatcher<typename Container::value_type>
8488 #if GTEST_HAS_STD_INITIALIZER_LIST_
8489 template <
typename T>
8490 inline internal::ElementsAreArrayMatcher<T>
8504 template <
typename Iter>
8505 inline internal::UnorderedElementsAreArrayMatcher<
8512 template <
typename T>
8513 inline internal::UnorderedElementsAreArrayMatcher<T>
8518 template <
typename T,
size_t N>
8519 inline internal::UnorderedElementsAreArrayMatcher<T>
8524 template <
typename Container>
8525 inline internal::UnorderedElementsAreArrayMatcher<
8531 #if GTEST_HAS_STD_INITIALIZER_LIST_
8532 template <
typename T>
8533 inline internal::UnorderedElementsAreArrayMatcher<T>
8550 template <
typename T>
8554 template <
typename T>
8560 template <
typename T>
8565 template <
typename T>
8580 template <
typename Lhs,
typename Rhs>
8584 template <
typename Rhs>
8590 template <
typename Rhs>
8596 template <
typename Rhs>
8602 template <
typename Rhs>
8608 template <
typename Rhs>
8627 template <
typename T>
8648 double rhs,
double max_abs_error) {
8656 double rhs,
double max_abs_error) {
8676 float rhs,
float max_abs_error) {
8684 float rhs,
float max_abs_error) {
8690 template <
typename InnerMatcher>
8692 const InnerMatcher& inner_matcher) {
8702 template <
typename To>
8703 inline PolymorphicMatcher<internal::WhenDynamicCastToMatcher<To> >
8713 template <
typename Class,
typename FieldType,
typename FieldMatcher>
8714 inline PolymorphicMatcher<
8719 field, MatcherCast<const FieldType&>(matcher)));
8730 template <
typename Class,
typename PropertyType,
typename PropertyMatcher>
8731 inline PolymorphicMatcher<
8733 PropertyType (Class::*property)()
const,
const PropertyMatcher& matcher) {
8757 template <
typename Callable,
typename ResultOfMatcher>
8759 Callable callable,
const ResultOfMatcher& matcher) {
8773 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
8780 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
8787 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
8794 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
8797 str,
false,
false));
8802 inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::string> >
8809 inline PolymorphicMatcher<internal::StartsWithMatcher<internal::string> >
8816 inline PolymorphicMatcher<internal::EndsWithMatcher<internal::string> >
8844 #if GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING
8848 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
8855 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
8862 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
8869 inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
8872 str,
false,
false));
8877 inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::wstring> >
8884 inline PolymorphicMatcher<internal::StartsWithMatcher<internal::wstring> >
8891 inline PolymorphicMatcher<internal::EndsWithMatcher<internal::wstring> >
8897 #endif // GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING
8925 template <
typename InnerMatcher>
8933 template <
typename Predicate>
8934 inline PolymorphicMatcher<internal::TrulyMatcher<Predicate> >
8945 template <
typename SizeMatcher>
8946 inline internal::SizeIsMatcher<SizeMatcher>
8956 template <
typename DistanceMatcher>
8957 inline internal::BeginEndDistanceIsMatcher<DistanceMatcher>
8966 template <
typename Container>
8967 inline PolymorphicMatcher<internal::ContainerEqMatcher<
8979 template <
typename Comparator,
typename ContainerMatcher>
8980 inline internal::WhenSortedByMatcher<Comparator, ContainerMatcher>
8982 const ContainerMatcher& container_matcher) {
8984 comparator, container_matcher);
8989 template <
typename ContainerMatcher>
8990 inline internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatcher>
9003 template <
typename TupleMatcher,
typename Container>
9004 inline internal::PointwiseMatcher<TupleMatcher,
9006 Pointwise(
const TupleMatcher& tuple_matcher,
const Container& rhs) {
9012 tuple_matcher, rhs);
9015 #if GTEST_HAS_STD_INITIALIZER_LIST_
9018 template <
typename TupleMatcher,
typename T>
9019 inline internal::PointwiseMatcher<TupleMatcher, std::vector<T> >
Pointwise(
9020 const TupleMatcher& tuple_matcher, std::initializer_list<T> rhs) {
9021 return Pointwise(tuple_matcher, std::vector<T>(rhs));
9024 #endif // GTEST_HAS_STD_INITIALIZER_LIST_
9037 template <
typename Tuple2Matcher,
typename RhsContainer>
9038 inline internal::UnorderedElementsAreArrayMatcher<
9039 typename internal::BoundSecondMatcher<
9043 const RhsContainer& rhs_container) {
9054 const RhsStlContainer& rhs_stl_container =
9058 ::std::vector<internal::BoundSecondMatcher<Tuple2Matcher, Second> >
matchers;
9059 for (
typename RhsStlContainer::const_iterator
it = rhs_stl_container.begin();
9060 it != rhs_stl_container.end(); ++
it) {
9069 #if GTEST_HAS_STD_INITIALIZER_LIST_
9072 template <
typename Tuple2Matcher,
typename T>
9073 inline internal::UnorderedElementsAreArrayMatcher<
9074 typename internal::BoundSecondMatcher<Tuple2Matcher, T> >
9076 std::initializer_list<T> rhs) {
9080 #endif // GTEST_HAS_STD_INITIALIZER_LIST_
9100 template <
typename M>
9132 template <
typename M>
9140 template <
typename M>
9150 template <
typename FirstMatcher,
typename SecondMatcher>
9151 inline internal::PairMatcher<FirstMatcher, SecondMatcher>
9152 Pair(FirstMatcher first_matcher, SecondMatcher second_matcher) {
9154 first_matcher, second_matcher);
9159 template <
typename M>
9165 template <
typename T,
typename M>
9172 template <
typename T,
typename M>
9175 return SafeMatcherCast<const T&>(matcher).MatchAndExplain(
value, listener);
9178 #if GTEST_LANG_CXX11
9181 template <
typename...
Args>
9186 template <
typename...
Args>
9191 #endif // GTEST_LANG_CXX11
9200 template <
typename InnerMatcher>
9201 inline InnerMatcher
AllArgs(
const InnerMatcher& matcher) {
return matcher; }
9207 #define ASSERT_THAT(value, matcher) ASSERT_PRED_FORMAT1(\
9208 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
9209 #define EXPECT_THAT(value, matcher) EXPECT_PRED_FORMAT1(\
9210 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
9252 #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_
9253 #define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_
9255 #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_
9256 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
9264 class ExpectationSet;
9312 bool VerifyAndClearExpectationsLocked()
9316 virtual void ClearDefaultActionsLocked()
9329 const void* untyped_args,
9330 const string& call_description)
const = 0;
9336 const void* untyped_action,
9337 const void* untyped_args)
const = 0;
9342 virtual void UntypedDescribeUninterestingCall(
9343 const void* untyped_args,
9344 ::std::ostream* os)
const
9354 const void* untyped_args,
9355 const void** untyped_action,
bool* is_excessive,
9356 ::std::ostream* what, ::std::ostream* why)
9360 virtual void UntypedPrintArgs(
const void* untyped_args,
9361 ::std::ostream* os)
const = 0;
9368 void RegisterOwner(
const void* mock_obj)
9374 void SetOwnerAndName(
const void* mock_obj,
const char*
name)
9380 const void* MockObject()
const
9385 const char* Name()
const
9393 const void* untyped_args)
9399 typedef std::vector<internal::linked_ptr<ExpectationBase> >
9462 template <
typename F>
9485 ".With() cannot appear "
9486 "more than once in an ON_CALL().");
9496 ".WillByDefault() must appear "
9497 "exactly once in an ON_CALL().");
9501 "DoDefault() cannot be used in ON_CALL().");
9514 ".WillByDefault() must appear exactly "
9515 "once in an ON_CALL().");
9555 static void AllowLeak(
const void* mock_obj)
9561 static bool VerifyAndClearExpectations(
void* mock_obj)
9567 static bool VerifyAndClear(
void* mock_obj)
9575 template <
typename F>
9578 template <
typename M>
9581 template <
typename M>
9584 template <
typename M>
9589 static void AllowUninterestingCalls(
const void* mock_obj)
9594 static void WarnUninterestingCalls(
const void* mock_obj)
9599 static void FailUninterestingCalls(
const void* mock_obj)
9604 static void UnregisterCallReaction(
const void* mock_obj)
9610 const void* mock_obj)
9616 static bool VerifyAndClearExpectationsLocked(
void* mock_obj)
9620 static void ClearDefaultActionsLocked(
void* mock_obj)
9624 static void Register(
9625 const void* mock_obj,
9632 static void RegisterUseByOnCallOrExpectCall(
9633 const void* mock_obj,
const char*
file,
int line)
9696 friend class ::testing::internal::ExpectationBase;
9697 friend class ::testing::internal::UntypedFunctionMockerBase;
9699 template <
typename F>
9700 friend class ::testing::internal::FunctionMockerBase;
9702 template <
typename F>
9703 friend class ::testing::internal::TypedExpectation;
9713 typedef ::std::set<Expectation, Less>
Set;
9721 return expectation_base_;
9889 void DescribeCallCountTo(::std::ostream* os)
const
9894 virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) = 0;
9897 friend class ::testing::Expectation;
9909 kRetiresOnSaturation
9930 void SpecifyCardinality(
const Cardinality& cardinality);
9938 cardinality_ = a_cardinality;
9946 void RetireAllPreRequisites()
9952 g_gmock_mutex.AssertHeld();
9959 g_gmock_mutex.AssertHeld();
9966 g_gmock_mutex.AssertHeld();
9967 return cardinality().IsSatisfiedByCallCount(call_count_);
9973 g_gmock_mutex.AssertHeld();
9974 return cardinality().IsSaturatedByCallCount(call_count_);
9980 g_gmock_mutex.AssertHeld();
9981 return cardinality().IsOverSaturatedByCallCount(call_count_);
9985 bool AllPrerequisitesAreSatisfied()
const
9995 g_gmock_mutex.AssertHeld();
10002 g_gmock_mutex.AssertHeld();
10010 void CheckActionCountIfNotDone()
const
10028 bool cardinality_specified_;
10043 bool extra_matcher_specified_;
10044 bool repeated_action_specified_;
10045 bool retires_on_saturation_;
10047 mutable
bool action_count_checked_;
10062 const char* a_file,
int a_line,
const string& a_source_text,
10077 CheckActionCountIfNotDone();
10078 for (UntypedActions::const_iterator
it = untyped_actions_.begin();
10079 it != untyped_actions_.end(); ++
it) {
10080 delete static_cast<const Action<F>*
>(*it);
10086 if (last_clause_ == kWith) {
10087 ExpectSpecProperty(
false,
10088 ".With() cannot appear "
10089 "more than once in an EXPECT_CALL().");
10091 ExpectSpecProperty(last_clause_ < kWith,
10092 ".With() must be the first "
10093 "clause in an EXPECT_CALL().");
10095 last_clause_ = kWith;
10097 extra_matcher_ =
m;
10098 extra_matcher_specified_ =
true;
10115 ExpectSpecProperty(last_clause_ <= kInSequence,
10116 ".InSequence() cannot appear after .After(),"
10117 " .WillOnce(), .WillRepeatedly(), or "
10118 ".RetiresOnSaturation().");
10119 last_clause_ = kInSequence;
10121 s.AddExpectation(GetHandle());
10143 ExpectSpecProperty(last_clause_ <= kAfter,
10144 ".After() cannot appear after .WillOnce(),"
10145 " .WillRepeatedly(), or "
10146 ".RetiresOnSaturation().");
10147 last_clause_ = kAfter;
10150 immediate_prerequisites_ += *
it;
10155 return After(s1).
After(s2);
10159 return After(s1, s2).
After(s3);
10163 return After(s1, s2, s3).
After(s4);
10168 return After(s1, s2, s3, s4).
After(s5);
10173 ExpectSpecProperty(last_clause_ <= kWillOnce,
10174 ".WillOnce() cannot appear after "
10175 ".WillRepeatedly() or .RetiresOnSaturation().");
10176 last_clause_ = kWillOnce;
10179 if (!cardinality_specified()) {
10180 set_cardinality(
Exactly(
static_cast<int>(untyped_actions_.size())));
10187 if (last_clause_ == kWillRepeatedly) {
10188 ExpectSpecProperty(
false,
10189 ".WillRepeatedly() cannot appear "
10190 "more than once in an EXPECT_CALL().");
10192 ExpectSpecProperty(last_clause_ < kWillRepeatedly,
10193 ".WillRepeatedly() cannot appear "
10194 "after .RetiresOnSaturation().");
10196 last_clause_ = kWillRepeatedly;
10197 repeated_action_specified_ =
true;
10199 repeated_action_ =
action;
10200 if (!cardinality_specified()) {
10201 set_cardinality(
AtLeast(
static_cast<int>(untyped_actions_.size())));
10206 CheckActionCountIfNotDone();
10212 ExpectSpecProperty(last_clause_ < kRetiresOnSaturation,
10213 ".RetiresOnSaturation() cannot appear "
10214 "more than once.");
10215 last_clause_ = kRetiresOnSaturation;
10216 retires_on_saturation_ =
true;
10220 CheckActionCountIfNotDone();
10232 return extra_matcher_;
10241 if (extra_matcher_specified_) {
10242 *os <<
" Expected args: ";
10243 extra_matcher_.DescribeTo(os);
10249 template <
typename Function>
10255 return owner_->GetHandleOf(
this);
10265 g_gmock_mutex.AssertHeld();
10272 g_gmock_mutex.AssertHeld();
10278 CheckActionCountIfNotDone();
10279 return !is_retired() && AllPrerequisitesAreSatisfied() &&
Matches(
args);
10286 ::std::ostream* os)
const
10288 g_gmock_mutex.AssertHeld();
10290 if (is_retired()) {
10291 *os <<
" Expected: the expectation is active\n"
10292 <<
" Actual: it is retired\n";
10298 if (!extra_matcher_.MatchAndExplain(
args, &listener)) {
10299 *os <<
" Expected args: ";
10300 extra_matcher_.DescribeTo(os);
10301 *os <<
"\n Actual: don't match";
10306 }
else if (!AllPrerequisitesAreSatisfied()) {
10307 *os <<
" Expected: all pre-requisites are satisfied\n"
10308 <<
" Actual: the following immediate pre-requisites "
10309 <<
"are not satisfied:\n";
10311 FindUnsatisfiedPrerequisites(&unsatisfied_prereqs);
10314 it != unsatisfied_prereqs.
end(); ++
it) {
10315 it->expectation_base()->DescribeLocationTo(os);
10316 *os <<
"pre-requisite #" <<
i++ <<
"\n";
10318 *os <<
" (end of pre-requisites)\n";
10324 *os <<
"The call matches the expectation.\n";
10333 g_gmock_mutex.AssertHeld();
10334 const int count = call_count();
10336 "call_count() is <= 0 when GetCurrentAction() is "
10337 "called - this should never happen.");
10339 const int action_count =
static_cast<int>(untyped_actions_.size());
10340 if (action_count > 0 && !repeated_action_specified_ &&
10341 count > action_count) {
10344 ::std::stringstream ss;
10345 DescribeLocationTo(&ss);
10346 ss <<
"Actions ran out in " << source_text() <<
"...\n"
10347 <<
"Called " <<
count <<
" times, but only "
10348 << action_count <<
" WillOnce()"
10349 << (action_count == 1 ?
" is" :
"s are") <<
" specified - ";
10350 mocker->DescribeDefaultActionTo(
args, &ss);
10354 return count <= action_count ?
10369 ::std::ostream* what,
10370 ::std::ostream* why)
10372 g_gmock_mutex.AssertHeld();
10373 if (IsSaturated()) {
10375 IncrementCallCount();
10376 *what <<
"Mock function called more times than expected - ";
10377 mocker->DescribeDefaultActionTo(
args, what);
10378 DescribeCallCountTo(why);
10386 IncrementCallCount();
10387 RetireAllPreRequisites();
10389 if (retires_on_saturation_ && IsSaturated()) {
10394 *what <<
"Mock function call matches " << source_text() <<
"...\n";
10395 return &(GetCurrentAction(mocker,
args));
10423 template <
typename F>
10433 : function_mocker_(function_mocker) {}
10440 string(
"ON_CALL(") +
obj +
", " +
call +
") invoked");
10448 const string source_text(
string(
"EXPECT_CALL(") +
obj +
", " +
call +
")");
10450 return function_mocker_->AddNewExpectation(
10455 template <
typename Function>
10479 template <
typename T>
10506 template <
typename T>
10513 : value_ptr_(&
ref) {}
10515 const T&
Peek()
const {
return *value_ptr_; }
10527 # pragma warning(push) // Saves the current warning state.
10528 # pragma warning(disable:4355) // Temporarily disables warning 4355.
10545 virtual void PrintAsActionResult(::std::ostream* os)
const = 0;
10549 template <
typename T>
10554 return result_.Unwrap();
10559 *os <<
"\n Returns: ";
10566 template <
typename F>
10570 const string& call_description) {
10577 template <
typename F>
10606 template <
typename F>
10610 const string& call_description) {
10617 template <
typename F>
10633 template <
typename F>
10634 class FunctionMockerBase :
public UntypedFunctionMockerBase {
10648 VerifyAndClearExpectationsLocked();
10649 Mock::UnregisterLocked(
this);
10650 ClearDefaultActionsLocked();
10658 for (UntypedOnCallSpecs::const_reverse_iterator
it
10659 = untyped_on_call_specs_.rbegin();
10660 it != untyped_on_call_specs_.rend(); ++
it) {
10677 const string& call_description)
const {
10679 this->FindOnCallSpec(
args);
10680 if (
spec != NULL) {
10681 return spec->GetAction().Perform(
args);
10683 const string message = call_description +
10684 "\n The mock function has no default action "
10685 "set, and its return type has no default value set.";
10686 #if GTEST_HAS_EXCEPTIONS
10688 throw std::runtime_error(
message);
10702 const void* untyped_args,
10703 const string& call_description)
const {
10706 return ResultHolder::PerformDefaultAction(
this,
args, call_description);
10714 const void* untyped_action,
const void* untyped_args)
const {
10720 return ResultHolder::PerformAction(
action,
args);
10727 g_gmock_mutex.AssertHeld();
10736 UntypedOnCallSpecs specs_to_delete;
10737 untyped_on_call_specs_.swap(specs_to_delete);
10739 g_gmock_mutex.Unlock();
10740 for (UntypedOnCallSpecs::const_iterator
it =
10741 specs_to_delete.begin();
10742 it != specs_to_delete.end(); ++
it) {
10748 g_gmock_mutex.Lock();
10752 template <
typename Function>
10763 DownCast_<ResultHolder*>(this->UntypedInvokeWith(&
args)));
10764 return holder->Unwrap();
10772 Mock::RegisterUseByOnCallOrExpectCall(MockObject(),
file,
line);
10774 untyped_on_call_specs_.push_back(on_call_spec);
10775 return *on_call_spec;
10782 const string& source_text,
10785 Mock::RegisterUseByOnCallOrExpectCall(MockObject(),
file,
line);
10789 untyped_expectations_.push_back(untyped_expectation);
10793 if (implicit_sequence != NULL) {
10813 ::std::ostream* os)
const {
10816 if (
spec == NULL) {
10818 "returning directly.\n" :
10819 "returning default value.\n");
10821 *os <<
"taking default action specified at:\n"
10830 const void* untyped_args,
10831 ::std::ostream* os)
const
10835 *os <<
"Uninteresting mock function call - ";
10836 DescribeDefaultActionTo(
args, os);
10837 *os <<
" Function call: " << Name();
10858 const void* untyped_args,
10859 const void** untyped_action,
bool* is_excessive,
10860 ::std::ostream* what, ::std::ostream* why)
10867 this->FormatUnexpectedCallMessageLocked(
args, what, why);
10874 *is_excessive = exp->IsSaturated();
10878 *untyped_action =
action;
10884 ::std::ostream* os)
const {
10895 g_gmock_mutex.AssertHeld();
10896 for (
typename UntypedExpectations::const_reverse_iterator
it =
10897 untyped_expectations_.rbegin();
10898 it != untyped_expectations_.rend(); ++
it) {
10911 ::std::ostream* os,
10912 ::std::ostream* why)
const
10914 g_gmock_mutex.AssertHeld();
10915 *os <<
"\nUnexpected mock function call - ";
10916 DescribeDefaultActionTo(
args, os);
10917 PrintTriedExpectationsLocked(
args, why);
10924 ::std::ostream* why)
const
10926 g_gmock_mutex.AssertHeld();
10927 const int count =
static_cast<int>(untyped_expectations_.size());
10928 *why <<
"Google Mock tried the following " <<
count <<
" "
10929 << (
count == 1 ?
"expectation, but it didn't match" :
10930 "expectations, but none matched")
10938 *why <<
"tried expectation #" <<
i <<
": ";
10966 # pragma warning(pop) // Restores the warning state.
11003 template <
typename T>
11008 : expectation_base_(exp.GetHandle().expectation_base()) {}
11016 #define GMOCK_ON_CALL_IMPL_(obj, call) \
11017 ((obj).gmock_##call).InternalDefaultActionSetAt(__FILE__, __LINE__, \
11019 #define ON_CALL(obj, call) GMOCK_ON_CALL_IMPL_(obj, call)
11021 #define GMOCK_EXPECT_CALL_IMPL_(obj, call) \
11022 ((obj).gmock_##call).InternalExpectedAt(__FILE__, __LINE__, #obj, #call)
11023 #define EXPECT_CALL(obj, call) GMOCK_EXPECT_CALL_IMPL_(obj, call)
11025 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
11027 #if GTEST_HAS_STD_FUNCTION_
11028 # include <functional>
11034 template <
typename F>
11035 class FunctionMockerBase;
11042 template <
typename F>
11043 class FunctionMocker;
11045 template <
typename R>
11053 return this->current_spec();
11065 template <
typename R,
typename A1>
11074 return this->current_spec();
11086 template <
typename R,
typename A1,
typename A2>
11095 return this->current_spec();
11107 template <
typename R,
typename A1,
typename A2,
typename A3>
11111 typedef R
F(A1, A2, A3);
11117 return this->current_spec();
11129 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4>
11133 typedef R
F(A1, A2, A3, A4);
11139 return this->current_spec();
11151 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
11156 typedef R
F(A1, A2, A3, A4, A5);
11162 return this->current_spec();
11174 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
11175 typename A5,
typename A6>
11179 typedef R
F(A1, A2, A3, A4, A5, A6);
11187 return this->current_spec();
11199 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
11200 typename A5,
typename A6,
typename A7>
11204 typedef R
F(A1, A2, A3, A4, A5, A6, A7);
11212 return this->current_spec();
11224 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
11225 typename A5,
typename A6,
typename A7,
typename A8>
11229 typedef R
F(A1, A2, A3, A4, A5, A6, A7, A8);
11237 return this->current_spec();
11249 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
11250 typename A5,
typename A6,
typename A7,
typename A8,
typename A9>
11254 typedef R
F(A1, A2, A3, A4, A5, A6, A7, A8, A9);
11263 return this->current_spec();
11266 R
Invoke(A1
a1, A2
a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) {
11275 template <
typename R,
typename A1,
typename A2,
typename A3,
typename A4,
11276 typename A5,
typename A6,
typename A7,
typename A8,
typename A9,
11281 typedef R
F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
11289 m6, m7, m8, m9, m10));
11290 return this->current_spec();
11293 R
Invoke(A1
a1, A2
a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
11311 using internal::FunctionMocker;
11318 #define GMOCK_RESULT_(tn, ...) \
11319 tn ::testing::internal::Function<__VA_ARGS__>::Result
11323 #define GMOCK_ARG_(tn, N, ...) \
11324 tn ::testing::internal::Function<__VA_ARGS__>::Argument##N
11328 #define GMOCK_MATCHER_(tn, N, ...) \
11329 const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&
11333 #define GMOCK_MOCKER_(arity, constness, Method) \
11334 GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
11337 #define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
11338 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
11340 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
11341 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
11343 this_method_does_not_take_0_arguments); \
11344 GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \
11345 return GMOCK_MOCKER_(0, constness, Method).Invoke(); \
11347 ::testing::MockSpec<__VA_ARGS__>& \
11348 gmock_##Method() constness { \
11349 GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \
11350 return GMOCK_MOCKER_(0, constness, Method).With(); \
11352 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \
11356 #define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
11357 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
11358 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
11359 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
11360 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
11362 this_method_does_not_take_1_argument); \
11363 GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \
11364 return GMOCK_MOCKER_(1, constness, Method).Invoke(gmock_a1); \
11366 ::testing::MockSpec<__VA_ARGS__>& \
11367 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
11368 GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \
11369 return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \
11371 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \
11375 #define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \
11376 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
11377 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
11378 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
11379 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
11380 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
11382 this_method_does_not_take_2_arguments); \
11383 GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \
11384 return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2); \
11386 ::testing::MockSpec<__VA_ARGS__>& \
11387 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
11388 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
11389 GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \
11390 return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \
11392 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \
11396 #define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \
11397 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
11398 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
11399 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
11400 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
11401 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
11402 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
11404 this_method_does_not_take_3_arguments); \
11405 GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \
11406 return GMOCK_MOCKER_(3, constness, Method).Invoke(gmock_a1, gmock_a2, \
11409 ::testing::MockSpec<__VA_ARGS__>& \
11410 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
11411 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
11412 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
11413 GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \
11414 return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \
11417 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \
11421 #define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \
11422 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
11423 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
11424 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
11425 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
11426 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
11427 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
11428 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
11430 this_method_does_not_take_4_arguments); \
11431 GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \
11432 return GMOCK_MOCKER_(4, constness, Method).Invoke(gmock_a1, gmock_a2, \
11433 gmock_a3, gmock_a4); \
11435 ::testing::MockSpec<__VA_ARGS__>& \
11436 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
11437 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
11438 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
11439 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
11440 GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \
11441 return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \
11442 gmock_a3, gmock_a4); \
11444 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \
11448 #define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \
11449 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
11450 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
11451 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
11452 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
11453 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
11454 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
11455 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
11456 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
11458 this_method_does_not_take_5_arguments); \
11459 GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \
11460 return GMOCK_MOCKER_(5, constness, Method).Invoke(gmock_a1, gmock_a2, \
11461 gmock_a3, gmock_a4, gmock_a5); \
11463 ::testing::MockSpec<__VA_ARGS__>& \
11464 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
11465 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
11466 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
11467 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
11468 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
11469 GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \
11470 return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \
11471 gmock_a3, gmock_a4, gmock_a5); \
11473 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \
11477 #define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \
11478 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
11479 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
11480 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
11481 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
11482 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
11483 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
11484 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
11485 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
11486 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
11488 this_method_does_not_take_6_arguments); \
11489 GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \
11490 return GMOCK_MOCKER_(6, constness, Method).Invoke(gmock_a1, gmock_a2, \
11491 gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
11493 ::testing::MockSpec<__VA_ARGS__>& \
11494 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
11495 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
11496 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
11497 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
11498 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
11499 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
11500 GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \
11501 return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \
11502 gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
11504 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \
11508 #define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \
11509 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
11510 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
11511 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
11512 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
11513 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
11514 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
11515 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
11516 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
11517 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
11518 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
11520 this_method_does_not_take_7_arguments); \
11521 GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \
11522 return GMOCK_MOCKER_(7, constness, Method).Invoke(gmock_a1, gmock_a2, \
11523 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
11525 ::testing::MockSpec<__VA_ARGS__>& \
11526 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
11527 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
11528 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
11529 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
11530 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
11531 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
11532 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
11533 GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \
11534 return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \
11535 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
11537 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \
11541 #define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \
11542 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
11543 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
11544 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
11545 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
11546 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
11547 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
11548 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
11549 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
11550 GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
11551 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
11552 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
11554 this_method_does_not_take_8_arguments); \
11555 GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \
11556 return GMOCK_MOCKER_(8, constness, Method).Invoke(gmock_a1, gmock_a2, \
11557 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
11559 ::testing::MockSpec<__VA_ARGS__>& \
11560 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
11561 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
11562 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
11563 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
11564 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
11565 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
11566 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
11567 GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
11568 GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \
11569 return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \
11570 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
11572 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \
11576 #define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \
11577 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
11578 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
11579 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
11580 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
11581 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
11582 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
11583 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
11584 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
11585 GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
11586 GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
11587 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
11588 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
11590 this_method_does_not_take_9_arguments); \
11591 GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \
11592 return GMOCK_MOCKER_(9, constness, Method).Invoke(gmock_a1, gmock_a2, \
11593 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
11596 ::testing::MockSpec<__VA_ARGS__>& \
11597 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
11598 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
11599 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
11600 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
11601 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
11602 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
11603 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
11604 GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
11605 GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
11606 GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \
11607 return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \
11608 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
11611 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \
11615 #define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \
11616 GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
11617 GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
11618 GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
11619 GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
11620 GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
11621 GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
11622 GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
11623 GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
11624 GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
11625 GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
11626 GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
11627 GTEST_COMPILE_ASSERT_((::testing::tuple_size< \
11628 tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
11630 this_method_does_not_take_10_arguments); \
11631 GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \
11632 return GMOCK_MOCKER_(10, constness, Method).Invoke(gmock_a1, gmock_a2, \
11633 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
11636 ::testing::MockSpec<__VA_ARGS__>& \
11637 gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
11638 GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
11639 GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
11640 GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
11641 GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
11642 GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
11643 GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
11644 GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
11645 GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \
11646 GMOCK_MATCHER_(tn, 10, \
11647 __VA_ARGS__) gmock_a10) constness { \
11648 GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \
11649 return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \
11650 gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
11653 mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \
11656 #define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__)
11657 #define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__)
11658 #define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)
11659 #define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__)
11660 #define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__)
11661 #define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__)
11662 #define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__)
11663 #define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__)
11664 #define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__)
11665 #define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__)
11666 #define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__)
11668 #define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__)
11669 #define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__)
11670 #define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__)
11671 #define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__)
11672 #define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__)
11673 #define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__)
11674 #define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__)
11675 #define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__)
11676 #define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__)
11677 #define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__)
11678 #define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__)
11680 #define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__)
11681 #define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__)
11682 #define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__)
11683 #define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__)
11684 #define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__)
11685 #define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__)
11686 #define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__)
11687 #define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__)
11688 #define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__)
11689 #define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__)
11690 #define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__)
11692 #define MOCK_CONST_METHOD0_T(m, ...) \
11693 GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__)
11694 #define MOCK_CONST_METHOD1_T(m, ...) \
11695 GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__)
11696 #define MOCK_CONST_METHOD2_T(m, ...) \
11697 GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__)
11698 #define MOCK_CONST_METHOD3_T(m, ...) \
11699 GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__)
11700 #define MOCK_CONST_METHOD4_T(m, ...) \
11701 GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__)
11702 #define MOCK_CONST_METHOD5_T(m, ...) \
11703 GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__)
11704 #define MOCK_CONST_METHOD6_T(m, ...) \
11705 GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__)
11706 #define MOCK_CONST_METHOD7_T(m, ...) \
11707 GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__)
11708 #define MOCK_CONST_METHOD8_T(m, ...) \
11709 GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__)
11710 #define MOCK_CONST_METHOD9_T(m, ...) \
11711 GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__)
11712 #define MOCK_CONST_METHOD10_T(m, ...) \
11713 GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__)
11715 #define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \
11716 GMOCK_METHOD0_(, , ct, m, __VA_ARGS__)
11717 #define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \
11718 GMOCK_METHOD1_(, , ct, m, __VA_ARGS__)
11719 #define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \
11720 GMOCK_METHOD2_(, , ct, m, __VA_ARGS__)
11721 #define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \
11722 GMOCK_METHOD3_(, , ct, m, __VA_ARGS__)
11723 #define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \
11724 GMOCK_METHOD4_(, , ct, m, __VA_ARGS__)
11725 #define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \
11726 GMOCK_METHOD5_(, , ct, m, __VA_ARGS__)
11727 #define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \
11728 GMOCK_METHOD6_(, , ct, m, __VA_ARGS__)
11729 #define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \
11730 GMOCK_METHOD7_(, , ct, m, __VA_ARGS__)
11731 #define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \
11732 GMOCK_METHOD8_(, , ct, m, __VA_ARGS__)
11733 #define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \
11734 GMOCK_METHOD9_(, , ct, m, __VA_ARGS__)
11735 #define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \
11736 GMOCK_METHOD10_(, , ct, m, __VA_ARGS__)
11738 #define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \
11739 GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__)
11740 #define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \
11741 GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__)
11742 #define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \
11743 GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__)
11744 #define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \
11745 GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__)
11746 #define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \
11747 GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__)
11748 #define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \
11749 GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__)
11750 #define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \
11751 GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__)
11752 #define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \
11753 GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__)
11754 #define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \
11755 GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__)
11756 #define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \
11757 GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__)
11758 #define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \
11759 GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__)
11761 #define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
11762 GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__)
11763 #define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
11764 GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__)
11765 #define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
11766 GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__)
11767 #define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
11768 GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__)
11769 #define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
11770 GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__)
11771 #define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
11772 GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__)
11773 #define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
11774 GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__)
11775 #define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
11776 GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__)
11777 #define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
11778 GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__)
11779 #define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
11780 GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__)
11781 #define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
11782 GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__)
11784 #define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
11785 GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__)
11786 #define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
11787 GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__)
11788 #define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
11789 GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__)
11790 #define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
11791 GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__)
11792 #define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
11793 GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__)
11794 #define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
11795 GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__)
11796 #define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
11797 GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__)
11798 #define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
11799 GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__)
11800 #define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
11801 GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__)
11802 #define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
11803 GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__)
11804 #define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
11805 GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__)
11853 template <
typename F>
11856 template <
typename R>
11863 #if GTEST_HAS_STD_FUNCTION_
11865 return [
this]() -> R {
11866 return this->
Call();
11869 #endif // GTEST_HAS_STD_FUNCTION_
11875 template <
typename R,
typename A0>
11882 #if GTEST_HAS_STD_FUNCTION_
11884 return [
this](A0 a0) -> R {
11885 return this->
Call(a0);
11888 #endif // GTEST_HAS_STD_FUNCTION_
11894 template <
typename R,
typename A0,
typename A1>
11901 #if GTEST_HAS_STD_FUNCTION_
11903 return [
this](A0 a0, A1
a1) -> R {
11904 return this->
Call(a0,
a1);
11907 #endif // GTEST_HAS_STD_FUNCTION_
11913 template <
typename R,
typename A0,
typename A1,
typename A2>
11920 #if GTEST_HAS_STD_FUNCTION_
11922 return [
this](A0 a0, A1
a1, A2
a2) -> R {
11926 #endif // GTEST_HAS_STD_FUNCTION_
11932 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3>
11939 #if GTEST_HAS_STD_FUNCTION_
11941 return [
this](A0 a0, A1
a1, A2
a2, A3 a3) -> R {
11942 return this->
Call(a0,
a1,
a2, a3);
11945 #endif // GTEST_HAS_STD_FUNCTION_
11951 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
11959 #if GTEST_HAS_STD_FUNCTION_
11961 return [
this](A0 a0, A1
a1, A2
a2, A3 a3, A4 a4) -> R {
11962 return this->
Call(a0,
a1,
a2, a3, a4);
11965 #endif // GTEST_HAS_STD_FUNCTION_
11971 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
11972 typename A4,
typename A5>
11979 #if GTEST_HAS_STD_FUNCTION_
11981 return [
this](A0 a0, A1
a1, A2
a2, A3 a3, A4 a4, A5 a5) -> R {
11982 return this->
Call(a0,
a1,
a2, a3, a4, a5);
11985 #endif // GTEST_HAS_STD_FUNCTION_
11991 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
11992 typename A4,
typename A5,
typename A6>
11999 #if GTEST_HAS_STD_FUNCTION_
12000 std::function<R(A0, A1, A2, A3, A4, A5, A6)> AsStdFunction() {
12001 return [
this](A0 a0, A1
a1, A2
a2, A3 a3, A4 a4, A5 a5, A6 a6) -> R {
12002 return this->
Call(a0,
a1,
a2, a3, a4, a5, a6);
12005 #endif // GTEST_HAS_STD_FUNCTION_
12011 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
12012 typename A4,
typename A5,
typename A6,
typename A7>
12019 #if GTEST_HAS_STD_FUNCTION_
12020 std::function<R(A0, A1, A2, A3, A4, A5, A6, A7)> AsStdFunction() {
12021 return [
this](A0 a0, A1
a1, A2
a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -> R {
12022 return this->
Call(a0,
a1,
a2, a3, a4, a5, a6, a7);
12025 #endif // GTEST_HAS_STD_FUNCTION_
12031 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
12032 typename A4,
typename A5,
typename A6,
typename A7,
typename A8>
12039 #if GTEST_HAS_STD_FUNCTION_
12040 std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> AsStdFunction() {
12041 return [
this](A0 a0, A1
a1, A2
a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
12043 return this->
Call(a0,
a1,
a2, a3, a4, a5, a6, a7, a8);
12046 #endif // GTEST_HAS_STD_FUNCTION_
12052 template <
typename R,
typename A0,
typename A1,
typename A2,
typename A3,
12053 typename A4,
typename A5,
typename A6,
typename A7,
typename A8,
12059 MOCK_METHOD10_T(
Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));
12061 #if GTEST_HAS_STD_FUNCTION_
12062 std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> AsStdFunction() {
12063 return [
this](A0 a0, A1
a1, A2
a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
12064 A8 a8, A9 a9) -> R {
12065 return this->
Call(a0,
a1,
a2, a3, a4, a5, a6, a7, a8, a9);
12068 #endif // GTEST_HAS_STD_FUNCTION_
12076 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
12147 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
12148 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
12153 template <
class MockClass>
12154 class NiceMock :
public MockClass {
12159 ::testing::Mock::AllowUninterestingCalls(
12160 internal::ImplicitCast_<MockClass*>(
this));
12165 template <
typename A1>
12167 ::testing::Mock::AllowUninterestingCalls(
12168 internal::ImplicitCast_<MockClass*>(
this));
12170 template <
typename A1,
typename A2>
12172 ::testing::Mock::AllowUninterestingCalls(
12173 internal::ImplicitCast_<MockClass*>(
this));
12176 template <
typename A1,
typename A2,
typename A3>
12178 ::testing::Mock::AllowUninterestingCalls(
12179 internal::ImplicitCast_<MockClass*>(
this));
12182 template <
typename A1,
typename A2,
typename A3,
typename A4>
12184 const A4& a4) : MockClass(
a1,
a2, a3, a4) {
12185 ::testing::Mock::AllowUninterestingCalls(
12186 internal::ImplicitCast_<MockClass*>(
this));
12189 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
12191 const A5& a5) : MockClass(
a1,
a2, a3, a4, a5) {
12192 ::testing::Mock::AllowUninterestingCalls(
12193 internal::ImplicitCast_<MockClass*>(
this));
12196 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12199 const A5& a5,
const A6& a6) : MockClass(
a1,
a2, a3, a4, a5, a6) {
12200 ::testing::Mock::AllowUninterestingCalls(
12201 internal::ImplicitCast_<MockClass*>(
this));
12204 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12205 typename A6,
typename A7>
12207 const A5& a5,
const A6& a6,
const A7& a7) : MockClass(
a1,
a2, a3, a4, a5,
12209 ::testing::Mock::AllowUninterestingCalls(
12210 internal::ImplicitCast_<MockClass*>(
this));
12213 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12214 typename A6,
typename A7,
typename A8>
12216 const A5& a5,
const A6& a6,
const A7& a7,
const A8& a8) : MockClass(
a1,
12217 a2, a3, a4, a5, a6, a7, a8) {
12218 ::testing::Mock::AllowUninterestingCalls(
12219 internal::ImplicitCast_<MockClass*>(
this));
12222 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12223 typename A6,
typename A7,
typename A8,
typename A9>
12225 const A5& a5,
const A6& a6,
const A7& a7,
const A8& a8,
12226 const A9& a9) : MockClass(
a1,
a2, a3, a4, a5, a6, a7, a8, a9) {
12227 ::testing::Mock::AllowUninterestingCalls(
12228 internal::ImplicitCast_<MockClass*>(
this));
12231 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12232 typename A6,
typename A7,
typename A8,
typename A9,
typename A10>
12234 const A5& a5,
const A6& a6,
const A7& a7,
const A8& a8,
const A9& a9,
12235 const A10& a10) : MockClass(
a1,
a2, a3, a4, a5, a6, a7, a8, a9, a10) {
12236 ::testing::Mock::AllowUninterestingCalls(
12237 internal::ImplicitCast_<MockClass*>(
this));
12241 ::testing::Mock::UnregisterCallReaction(
12242 internal::ImplicitCast_<MockClass*>(
this));
12249 template <
class MockClass>
12250 class NaggyMock :
public MockClass {
12255 ::testing::Mock::WarnUninterestingCalls(
12256 internal::ImplicitCast_<MockClass*>(
this));
12261 template <
typename A1>
12263 ::testing::Mock::WarnUninterestingCalls(
12264 internal::ImplicitCast_<MockClass*>(
this));
12266 template <
typename A1,
typename A2>
12268 ::testing::Mock::WarnUninterestingCalls(
12269 internal::ImplicitCast_<MockClass*>(
this));
12272 template <
typename A1,
typename A2,
typename A3>
12274 ::testing::Mock::WarnUninterestingCalls(
12275 internal::ImplicitCast_<MockClass*>(
this));
12278 template <
typename A1,
typename A2,
typename A3,
typename A4>
12280 const A4& a4) : MockClass(
a1,
a2, a3, a4) {
12281 ::testing::Mock::WarnUninterestingCalls(
12282 internal::ImplicitCast_<MockClass*>(
this));
12285 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
12287 const A5& a5) : MockClass(
a1,
a2, a3, a4, a5) {
12288 ::testing::Mock::WarnUninterestingCalls(
12289 internal::ImplicitCast_<MockClass*>(
this));
12292 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12295 const A5& a5,
const A6& a6) : MockClass(
a1,
a2, a3, a4, a5, a6) {
12296 ::testing::Mock::WarnUninterestingCalls(
12297 internal::ImplicitCast_<MockClass*>(
this));
12300 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12301 typename A6,
typename A7>
12303 const A5& a5,
const A6& a6,
const A7& a7) : MockClass(
a1,
a2, a3, a4, a5,
12305 ::testing::Mock::WarnUninterestingCalls(
12306 internal::ImplicitCast_<MockClass*>(
this));
12309 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12310 typename A6,
typename A7,
typename A8>
12312 const A5& a5,
const A6& a6,
const A7& a7,
const A8& a8) : MockClass(
a1,
12313 a2, a3, a4, a5, a6, a7, a8) {
12314 ::testing::Mock::WarnUninterestingCalls(
12315 internal::ImplicitCast_<MockClass*>(
this));
12318 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12319 typename A6,
typename A7,
typename A8,
typename A9>
12321 const A5& a5,
const A6& a6,
const A7& a7,
const A8& a8,
12322 const A9& a9) : MockClass(
a1,
a2, a3, a4, a5, a6, a7, a8, a9) {
12323 ::testing::Mock::WarnUninterestingCalls(
12324 internal::ImplicitCast_<MockClass*>(
this));
12327 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12328 typename A6,
typename A7,
typename A8,
typename A9,
typename A10>
12330 const A5& a5,
const A6& a6,
const A7& a7,
const A8& a8,
const A9& a9,
12331 const A10& a10) : MockClass(
a1,
a2, a3, a4, a5, a6, a7, a8, a9, a10) {
12332 ::testing::Mock::WarnUninterestingCalls(
12333 internal::ImplicitCast_<MockClass*>(
this));
12337 ::testing::Mock::UnregisterCallReaction(
12338 internal::ImplicitCast_<MockClass*>(
this));
12345 template <
class MockClass>
12346 class StrictMock :
public MockClass {
12351 ::testing::Mock::FailUninterestingCalls(
12352 internal::ImplicitCast_<MockClass*>(
this));
12357 template <
typename A1>
12359 ::testing::Mock::FailUninterestingCalls(
12360 internal::ImplicitCast_<MockClass*>(
this));
12362 template <
typename A1,
typename A2>
12364 ::testing::Mock::FailUninterestingCalls(
12365 internal::ImplicitCast_<MockClass*>(
this));
12368 template <
typename A1,
typename A2,
typename A3>
12370 ::testing::Mock::FailUninterestingCalls(
12371 internal::ImplicitCast_<MockClass*>(
this));
12374 template <
typename A1,
typename A2,
typename A3,
typename A4>
12376 const A4& a4) : MockClass(
a1,
a2, a3, a4) {
12377 ::testing::Mock::FailUninterestingCalls(
12378 internal::ImplicitCast_<MockClass*>(
this));
12381 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
12383 const A5& a5) : MockClass(
a1,
a2, a3, a4, a5) {
12384 ::testing::Mock::FailUninterestingCalls(
12385 internal::ImplicitCast_<MockClass*>(
this));
12388 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12391 const A5& a5,
const A6& a6) : MockClass(
a1,
a2, a3, a4, a5, a6) {
12392 ::testing::Mock::FailUninterestingCalls(
12393 internal::ImplicitCast_<MockClass*>(
this));
12396 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12397 typename A6,
typename A7>
12399 const A5& a5,
const A6& a6,
const A7& a7) : MockClass(
a1,
a2, a3, a4, a5,
12401 ::testing::Mock::FailUninterestingCalls(
12402 internal::ImplicitCast_<MockClass*>(
this));
12405 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12406 typename A6,
typename A7,
typename A8>
12408 const A5& a5,
const A6& a6,
const A7& a7,
const A8& a8) : MockClass(
a1,
12409 a2, a3, a4, a5, a6, a7, a8) {
12410 ::testing::Mock::FailUninterestingCalls(
12411 internal::ImplicitCast_<MockClass*>(
this));
12414 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12415 typename A6,
typename A7,
typename A8,
typename A9>
12417 const A5& a5,
const A6& a6,
const A7& a7,
const A8& a8,
12418 const A9& a9) : MockClass(
a1,
a2, a3, a4, a5, a6, a7, a8, a9) {
12419 ::testing::Mock::FailUninterestingCalls(
12420 internal::ImplicitCast_<MockClass*>(
this));
12423 template <
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
12424 typename A6,
typename A7,
typename A8,
typename A9,
typename A10>
12426 const A5& a5,
const A6& a6,
const A7& a7,
const A8& a8,
const A9& a9,
12427 const A10& a10) : MockClass(
a1,
a2, a3, a4, a5, a6, a7, a8, a9, a10) {
12428 ::testing::Mock::FailUninterestingCalls(
12429 internal::ImplicitCast_<MockClass*>(
this));
12433 ::testing::Mock::UnregisterCallReaction(
12434 internal::ImplicitCast_<MockClass*>(
this));
12448 template <
typename MockClass>
12449 class NiceMock<NiceMock<MockClass> >;
12450 template <
typename MockClass>
12451 class NiceMock<NaggyMock<MockClass> >;
12452 template <
typename MockClass>
12453 class NiceMock<StrictMock<MockClass> >;
12455 template <
typename MockClass>
12456 class NaggyMock<NiceMock<MockClass> >;
12457 template <
typename MockClass>
12458 class NaggyMock<NaggyMock<MockClass> >;
12459 template <
typename MockClass>
12460 class NaggyMock<StrictMock<MockClass> >;
12462 template <
typename MockClass>
12463 class StrictMock<NiceMock<MockClass> >;
12464 template <
typename MockClass>
12465 class StrictMock<NaggyMock<MockClass> >;
12466 template <
typename MockClass>
12467 class StrictMock<StrictMock<MockClass> >;
12471 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
12509 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
12510 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
12512 #include <iterator>
12521 #define GMOCK_FIELD_TYPE_(Tuple, i) \
12522 typename ::testing::tuple_element<i, Tuple>::type
12535 template <
class Tuple,
int k0 = -1,
int k1 = -1,
int k2 = -1,
int k3 = -1,
12536 int k4 = -1,
int k5 = -1,
int k6 = -1,
int k7 = -1,
int k8 = -1,
12541 template <
class Tuple,
int k0,
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
12542 int k7,
int k8,
int k9>
12552 return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
12553 get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t));
12559 template <
class Tuple>
12560 class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
12568 template <
class Tuple,
int k0>
12569 class TupleFields<Tuple,
k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
12573 return type(get<k0>(t));
12577 template <
class Tuple,
int k0,
int k1>
12578 class TupleFields<Tuple,
k0,
k1, -1, -1, -1, -1, -1, -1, -1, -1> {
12583 return type(get<k0>(t), get<k1>(t));
12587 template <
class Tuple,
int k0,
int k1,
int k2>
12588 class TupleFields<Tuple,
k0,
k1,
k2, -1, -1, -1, -1, -1, -1, -1> {
12593 return type(get<k0>(t), get<k1>(t), get<k2>(t));
12597 template <
class Tuple,
int k0,
int k1,
int k2,
int k3>
12598 class TupleFields<Tuple,
k0,
k1,
k2, k3, -1, -1, -1, -1, -1, -1> {
12604 return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t));
12608 template <
class Tuple,
int k0,
int k1,
int k2,
int k3,
int k4>
12609 class TupleFields<Tuple,
k0,
k1,
k2, k3, k4, -1, -1, -1, -1, -1> {
12615 return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t));
12619 template <
class Tuple,
int k0,
int k1,
int k2,
int k3,
int k4,
int k5>
12620 class TupleFields<Tuple,
k0,
k1,
k2, k3, k4, k5, -1, -1, -1, -1> {
12627 return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
12632 template <
class Tuple,
int k0,
int k1,
int k2,
int k3,
int k4,
int k5,
int k6>
12633 class TupleFields<Tuple,
k0,
k1,
k2, k3, k4, k5, k6, -1, -1, -1> {
12640 return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
12641 get<k5>(t), get<k6>(t));
12645 template <
class Tuple,
int k0,
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
12647 class TupleFields<Tuple,
k0,
k1,
k2, k3, k4, k5, k6, k7, -1, -1> {
12655 return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
12656 get<k5>(t), get<k6>(t), get<k7>(t));
12660 template <
class Tuple,
int k0,
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
12662 class TupleFields<Tuple,
k0,
k1,
k2, k3, k4, k5, k6, k7, k8, -1> {
12670 return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
12671 get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t));
12675 #undef GMOCK_FIELD_TYPE_
12678 template <
class ArgsTuple,
int k0 = -1,
int k1 = -1,
int k2 = -1,
int k3 = -1,
12679 int k4 = -1,
int k5 = -1,
int k6 = -1,
int k7 = -1,
int k8 = -1,
12689 template <
typename InnerMatcher>
12710 *os <<
"are a tuple ";
12716 *os <<
"are a tuple ";
12723 return TupleFields<RawArgsTuple,
k0,
k1,
k2, k3, k4, k5, k6, k7, k8,
12724 k9>::GetSelectedFields(
args);
12729 *os <<
"whose fields (";
12730 const int indices[10] = {
k0,
k1,
k2, k3, k4, k5, k6, k7, k8, k9 };
12731 for (
int i = 0;
i < 10;
i++) {
12732 if (indices[
i] < 0)
12738 *os <<
"#" << indices[
i];
12748 template <
class InnerMatcher,
int k0 = -1,
int k1 = -1,
int k2 = -1,
12749 int k3 = -1,
int k4 = -1,
int k5 = -1,
int k6 = -1,
int k7 = -1,
12750 int k8 = -1,
int k9 = -1>
12756 template <
typename ArgsTuple>
12774 template <
typename M1>
12779 template <
typename M1,
typename M2>
12787 template <
typename M1,
typename M2,
typename M3>
12795 template <
typename M1,
typename M2,
typename M3,
typename M4>
12803 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5>
12811 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
12820 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
12821 typename M6,
typename M7>
12829 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
12830 typename M6,
typename M7,
typename M8>
12838 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
12839 typename M6,
typename M7,
typename M8,
typename M9>
12847 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
12848 typename M6,
typename M7,
typename M8,
typename M9,
typename M10>
12862 template <
typename M1>
12867 template <
typename M1,
typename M2>
12875 template <
typename M1,
typename M2,
typename M3>
12883 template <
typename M1,
typename M2,
typename M3,
typename M4>
12891 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5>
12899 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
12908 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
12909 typename M6,
typename M7>
12917 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
12918 typename M6,
typename M7,
typename M8>
12926 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
12927 typename M6,
typename M7,
typename M8,
typename M9>
12935 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
12936 typename M6,
typename M7,
typename M8,
typename M9,
typename M10>
12949 template <
typename InnerMatcher>
12955 template <
int k1,
typename InnerMatcher>
12956 inline internal::ArgsMatcher<InnerMatcher, k1>
12961 template <
int k1,
int k2,
typename InnerMatcher>
12962 inline internal::ArgsMatcher<InnerMatcher, k1, k2>
12967 template <
int k1,
int k2,
int k3,
typename InnerMatcher>
12968 inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3>
12973 template <
int k1,
int k2,
int k3,
int k4,
typename InnerMatcher>
12974 inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4>
12979 template <
int k1,
int k2,
int k3,
int k4,
int k5,
typename InnerMatcher>
12980 inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5>
12985 template <
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
typename InnerMatcher>
12986 inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6>
12991 template <
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
int k7,
12992 typename InnerMatcher>
12993 inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7>
12999 template <
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
int k7,
int k8,
13000 typename InnerMatcher>
13001 inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8>
13007 template <
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
int k7,
int k8,
13008 int k9,
typename InnerMatcher>
13009 inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9>
13015 template <
int k1,
int k2,
int k3,
int k4,
int k5,
int k6,
int k7,
int k8,
13016 int k9,
int k10,
typename InnerMatcher>
13017 inline internal::ArgsMatcher<InnerMatcher,
k1,
k2, k3, k4, k5, k6, k7, k8, k9,
13038 inline internal::ElementsAreMatcher<
13039 ::testing::tuple<> >
13041 typedef ::testing::tuple<>
Args;
13045 template <
typename T1>
13046 inline internal::ElementsAreMatcher<
13050 typedef ::testing::tuple<
13055 template <
typename T1,
typename T2>
13056 inline internal::ElementsAreMatcher<
13061 typedef ::testing::tuple<
13067 template <
typename T1,
typename T2,
typename T3>
13068 inline internal::ElementsAreMatcher<
13074 typedef ::testing::tuple<
13081 template <
typename T1,
typename T2,
typename T3,
typename T4>
13082 inline internal::ElementsAreMatcher<
13089 typedef ::testing::tuple<
13097 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
13098 inline internal::ElementsAreMatcher<
13107 typedef ::testing::tuple<
13116 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
13118 inline internal::ElementsAreMatcher<
13127 const T5& e5,
const T6& e6) {
13128 typedef ::testing::tuple<
13138 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
13139 typename T6,
typename T7>
13140 inline internal::ElementsAreMatcher<
13150 const T5& e5,
const T6& e6,
const T7& e7) {
13151 typedef ::testing::tuple<
13162 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
13163 typename T6,
typename T7,
typename T8>
13164 inline internal::ElementsAreMatcher<
13175 const T5& e5,
const T6& e6,
const T7& e7,
const T8& e8) {
13176 typedef ::testing::tuple<
13189 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
13190 typename T6,
typename T7,
typename T8,
typename T9>
13191 inline internal::ElementsAreMatcher<
13203 const T5& e5,
const T6& e6,
const T7& e7,
const T8& e8,
const T9& e9) {
13204 typedef ::testing::tuple<
13218 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
13219 typename T6,
typename T7,
typename T8,
typename T9,
typename T10>
13220 inline internal::ElementsAreMatcher<
13233 const T5& e5,
const T6& e6,
const T7& e7,
const T8& e8,
const T9& e9,
13235 typedef ::testing::tuple<
13253 inline internal::UnorderedElementsAreMatcher<
13254 ::testing::tuple<> >
13256 typedef ::testing::tuple<>
Args;
13260 template <
typename T1>
13261 inline internal::UnorderedElementsAreMatcher<
13265 typedef ::testing::tuple<
13270 template <
typename T1,
typename T2>
13271 inline internal::UnorderedElementsAreMatcher<
13276 typedef ::testing::tuple<
13282 template <
typename T1,
typename T2,
typename T3>
13283 inline internal::UnorderedElementsAreMatcher<
13289 typedef ::testing::tuple<
13296 template <
typename T1,
typename T2,
typename T3,
typename T4>
13297 inline internal::UnorderedElementsAreMatcher<
13304 typedef ::testing::tuple<
13312 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
13313 inline internal::UnorderedElementsAreMatcher<
13322 typedef ::testing::tuple<
13331 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
13333 inline internal::UnorderedElementsAreMatcher<
13342 const T5& e5,
const T6& e6) {
13343 typedef ::testing::tuple<
13354 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
13355 typename T6,
typename T7>
13356 inline internal::UnorderedElementsAreMatcher<
13366 const T5& e5,
const T6& e6,
const T7& e7) {
13367 typedef ::testing::tuple<
13379 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
13380 typename T6,
typename T7,
typename T8>
13381 inline internal::UnorderedElementsAreMatcher<
13392 const T5& e5,
const T6& e6,
const T7& e7,
const T8& e8) {
13393 typedef ::testing::tuple<
13406 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
13407 typename T6,
typename T7,
typename T8,
typename T9>
13408 inline internal::UnorderedElementsAreMatcher<
13420 const T5& e5,
const T6& e6,
const T7& e7,
const T8& e8,
const T9& e9) {
13421 typedef ::testing::tuple<
13435 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
13436 typename T6,
typename T7,
typename T8,
typename T9,
typename T10>
13437 inline internal::UnorderedElementsAreMatcher<
13450 const T5& e5,
const T6& e6,
const T7& e7,
const T8& e8,
const T9& e9,
13452 typedef ::testing::tuple<
13464 e6, e7, e8, e9, e10));
13470 template <
typename M1,
typename M2>
13478 template <
typename M1,
typename M2,
typename M3>
13486 template <
typename M1,
typename M2,
typename M3,
typename M4>
13494 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5>
13502 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
13505 AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
13511 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
13512 typename M6,
typename M7>
13514 AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
13520 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
13521 typename M6,
typename M7,
typename M8>
13523 AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
13529 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
13530 typename M6,
typename M7,
typename M8,
typename M9>
13532 AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
13539 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
13540 typename M6,
typename M7,
typename M8,
typename M9,
typename M10>
13541 inline typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
13543 AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
13553 template <
typename M1,
typename M2>
13561 template <
typename M1,
typename M2,
typename M3>
13569 template <
typename M1,
typename M2,
typename M3,
typename M4>
13577 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5>
13585 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
13588 AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
13594 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
13595 typename M6,
typename M7>
13597 AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
13603 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
13604 typename M6,
typename M7,
typename M8>
13606 AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
13612 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
13613 typename M6,
typename M7,
typename M8,
typename M9>
13615 AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
13622 template <
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
13623 typename M6,
typename M7,
typename M8,
typename M9,
typename M10>
13624 inline typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
13626 AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
13851 #define MATCHER(name, description)\
13852 class name##Matcher {\
13854 template <typename arg_type>\
13855 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
13859 virtual bool MatchAndExplain(\
13860 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
13861 virtual void DescribeTo(::std::ostream* gmock_os) const {\
13862 *gmock_os << FormatDescription(false);\
13864 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
13865 *gmock_os << FormatDescription(true);\
13868 ::testing::internal::string FormatDescription(bool negation) const {\
13869 const ::testing::internal::string gmock_description = (description);\
13870 if (!gmock_description.empty())\
13871 return gmock_description;\
13872 return ::testing::internal::FormatMatcherDescription(\
13874 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
13875 ::testing::tuple<>()));\
13877 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
13879 template <typename arg_type>\
13880 operator ::testing::Matcher<arg_type>() const {\
13881 return ::testing::Matcher<arg_type>(\
13882 new gmock_Impl<arg_type>());\
13887 GTEST_DISALLOW_ASSIGN_(name##Matcher);\
13889 inline name##Matcher name() {\
13890 return name##Matcher();\
13892 template <typename arg_type>\
13893 bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\
13895 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
13898 #define MATCHER_P(name, p0, description)\
13899 template <typename p0##_type>\
13900 class name##MatcherP {\
13902 template <typename arg_type>\
13903 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
13905 explicit gmock_Impl(p0##_type gmock_p0)\
13907 virtual bool MatchAndExplain(\
13908 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
13909 virtual void DescribeTo(::std::ostream* gmock_os) const {\
13910 *gmock_os << FormatDescription(false);\
13912 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
13913 *gmock_os << FormatDescription(true);\
13917 ::testing::internal::string FormatDescription(bool negation) const {\
13918 const ::testing::internal::string gmock_description = (description);\
13919 if (!gmock_description.empty())\
13920 return gmock_description;\
13921 return ::testing::internal::FormatMatcherDescription(\
13923 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
13924 ::testing::tuple<p0##_type>(p0)));\
13926 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
13928 template <typename arg_type>\
13929 operator ::testing::Matcher<arg_type>() const {\
13930 return ::testing::Matcher<arg_type>(\
13931 new gmock_Impl<arg_type>(p0));\
13933 explicit name##MatcherP(p0##_type gmock_p0) : p0(gmock_p0) {\
13937 GTEST_DISALLOW_ASSIGN_(name##MatcherP);\
13939 template <typename p0##_type>\
13940 inline name##MatcherP<p0##_type> name(p0##_type p0) {\
13941 return name##MatcherP<p0##_type>(p0);\
13943 template <typename p0##_type>\
13944 template <typename arg_type>\
13945 bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
13947 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
13950 #define MATCHER_P2(name, p0, p1, description)\
13951 template <typename p0##_type, typename p1##_type>\
13952 class name##MatcherP2 {\
13954 template <typename arg_type>\
13955 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
13957 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\
13958 : p0(gmock_p0), p1(gmock_p1) {}\
13959 virtual bool MatchAndExplain(\
13960 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
13961 virtual void DescribeTo(::std::ostream* gmock_os) const {\
13962 *gmock_os << FormatDescription(false);\
13964 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
13965 *gmock_os << FormatDescription(true);\
13970 ::testing::internal::string FormatDescription(bool negation) const {\
13971 const ::testing::internal::string gmock_description = (description);\
13972 if (!gmock_description.empty())\
13973 return gmock_description;\
13974 return ::testing::internal::FormatMatcherDescription(\
13976 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
13977 ::testing::tuple<p0##_type, p1##_type>(p0, p1)));\
13979 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
13981 template <typename arg_type>\
13982 operator ::testing::Matcher<arg_type>() const {\
13983 return ::testing::Matcher<arg_type>(\
13984 new gmock_Impl<arg_type>(p0, p1));\
13986 name##MatcherP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
13992 GTEST_DISALLOW_ASSIGN_(name##MatcherP2);\
13994 template <typename p0##_type, typename p1##_type>\
13995 inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \
13997 return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\
13999 template <typename p0##_type, typename p1##_type>\
14000 template <typename arg_type>\
14001 bool name##MatcherP2<p0##_type, \
14002 p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
14004 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
14007 #define MATCHER_P3(name, p0, p1, p2, description)\
14008 template <typename p0##_type, typename p1##_type, typename p2##_type>\
14009 class name##MatcherP3 {\
14011 template <typename arg_type>\
14012 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
14014 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\
14015 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
14016 virtual bool MatchAndExplain(\
14017 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
14018 virtual void DescribeTo(::std::ostream* gmock_os) const {\
14019 *gmock_os << FormatDescription(false);\
14021 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
14022 *gmock_os << FormatDescription(true);\
14028 ::testing::internal::string FormatDescription(bool negation) const {\
14029 const ::testing::internal::string gmock_description = (description);\
14030 if (!gmock_description.empty())\
14031 return gmock_description;\
14032 return ::testing::internal::FormatMatcherDescription(\
14034 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
14035 ::testing::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \
14038 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
14040 template <typename arg_type>\
14041 operator ::testing::Matcher<arg_type>() const {\
14042 return ::testing::Matcher<arg_type>(\
14043 new gmock_Impl<arg_type>(p0, p1, p2));\
14045 name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \
14046 p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {\
14052 GTEST_DISALLOW_ASSIGN_(name##MatcherP3);\
14054 template <typename p0##_type, typename p1##_type, typename p2##_type>\
14055 inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
14056 p1##_type p1, p2##_type p2) {\
14057 return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
14059 template <typename p0##_type, typename p1##_type, typename p2##_type>\
14060 template <typename arg_type>\
14061 bool name##MatcherP3<p0##_type, p1##_type, \
14062 p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
14064 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
14067 #define MATCHER_P4(name, p0, p1, p2, p3, description)\
14068 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14069 typename p3##_type>\
14070 class name##MatcherP4 {\
14072 template <typename arg_type>\
14073 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
14075 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
14076 p3##_type gmock_p3)\
14077 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3) {}\
14078 virtual bool MatchAndExplain(\
14079 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
14080 virtual void DescribeTo(::std::ostream* gmock_os) const {\
14081 *gmock_os << FormatDescription(false);\
14083 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
14084 *gmock_os << FormatDescription(true);\
14091 ::testing::internal::string FormatDescription(bool negation) const {\
14092 const ::testing::internal::string gmock_description = (description);\
14093 if (!gmock_description.empty())\
14094 return gmock_description;\
14095 return ::testing::internal::FormatMatcherDescription(\
14097 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
14098 ::testing::tuple<p0##_type, p1##_type, p2##_type, \
14099 p3##_type>(p0, p1, p2, p3)));\
14101 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
14103 template <typename arg_type>\
14104 operator ::testing::Matcher<arg_type>() const {\
14105 return ::testing::Matcher<arg_type>(\
14106 new gmock_Impl<arg_type>(p0, p1, p2, p3));\
14108 name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \
14109 p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \
14110 p2(gmock_p2), p3(gmock_p3) {\
14117 GTEST_DISALLOW_ASSIGN_(name##MatcherP4);\
14119 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14120 typename p3##_type>\
14121 inline name##MatcherP4<p0##_type, p1##_type, p2##_type, \
14122 p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
14124 return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
14127 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14128 typename p3##_type>\
14129 template <typename arg_type>\
14130 bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \
14131 p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
14133 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
14136 #define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\
14137 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14138 typename p3##_type, typename p4##_type>\
14139 class name##MatcherP5 {\
14141 template <typename arg_type>\
14142 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
14144 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
14145 p3##_type gmock_p3, p4##_type gmock_p4)\
14146 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
14148 virtual bool MatchAndExplain(\
14149 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
14150 virtual void DescribeTo(::std::ostream* gmock_os) const {\
14151 *gmock_os << FormatDescription(false);\
14153 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
14154 *gmock_os << FormatDescription(true);\
14162 ::testing::internal::string FormatDescription(bool negation) const {\
14163 const ::testing::internal::string gmock_description = (description);\
14164 if (!gmock_description.empty())\
14165 return gmock_description;\
14166 return ::testing::internal::FormatMatcherDescription(\
14168 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
14169 ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
14170 p4##_type>(p0, p1, p2, p3, p4)));\
14172 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
14174 template <typename arg_type>\
14175 operator ::testing::Matcher<arg_type>() const {\
14176 return ::testing::Matcher<arg_type>(\
14177 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\
14179 name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \
14180 p2##_type gmock_p2, p3##_type gmock_p3, \
14181 p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
14182 p3(gmock_p3), p4(gmock_p4) {\
14190 GTEST_DISALLOW_ASSIGN_(name##MatcherP5);\
14192 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14193 typename p3##_type, typename p4##_type>\
14194 inline name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
14195 p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
14197 return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
14198 p4##_type>(p0, p1, p2, p3, p4);\
14200 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14201 typename p3##_type, typename p4##_type>\
14202 template <typename arg_type>\
14203 bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
14204 p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
14206 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
14209 #define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\
14210 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14211 typename p3##_type, typename p4##_type, typename p5##_type>\
14212 class name##MatcherP6 {\
14214 template <typename arg_type>\
14215 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
14217 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
14218 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\
14219 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
14220 p4(gmock_p4), p5(gmock_p5) {}\
14221 virtual bool MatchAndExplain(\
14222 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
14223 virtual void DescribeTo(::std::ostream* gmock_os) const {\
14224 *gmock_os << FormatDescription(false);\
14226 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
14227 *gmock_os << FormatDescription(true);\
14236 ::testing::internal::string FormatDescription(bool negation) const {\
14237 const ::testing::internal::string gmock_description = (description);\
14238 if (!gmock_description.empty())\
14239 return gmock_description;\
14240 return ::testing::internal::FormatMatcherDescription(\
14242 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
14243 ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
14244 p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
14246 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
14248 template <typename arg_type>\
14249 operator ::testing::Matcher<arg_type>() const {\
14250 return ::testing::Matcher<arg_type>(\
14251 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\
14253 name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \
14254 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
14255 p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
14256 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {\
14265 GTEST_DISALLOW_ASSIGN_(name##MatcherP6);\
14267 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14268 typename p3##_type, typename p4##_type, typename p5##_type>\
14269 inline name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
14270 p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
14271 p3##_type p3, p4##_type p4, p5##_type p5) {\
14272 return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
14273 p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
14275 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14276 typename p3##_type, typename p4##_type, typename p5##_type>\
14277 template <typename arg_type>\
14278 bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
14279 p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
14281 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
14284 #define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\
14285 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14286 typename p3##_type, typename p4##_type, typename p5##_type, \
14287 typename p6##_type>\
14288 class name##MatcherP7 {\
14290 template <typename arg_type>\
14291 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
14293 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
14294 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
14295 p6##_type gmock_p6)\
14296 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
14297 p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\
14298 virtual bool MatchAndExplain(\
14299 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
14300 virtual void DescribeTo(::std::ostream* gmock_os) const {\
14301 *gmock_os << FormatDescription(false);\
14303 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
14304 *gmock_os << FormatDescription(true);\
14314 ::testing::internal::string FormatDescription(bool negation) const {\
14315 const ::testing::internal::string gmock_description = (description);\
14316 if (!gmock_description.empty())\
14317 return gmock_description;\
14318 return ::testing::internal::FormatMatcherDescription(\
14320 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
14321 ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
14322 p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
14325 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
14327 template <typename arg_type>\
14328 operator ::testing::Matcher<arg_type>() const {\
14329 return ::testing::Matcher<arg_type>(\
14330 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6));\
14332 name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \
14333 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
14334 p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \
14335 p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
14346 GTEST_DISALLOW_ASSIGN_(name##MatcherP7);\
14348 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14349 typename p3##_type, typename p4##_type, typename p5##_type, \
14350 typename p6##_type>\
14351 inline name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
14352 p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
14353 p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
14355 return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
14356 p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
14358 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14359 typename p3##_type, typename p4##_type, typename p5##_type, \
14360 typename p6##_type>\
14361 template <typename arg_type>\
14362 bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
14363 p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
14365 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
14368 #define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\
14369 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14370 typename p3##_type, typename p4##_type, typename p5##_type, \
14371 typename p6##_type, typename p7##_type>\
14372 class name##MatcherP8 {\
14374 template <typename arg_type>\
14375 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
14377 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
14378 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
14379 p6##_type gmock_p6, p7##_type gmock_p7)\
14380 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
14381 p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\
14382 virtual bool MatchAndExplain(\
14383 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
14384 virtual void DescribeTo(::std::ostream* gmock_os) const {\
14385 *gmock_os << FormatDescription(false);\
14387 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
14388 *gmock_os << FormatDescription(true);\
14399 ::testing::internal::string FormatDescription(bool negation) const {\
14400 const ::testing::internal::string gmock_description = (description);\
14401 if (!gmock_description.empty())\
14402 return gmock_description;\
14403 return ::testing::internal::FormatMatcherDescription(\
14405 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
14406 ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
14407 p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
14408 p3, p4, p5, p6, p7)));\
14410 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
14412 template <typename arg_type>\
14413 operator ::testing::Matcher<arg_type>() const {\
14414 return ::testing::Matcher<arg_type>(\
14415 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7));\
14417 name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \
14418 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
14419 p5##_type gmock_p5, p6##_type gmock_p6, \
14420 p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
14421 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
14433 GTEST_DISALLOW_ASSIGN_(name##MatcherP8);\
14435 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14436 typename p3##_type, typename p4##_type, typename p5##_type, \
14437 typename p6##_type, typename p7##_type>\
14438 inline name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
14439 p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
14440 p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
14441 p6##_type p6, p7##_type p7) {\
14442 return name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
14443 p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
14446 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14447 typename p3##_type, typename p4##_type, typename p5##_type, \
14448 typename p6##_type, typename p7##_type>\
14449 template <typename arg_type>\
14450 bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
14451 p5##_type, p6##_type, \
14452 p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
14454 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
14457 #define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\
14458 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14459 typename p3##_type, typename p4##_type, typename p5##_type, \
14460 typename p6##_type, typename p7##_type, typename p8##_type>\
14461 class name##MatcherP9 {\
14463 template <typename arg_type>\
14464 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
14466 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
14467 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
14468 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\
14469 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
14470 p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
14472 virtual bool MatchAndExplain(\
14473 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
14474 virtual void DescribeTo(::std::ostream* gmock_os) const {\
14475 *gmock_os << FormatDescription(false);\
14477 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
14478 *gmock_os << FormatDescription(true);\
14490 ::testing::internal::string FormatDescription(bool negation) const {\
14491 const ::testing::internal::string gmock_description = (description);\
14492 if (!gmock_description.empty())\
14493 return gmock_description;\
14494 return ::testing::internal::FormatMatcherDescription(\
14496 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
14497 ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
14498 p4##_type, p5##_type, p6##_type, p7##_type, \
14499 p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
14501 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
14503 template <typename arg_type>\
14504 operator ::testing::Matcher<arg_type>() const {\
14505 return ::testing::Matcher<arg_type>(\
14506 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8));\
14508 name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \
14509 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
14510 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
14511 p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
14512 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
14525 GTEST_DISALLOW_ASSIGN_(name##MatcherP9);\
14527 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14528 typename p3##_type, typename p4##_type, typename p5##_type, \
14529 typename p6##_type, typename p7##_type, typename p8##_type>\
14530 inline name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
14531 p4##_type, p5##_type, p6##_type, p7##_type, \
14532 p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
14533 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
14535 return name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
14536 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
14537 p3, p4, p5, p6, p7, p8);\
14539 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14540 typename p3##_type, typename p4##_type, typename p5##_type, \
14541 typename p6##_type, typename p7##_type, typename p8##_type>\
14542 template <typename arg_type>\
14543 bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
14544 p5##_type, p6##_type, p7##_type, \
14545 p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
14547 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
14550 #define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)\
14551 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14552 typename p3##_type, typename p4##_type, typename p5##_type, \
14553 typename p6##_type, typename p7##_type, typename p8##_type, \
14554 typename p9##_type>\
14555 class name##MatcherP10 {\
14557 template <typename arg_type>\
14558 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
14560 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
14561 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
14562 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
14563 p9##_type gmock_p9)\
14564 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
14565 p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
14566 p8(gmock_p8), p9(gmock_p9) {}\
14567 virtual bool MatchAndExplain(\
14568 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
14569 virtual void DescribeTo(::std::ostream* gmock_os) const {\
14570 *gmock_os << FormatDescription(false);\
14572 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
14573 *gmock_os << FormatDescription(true);\
14586 ::testing::internal::string FormatDescription(bool negation) const {\
14587 const ::testing::internal::string gmock_description = (description);\
14588 if (!gmock_description.empty())\
14589 return gmock_description;\
14590 return ::testing::internal::FormatMatcherDescription(\
14592 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
14593 ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
14594 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
14595 p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
14597 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
14599 template <typename arg_type>\
14600 operator ::testing::Matcher<arg_type>() const {\
14601 return ::testing::Matcher<arg_type>(\
14602 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9));\
14604 name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \
14605 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
14606 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
14607 p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \
14608 p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
14609 p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {\
14622 GTEST_DISALLOW_ASSIGN_(name##MatcherP10);\
14624 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14625 typename p3##_type, typename p4##_type, typename p5##_type, \
14626 typename p6##_type, typename p7##_type, typename p8##_type, \
14627 typename p9##_type>\
14628 inline name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
14629 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
14630 p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
14631 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
14633 return name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
14634 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
14635 p1, p2, p3, p4, p5, p6, p7, p8, p9);\
14637 template <typename p0##_type, typename p1##_type, typename p2##_type, \
14638 typename p3##_type, typename p4##_type, typename p5##_type, \
14639 typename p6##_type, typename p7##_type, typename p8##_type, \
14640 typename p9##_type>\
14641 template <typename arg_type>\
14642 bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
14643 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
14644 p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
14646 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
14649 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
14685 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
14686 #define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
14688 #include <algorithm>
14699 template <
typename FunctionImpl>
14707 template <
typename Result,
typename ArgumentTuple>
14719 template <
class Class,
typename MethodPtr>
14725 template <
typename Result,
typename ArgumentTuple>
14745 template<
typename InputIterator,
typename OutputIterator>
14747 InputIterator last,
14748 OutputIterator
output) {
14761 template <
typename FunctionImpl>
14763 FunctionImpl function_impl) {
14770 template <
class Class,
typename MethodPtr>
14772 Class* obj_ptr, MethodPtr method_ptr) {
14781 template <
typename InnerAction>
14782 inline internal::WithArgsAction<InnerAction>
14792 template <
int k,
typename InnerAction>
14793 inline internal::WithArgsAction<InnerAction, k>
14804 # pragma warning(push)
14805 # pragma warning(disable:4100)
14810 HAS_1_TEMPLATE_PARAMS(
int,
k),
14811 AND_0_VALUE_PARAMS()) {
14812 return ::testing::get<k>(
args);
14818 HAS_1_TEMPLATE_PARAMS(
int,
k),
14819 AND_1_VALUE_PARAMS(pointer)) {
14820 *pointer = ::testing::get<k>(
args);
14826 HAS_1_TEMPLATE_PARAMS(
int,
k),
14827 AND_1_VALUE_PARAMS(pointer)) {
14828 *pointer = *::testing::get<k>(
args);
14834 HAS_1_TEMPLATE_PARAMS(
int,
k),
14835 AND_1_VALUE_PARAMS(
value)) {
14841 SetArgReferee_must_be_used_with_a_reference_argument);
14851 HAS_1_TEMPLATE_PARAMS(
int,
k),
14852 AND_2_VALUE_PARAMS(
first, last)) {
14864 HAS_1_TEMPLATE_PARAMS(
int,
k),
14865 AND_0_VALUE_PARAMS()) {
14866 delete ::testing::get<k>(
args);
14874 #if GTEST_HAS_EXCEPTIONS
14878 # pragma warning(push) // Saves the current warning state.
14879 # pragma warning(disable:4702) // Temporarily disables warning 4702.
14883 # pragma warning(pop) // Restores the warning state.
14886 #endif // GTEST_HAS_EXCEPTIONS
14889 # pragma warning(pop)
14894 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
14933 #ifndef GMOCK_GMOCK_MORE_MATCHERS_H_
14934 #define GMOCK_GMOCK_MORE_MATCHERS_H_
14945 *result_listener <<
"whose size is " <<
arg.size();
14951 #endif // GMOCK_GMOCK_MORE_MATCHERS_H_
14978 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_H_