Merge "Widevine CDM Now Goes to Eleven"
This commit is contained in:
committed by
Android (Google) Code Review
commit
ac0e1cf07f
@@ -14,6 +14,11 @@ needs a different format of build script, and it needs to build against the OS'
|
||||
modified version of gTest, rather than the packaged version.
|
||||
|
||||
Local Modifications:
|
||||
--Thu Apr 3, 2015 (juce)--
|
||||
|
||||
Modified the Pump files to increase the maximum arity to 11, and ran Pump on
|
||||
them to regenerate the headers.
|
||||
|
||||
--Tue Jun 3, 2014 (joeyparrish)--
|
||||
|
||||
Removed DOS newlines for the sake of the git-to-piper bridge. Piper converts
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// This file was GENERATED by a script. DO NOT EDIT BY HAND!!!
|
||||
// This file was GENERATED by command:
|
||||
// pump.py gmock-generated-actions.h.pump
|
||||
// DO NOT EDIT BY HAND!!!
|
||||
|
||||
// Copyright 2007, Google Inc.
|
||||
// All rights reserved.
|
||||
@@ -282,6 +284,33 @@ class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
|
||||
}
|
||||
};
|
||||
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||
typename A5, typename A6, typename A7, typename A8, typename A9,
|
||||
typename A10, typename A11>
|
||||
class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
|
||||
A10, A11> > {
|
||||
public:
|
||||
template <typename Function>
|
||||
static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
|
||||
A5, A6, A7, A8, A9, A10, A11>& args) {
|
||||
using ::std::tr1::get;
|
||||
return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
|
||||
get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
|
||||
get<9>(args), get<10>(args));
|
||||
}
|
||||
|
||||
template <class Class, typename MethodPtr>
|
||||
static R InvokeMethod(Class* obj_ptr,
|
||||
MethodPtr method_ptr,
|
||||
const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
|
||||
A9, A10, A11>& args) {
|
||||
using ::std::tr1::get;
|
||||
return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
|
||||
get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args),
|
||||
get<8>(args), get<9>(args), get<10>(args));
|
||||
}
|
||||
};
|
||||
|
||||
// CallableHelper has static methods for invoking "callables",
|
||||
// i.e. function pointers and functors. It uses overloading to
|
||||
// provide a uniform interface for invoking different kinds of
|
||||
@@ -381,6 +410,15 @@ class CallableHelper {
|
||||
A7 a7, A8 a8, A9 a9, A10 a10) {
|
||||
return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
|
||||
}
|
||||
|
||||
// Calls a 11-ary callable.
|
||||
template <typename Function, typename A1, typename A2, typename A3,
|
||||
typename A4, typename A5, typename A6, typename A7, typename A8,
|
||||
typename A9, typename A10, typename A11>
|
||||
static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
|
||||
A7 a7, A8 a8, A9 a9, A10 a10, A11 a11) {
|
||||
return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
|
||||
}
|
||||
}; // class CallableHelper
|
||||
|
||||
// An INTERNAL macro for extracting the type of a tuple field. It's
|
||||
@@ -403,11 +441,11 @@ class CallableHelper {
|
||||
// returns ::std::tr1::tuple (2.5, true).
|
||||
//
|
||||
// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
|
||||
// in the range [0, 10]. Duplicates are allowed and they don't have
|
||||
// in the range [0, 11]. Duplicates are allowed and they don't have
|
||||
// to be in an ascending or descending order.
|
||||
|
||||
template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
|
||||
int k4, int k5, int k6, int k7, int k8, int k9, int k10>
|
||||
int k4, int k5, int k6, int k7, int k8, int k9, int k10, int k11>
|
||||
class SelectArgs {
|
||||
public:
|
||||
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
|
||||
@@ -415,19 +453,19 @@ class SelectArgs {
|
||||
GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
|
||||
GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
|
||||
GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9),
|
||||
GMOCK_FIELD_(ArgumentTuple, k10));
|
||||
GMOCK_FIELD_(ArgumentTuple, k10), GMOCK_FIELD_(ArgumentTuple, k11));
|
||||
typedef typename Function<type>::ArgumentTuple SelectedArgs;
|
||||
static SelectedArgs Select(const ArgumentTuple& args) {
|
||||
using ::std::tr1::get;
|
||||
return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
|
||||
get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
|
||||
get<k8>(args), get<k9>(args), get<k10>(args));
|
||||
get<k8>(args), get<k9>(args), get<k10>(args), get<k11>(args));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Result, typename ArgumentTuple>
|
||||
class SelectArgs<Result, ArgumentTuple,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef Result type();
|
||||
typedef typename Function<type>::ArgumentTuple SelectedArgs;
|
||||
@@ -439,7 +477,7 @@ class SelectArgs<Result, ArgumentTuple,
|
||||
|
||||
template <typename Result, typename ArgumentTuple, int k1>
|
||||
class SelectArgs<Result, ArgumentTuple,
|
||||
k1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
k1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1));
|
||||
typedef typename Function<type>::ArgumentTuple SelectedArgs;
|
||||
@@ -451,7 +489,7 @@ class SelectArgs<Result, ArgumentTuple,
|
||||
|
||||
template <typename Result, typename ArgumentTuple, int k1, int k2>
|
||||
class SelectArgs<Result, ArgumentTuple,
|
||||
k1, k2, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
k1, k2, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
|
||||
GMOCK_FIELD_(ArgumentTuple, k2));
|
||||
@@ -464,7 +502,7 @@ class SelectArgs<Result, ArgumentTuple,
|
||||
|
||||
template <typename Result, typename ArgumentTuple, int k1, int k2, int k3>
|
||||
class SelectArgs<Result, ArgumentTuple,
|
||||
k1, k2, k3, -1, -1, -1, -1, -1, -1, -1> {
|
||||
k1, k2, k3, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
|
||||
GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3));
|
||||
@@ -478,7 +516,7 @@ class SelectArgs<Result, ArgumentTuple,
|
||||
template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
|
||||
int k4>
|
||||
class SelectArgs<Result, ArgumentTuple,
|
||||
k1, k2, k3, k4, -1, -1, -1, -1, -1, -1> {
|
||||
k1, k2, k3, k4, -1, -1, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
|
||||
GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
|
||||
@@ -494,7 +532,7 @@ class SelectArgs<Result, ArgumentTuple,
|
||||
template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
|
||||
int k4, int k5>
|
||||
class SelectArgs<Result, ArgumentTuple,
|
||||
k1, k2, k3, k4, k5, -1, -1, -1, -1, -1> {
|
||||
k1, k2, k3, k4, k5, -1, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
|
||||
GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
|
||||
@@ -510,7 +548,7 @@ class SelectArgs<Result, ArgumentTuple,
|
||||
template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
|
||||
int k4, int k5, int k6>
|
||||
class SelectArgs<Result, ArgumentTuple,
|
||||
k1, k2, k3, k4, k5, k6, -1, -1, -1, -1> {
|
||||
k1, k2, k3, k4, k5, k6, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
|
||||
GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
|
||||
@@ -527,7 +565,7 @@ class SelectArgs<Result, ArgumentTuple,
|
||||
template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
|
||||
int k4, int k5, int k6, int k7>
|
||||
class SelectArgs<Result, ArgumentTuple,
|
||||
k1, k2, k3, k4, k5, k6, k7, -1, -1, -1> {
|
||||
k1, k2, k3, k4, k5, k6, k7, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
|
||||
GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
|
||||
@@ -544,7 +582,7 @@ class SelectArgs<Result, ArgumentTuple,
|
||||
template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
|
||||
int k4, int k5, int k6, int k7, int k8>
|
||||
class SelectArgs<Result, ArgumentTuple,
|
||||
k1, k2, k3, k4, k5, k6, k7, k8, -1, -1> {
|
||||
k1, k2, k3, k4, k5, k6, k7, k8, -1, -1, -1> {
|
||||
public:
|
||||
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
|
||||
GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
|
||||
@@ -563,7 +601,7 @@ class SelectArgs<Result, ArgumentTuple,
|
||||
template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
|
||||
int k4, int k5, int k6, int k7, int k8, int k9>
|
||||
class SelectArgs<Result, ArgumentTuple,
|
||||
k1, k2, k3, k4, k5, k6, k7, k8, k9, -1> {
|
||||
k1, k2, k3, k4, k5, k6, k7, k8, k9, -1, -1> {
|
||||
public:
|
||||
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
|
||||
GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
|
||||
@@ -579,12 +617,32 @@ class SelectArgs<Result, ArgumentTuple,
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
|
||||
int k4, int k5, int k6, int k7, int k8, int k9, int k10>
|
||||
class SelectArgs<Result, ArgumentTuple,
|
||||
k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, -1> {
|
||||
public:
|
||||
typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
|
||||
GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
|
||||
GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
|
||||
GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
|
||||
GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9),
|
||||
GMOCK_FIELD_(ArgumentTuple, k10));
|
||||
typedef typename Function<type>::ArgumentTuple SelectedArgs;
|
||||
static SelectedArgs Select(const ArgumentTuple& args) {
|
||||
using ::std::tr1::get;
|
||||
return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
|
||||
get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
|
||||
get<k8>(args), get<k9>(args), get<k10>(args));
|
||||
}
|
||||
};
|
||||
|
||||
#undef GMOCK_FIELD_
|
||||
|
||||
// Implements the WithArgs action.
|
||||
template <typename InnerAction, int k1 = -1, int k2 = -1, int k3 = -1,
|
||||
int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
|
||||
int k9 = -1, int k10 = -1>
|
||||
int k9 = -1, int k10 = -1, int k11 = -1>
|
||||
class WithArgsAction {
|
||||
public:
|
||||
explicit WithArgsAction(const InnerAction& action) : action_(action) {}
|
||||
@@ -603,12 +661,12 @@ class WithArgsAction {
|
||||
|
||||
virtual Result Perform(const ArgumentTuple& args) {
|
||||
return action_.Perform(SelectArgs<Result, ArgumentTuple, k1, k2, k3, k4,
|
||||
k5, k6, k7, k8, k9, k10>::Select(args));
|
||||
k5, k6, k7, k8, k9, k10, k11>::Select(args));
|
||||
}
|
||||
|
||||
private:
|
||||
typedef typename SelectArgs<Result, ArgumentTuple,
|
||||
k1, k2, k3, k4, k5, k6, k7, k8, k9, k10>::type InnerFunctionType;
|
||||
k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11>::type InnerFunctionType;
|
||||
|
||||
Action<InnerFunctionType> action_;
|
||||
};
|
||||
@@ -643,7 +701,7 @@ class ActionHelper {
|
||||
return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),
|
||||
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
|
||||
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
|
||||
ExcessiveArg());
|
||||
ExcessiveArg(), ExcessiveArg());
|
||||
}
|
||||
|
||||
template <typename A0>
|
||||
@@ -652,7 +710,7 @@ class ActionHelper {
|
||||
return impl->template gmock_PerformImpl<A0>(args, get<0>(args),
|
||||
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
|
||||
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
|
||||
ExcessiveArg());
|
||||
ExcessiveArg(), ExcessiveArg());
|
||||
}
|
||||
|
||||
template <typename A0, typename A1>
|
||||
@@ -661,7 +719,7 @@ class ActionHelper {
|
||||
return impl->template gmock_PerformImpl<A0, A1>(args, get<0>(args),
|
||||
get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
|
||||
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
|
||||
ExcessiveArg());
|
||||
ExcessiveArg(), ExcessiveArg());
|
||||
}
|
||||
|
||||
template <typename A0, typename A1, typename A2>
|
||||
@@ -670,7 +728,7 @@ class ActionHelper {
|
||||
return impl->template gmock_PerformImpl<A0, A1, A2>(args, get<0>(args),
|
||||
get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(),
|
||||
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
|
||||
ExcessiveArg());
|
||||
ExcessiveArg(), ExcessiveArg());
|
||||
}
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3>
|
||||
@@ -680,7 +738,7 @@ class ActionHelper {
|
||||
return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, get<0>(args),
|
||||
get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(),
|
||||
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
|
||||
ExcessiveArg());
|
||||
ExcessiveArg(), ExcessiveArg());
|
||||
}
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4>
|
||||
@@ -690,7 +748,7 @@ class ActionHelper {
|
||||
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(args,
|
||||
get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
|
||||
ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
|
||||
ExcessiveArg());
|
||||
ExcessiveArg(), ExcessiveArg());
|
||||
}
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4,
|
||||
@@ -701,7 +759,7 @@ class ActionHelper {
|
||||
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(args,
|
||||
get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
|
||||
get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
|
||||
ExcessiveArg());
|
||||
ExcessiveArg(), ExcessiveArg());
|
||||
}
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4,
|
||||
@@ -712,7 +770,7 @@ class ActionHelper {
|
||||
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(args,
|
||||
get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
|
||||
get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(),
|
||||
ExcessiveArg());
|
||||
ExcessiveArg(), ExcessiveArg());
|
||||
}
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4,
|
||||
@@ -723,7 +781,7 @@ class ActionHelper {
|
||||
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6,
|
||||
A7>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
|
||||
get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(),
|
||||
ExcessiveArg());
|
||||
ExcessiveArg(), ExcessiveArg());
|
||||
}
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4,
|
||||
@@ -734,7 +792,7 @@ class ActionHelper {
|
||||
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7,
|
||||
A8>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
|
||||
get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
|
||||
ExcessiveArg());
|
||||
ExcessiveArg(), ExcessiveArg());
|
||||
}
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4,
|
||||
@@ -745,7 +803,19 @@ class ActionHelper {
|
||||
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8,
|
||||
A9>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
|
||||
get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
|
||||
get<9>(args));
|
||||
get<9>(args), ExcessiveArg());
|
||||
}
|
||||
|
||||
template <typename A0, typename A1, typename A2, typename A3, typename A4,
|
||||
typename A5, typename A6, typename A7, typename A8, typename A9,
|
||||
typename A10>
|
||||
static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
|
||||
A5, A6, A7, A8, A9, A10>& args) {
|
||||
using ::std::tr1::get;
|
||||
return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8,
|
||||
A9, A10>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
|
||||
get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
|
||||
get<9>(args), get<10>(args));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -827,6 +897,15 @@ WithArgs(const InnerAction& action) {
|
||||
k9, k10>(action);
|
||||
}
|
||||
|
||||
template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
|
||||
int k9, int k10, int k11, typename InnerAction>
|
||||
inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
|
||||
k9, k10, k11>
|
||||
WithArgs(const InnerAction& action) {
|
||||
return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
|
||||
k9, k10, k11>(action);
|
||||
}
|
||||
|
||||
// Creates an action that does actions a1, a2, ..., sequentially in
|
||||
// each invocation.
|
||||
template <typename Action1, typename Action2>
|
||||
@@ -917,6 +996,20 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9, a10));
|
||||
}
|
||||
|
||||
template <typename Action1, typename Action2, typename Action3,
|
||||
typename Action4, typename Action5, typename Action6, typename Action7,
|
||||
typename Action8, typename Action9, typename Action10, typename Action11>
|
||||
inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
|
||||
internal::DoBothAction<Action3, internal::DoBothAction<Action4,
|
||||
internal::DoBothAction<Action5, internal::DoBothAction<Action6,
|
||||
internal::DoBothAction<Action7, internal::DoBothAction<Action8,
|
||||
internal::DoBothAction<Action9, internal::DoBothAction<Action10,
|
||||
Action11> > > > > > > > > >
|
||||
DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
Action7 a7, Action8 a8, Action9 a9, Action10 a10, Action11 a11) {
|
||||
return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9, a10, a11));
|
||||
}
|
||||
|
||||
} // namespace testing
|
||||
|
||||
// The ACTION* family of macros can be used in a namespace scope to
|
||||
@@ -968,7 +1061,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
|
||||
// of 'n'.
|
||||
//
|
||||
// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support
|
||||
// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P11 to support
|
||||
// multi-parameter actions.
|
||||
//
|
||||
// For the purpose of typing, you can view
|
||||
@@ -1027,7 +1120,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
arg6_type arg6 GTEST_ATTRIBUTE_UNUSED_, \
|
||||
arg7_type arg7 GTEST_ATTRIBUTE_UNUSED_, \
|
||||
arg8_type arg8 GTEST_ATTRIBUTE_UNUSED_, \
|
||||
arg9_type arg9 GTEST_ATTRIBUTE_UNUSED_
|
||||
arg9_type arg9 GTEST_ATTRIBUTE_UNUSED_, \
|
||||
arg10_type arg10 GTEST_ATTRIBUTE_UNUSED_
|
||||
|
||||
// Sometimes you want to give an action explicit template parameters
|
||||
// that cannot be inferred from its value parameters. ACTION() and
|
||||
@@ -1143,6 +1237,12 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \
|
||||
kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \
|
||||
kind6 name6, kind7 name7, kind8 name8, kind9 name9
|
||||
#define GMOCK_INTERNAL_DECL_HAS_11_TEMPLATE_PARAMS(kind0, name0, kind1, \
|
||||
name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
|
||||
name6, kind7, name7, kind8, name8, kind9, name9, kind10, \
|
||||
name10) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
|
||||
kind5 name5, kind6 name6, kind7 name7, kind8 name8, kind9 name9, \
|
||||
kind10 name10
|
||||
|
||||
// Lists the template parameters.
|
||||
#define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0
|
||||
@@ -1172,6 +1272,10 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
|
||||
name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \
|
||||
name3, name4, name5, name6, name7, name8, name9
|
||||
#define GMOCK_INTERNAL_LIST_HAS_11_TEMPLATE_PARAMS(kind0, name0, kind1, \
|
||||
name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
|
||||
name6, kind7, name7, kind8, name8, kind9, name9, kind10, name10) name0, \
|
||||
name1, name2, name3, name4, name5, name6, name7, name8, name9, name10
|
||||
|
||||
// Declares the types of value parameters.
|
||||
#define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
|
||||
@@ -1206,6 +1310,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
typename p2##_type, typename p3##_type, typename p4##_type, \
|
||||
typename p5##_type, typename p6##_type, typename p7##_type, \
|
||||
typename p8##_type, typename p9##_type
|
||||
#define GMOCK_INTERNAL_DECL_TYPE_AND_11_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
|
||||
p6, p7, p8, p9, p10) , typename p0##_type, typename p1##_type, \
|
||||
typename p2##_type, typename p3##_type, typename p4##_type, \
|
||||
typename p5##_type, typename p6##_type, typename p7##_type, \
|
||||
typename p8##_type, typename p9##_type, typename p10##_type
|
||||
|
||||
// Initializes the value parameters.
|
||||
#define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\
|
||||
@@ -1257,6 +1366,15 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
|
||||
p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
|
||||
p8(gmock_p8), p9(gmock_p9)
|
||||
#define GMOCK_INTERNAL_INIT_AND_11_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
|
||||
p7, p8, p9, p10)\
|
||||
(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
|
||||
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
|
||||
p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
|
||||
p9##_type gmock_p9, p10##_type gmock_p10) : p0(gmock_p0), \
|
||||
p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
|
||||
p6(gmock_p6), p7(gmock_p7), p8(gmock_p8), p9(gmock_p9), \
|
||||
p10(gmock_p10)
|
||||
|
||||
// Declares the fields for storing the value parameters.
|
||||
#define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
|
||||
@@ -1285,6 +1403,10 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
|
||||
p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \
|
||||
p9##_type p9;
|
||||
#define GMOCK_INTERNAL_DEFN_AND_11_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
|
||||
p7, p8, p9, p10) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
|
||||
p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \
|
||||
p9##_type p9; p10##_type p10;
|
||||
|
||||
// Lists the value parameters.
|
||||
#define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
|
||||
@@ -1304,6 +1426,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8
|
||||
#define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
|
||||
p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9
|
||||
#define GMOCK_INTERNAL_LIST_AND_11_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
|
||||
p7, p8, p9, p10) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10
|
||||
|
||||
// Lists the value parameter types.
|
||||
#define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
|
||||
@@ -1330,6 +1454,10 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
#define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
|
||||
p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
|
||||
p5##_type, p6##_type, p7##_type, p8##_type, p9##_type
|
||||
#define GMOCK_INTERNAL_LIST_TYPE_AND_11_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
|
||||
p6, p7, p8, p9, p10) , p0##_type, p1##_type, p2##_type, p3##_type, \
|
||||
p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type, \
|
||||
p10##_type
|
||||
|
||||
// Declares the value parameters.
|
||||
#define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
|
||||
@@ -1358,6 +1486,10 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
|
||||
p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
|
||||
p9##_type p9
|
||||
#define GMOCK_INTERNAL_DECL_AND_11_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
|
||||
p7, p8, p9, p10) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
|
||||
p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
|
||||
p9##_type p9, p10##_type p10
|
||||
|
||||
// The suffix of the class template implementing the action template.
|
||||
#define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
|
||||
@@ -1374,6 +1506,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
p7, p8) P9
|
||||
#define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
|
||||
p7, p8, p9) P10
|
||||
#define GMOCK_INTERNAL_COUNT_AND_11_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
|
||||
p7, p8, p9, p10) P11
|
||||
|
||||
// The name of the class template implementing the action template.
|
||||
#define GMOCK_ACTION_CLASS_(name, value_params)\
|
||||
@@ -1401,11 +1535,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9) const;\
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
GMOCK_INTERNAL_DEFN_##value_params\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
@@ -1435,7 +1569,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
GMOCK_ACTION_CLASS_(name, value_params)<\
|
||||
GMOCK_INTERNAL_LIST_##template_params\
|
||||
@@ -1462,11 +1596,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9) const;\
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
@@ -1483,7 +1617,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
name##Action::gmock_Impl<F>::gmock_PerformImpl(\
|
||||
GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
|
||||
@@ -1508,11 +1642,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9) const;\
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
p0##_type p0;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
@@ -1533,7 +1667,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
name##ActionP<p0##_type>::gmock_Impl<F>::gmock_PerformImpl(\
|
||||
GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
|
||||
@@ -1560,11 +1694,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9) const;\
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
private:\
|
||||
@@ -1588,7 +1722,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
name##ActionP2<p0##_type, p1##_type>::gmock_Impl<F>::gmock_PerformImpl(\
|
||||
GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
|
||||
@@ -1615,11 +1749,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9) const;\
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
@@ -1645,7 +1779,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
name##ActionP3<p0##_type, p1##_type, \
|
||||
p2##_type>::gmock_Impl<F>::gmock_PerformImpl(\
|
||||
@@ -1676,11 +1810,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9) const;\
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
@@ -1712,7 +1846,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
name##ActionP4<p0##_type, p1##_type, p2##_type, \
|
||||
p3##_type>::gmock_Impl<F>::gmock_PerformImpl(\
|
||||
@@ -1744,11 +1878,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9) const;\
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
@@ -1782,7 +1916,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
|
||||
p4##_type>::gmock_Impl<F>::gmock_PerformImpl(\
|
||||
@@ -1815,11 +1949,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9) const;\
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
@@ -1855,7 +1989,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
|
||||
p5##_type>::gmock_Impl<F>::gmock_PerformImpl(\
|
||||
@@ -1890,11 +2024,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9) const;\
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
@@ -1936,7 +2070,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
|
||||
p5##_type, p6##_type>::gmock_Impl<F>::gmock_PerformImpl(\
|
||||
@@ -1973,11 +2107,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9) const;\
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
@@ -2022,7 +2156,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
|
||||
p5##_type, p6##_type, \
|
||||
@@ -2061,11 +2195,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9) const;\
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
@@ -2113,7 +2247,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
|
||||
p5##_type, p6##_type, p7##_type, \
|
||||
@@ -2153,11 +2287,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9) const;\
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
@@ -2209,13 +2343,113 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
|
||||
p5##_type, p6##_type, p7##_type, p8##_type, \
|
||||
p9##_type>::gmock_Impl<F>::gmock_PerformImpl(\
|
||||
GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
|
||||
|
||||
#define ACTION_P11(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type, typename p4##_type, typename p5##_type, \
|
||||
typename p6##_type, typename p7##_type, typename p8##_type, \
|
||||
typename p9##_type, typename p10##_type>\
|
||||
class name##ActionP11 {\
|
||||
public:\
|
||||
name##ActionP11(p0##_type gmock_p0, p1##_type gmock_p1, \
|
||||
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
|
||||
p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
|
||||
p8##_type gmock_p8, p9##_type gmock_p9, \
|
||||
p10##_type gmock_p10) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
|
||||
p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
|
||||
p8(gmock_p8), p9(gmock_p9), p10(gmock_p10) {}\
|
||||
template <typename F>\
|
||||
class gmock_Impl : public ::testing::ActionInterface<F> {\
|
||||
public:\
|
||||
typedef F function_type;\
|
||||
typedef typename ::testing::internal::Function<F>::Result return_type;\
|
||||
typedef typename ::testing::internal::Function<F>::ArgumentTuple\
|
||||
args_type;\
|
||||
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
|
||||
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
|
||||
p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
|
||||
p9##_type gmock_p9, p10##_type gmock_p10) : p0(gmock_p0), \
|
||||
p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), \
|
||||
p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), p8(gmock_p8), \
|
||||
p9(gmock_p9), p10(gmock_p10) {}\
|
||||
virtual return_type Perform(const args_type& args) {\
|
||||
return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
|
||||
Perform(this, args);\
|
||||
}\
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type, typename arg10_type>\
|
||||
return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
|
||||
arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
|
||||
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
|
||||
arg9_type arg9, arg10_type arg10) const;\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p6##_type p6;\
|
||||
p7##_type p7;\
|
||||
p8##_type p8;\
|
||||
p9##_type p9;\
|
||||
p10##_type p10;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename F> operator ::testing::Action<F>() const {\
|
||||
return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
|
||||
p6, p7, p8, p9, p10));\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p6##_type p6;\
|
||||
p7##_type p7;\
|
||||
p8##_type p8;\
|
||||
p9##_type p9;\
|
||||
p10##_type p10;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##ActionP11);\
|
||||
};\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type, typename p4##_type, typename p5##_type, \
|
||||
typename p6##_type, typename p7##_type, typename p8##_type, \
|
||||
typename p9##_type, typename p10##_type>\
|
||||
inline name##ActionP11<p0##_type, p1##_type, p2##_type, p3##_type, \
|
||||
p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type, \
|
||||
p10##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
|
||||
p3##_type p3, p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
|
||||
p8##_type p8, p9##_type p9, p10##_type p10) {\
|
||||
return name##ActionP11<p0##_type, p1##_type, p2##_type, p3##_type, \
|
||||
p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type, \
|
||||
p10##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);\
|
||||
}\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type, typename p4##_type, typename p5##_type, \
|
||||
typename p6##_type, typename p7##_type, typename p8##_type, \
|
||||
typename p9##_type, typename p10##_type>\
|
||||
template <typename F>\
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
name##ActionP11<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
|
||||
p5##_type, p6##_type, p7##_type, p8##_type, p9##_type, \
|
||||
p10##_type>::gmock_Impl<F>::gmock_PerformImpl(\
|
||||
GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
|
||||
|
||||
namespace testing {
|
||||
|
||||
// The ACTION*() macros trigger warning C4100 (unreferenced formal
|
||||
@@ -2335,6 +2569,14 @@ ACTION_TEMPLATE(InvokeArgument,
|
||||
::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
|
||||
}
|
||||
|
||||
ACTION_TEMPLATE(InvokeArgument,
|
||||
HAS_1_TEMPLATE_PARAMS(int, k),
|
||||
AND_11_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,
|
||||
p10)) {
|
||||
return internal::CallableHelper<return_type>::Call(
|
||||
::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
|
||||
}
|
||||
|
||||
// Various overloads for ReturnNew<T>().
|
||||
//
|
||||
// The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
|
||||
@@ -2406,6 +2648,13 @@ ACTION_TEMPLATE(ReturnNew,
|
||||
return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
|
||||
}
|
||||
|
||||
ACTION_TEMPLATE(ReturnNew,
|
||||
HAS_1_TEMPLATE_PARAMS(typename, T),
|
||||
AND_11_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9,
|
||||
p10)) {
|
||||
return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@ $$ -*- mode: c++; -*-
|
||||
$$ This is a Pump source file. Please use Pump to convert it to
|
||||
$$ gmock-generated-actions.h.
|
||||
$$
|
||||
$var n = 10 $$ The maximum arity we support.
|
||||
$var n = 11 $$ The maximum arity we support.
|
||||
$$}} This meta comment fixes auto-indentation in editors.
|
||||
// Copyright 2007, Google Inc.
|
||||
// All rights reserved.
|
||||
@@ -659,7 +659,7 @@ $for k [[, arg$k[[]]_type arg$k]]) const;\
|
||||
template <typename arg0_type, typename arg1_type, typename arg2_type, \
|
||||
typename arg3_type, typename arg4_type, typename arg5_type, \
|
||||
typename arg6_type, typename arg7_type, typename arg8_type, \
|
||||
typename arg9_type>\
|
||||
typename arg9_type, typename arg10_type>\
|
||||
typename ::testing::internal::Function<F>::Result\
|
||||
GMOCK_ACTION_CLASS_(name, value_params)<\
|
||||
GMOCK_INTERNAL_LIST_##template_params\
|
||||
|
||||
@@ -317,6 +317,37 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
|
||||
}
|
||||
};
|
||||
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||
typename A5, typename A6, typename A7, typename A8, typename A9,
|
||||
typename A10, typename A11>
|
||||
class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> : public
|
||||
internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10,
|
||||
A11)> {
|
||||
public:
|
||||
typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11);
|
||||
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
|
||||
|
||||
MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
|
||||
const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
|
||||
const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
|
||||
const Matcher<A9>& m9, const Matcher<A10>& m10,
|
||||
const Matcher<A11>& m11) {
|
||||
this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
|
||||
m6, m7, m8, m9, m10, m11));
|
||||
return this->current_spec();
|
||||
}
|
||||
|
||||
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
|
||||
A10 a10, A11 a11) {
|
||||
// Even though gcc and MSVC don't enforce it, 'this->' is required
|
||||
// by the C++ standard [14.6.4] here, as the base class type is
|
||||
// dependent on the template argument (and thus shouldn't be
|
||||
// looked into when resolving InvokeWith).
|
||||
return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9,
|
||||
a10, a11));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
// The style guide prohibits "using" statements in a namespace scope
|
||||
@@ -669,6 +700,50 @@ using internal::FunctionMocker;
|
||||
mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \
|
||||
Method)
|
||||
|
||||
// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
|
||||
#define GMOCK_METHOD11_(tn, constness, ct, Method, ...) \
|
||||
GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
|
||||
GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
|
||||
GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
|
||||
GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
|
||||
GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
|
||||
GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
|
||||
GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
|
||||
GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
|
||||
GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
|
||||
GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
|
||||
GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10, \
|
||||
GMOCK_ARG_(tn, 11, __VA_ARGS__) gmock_a11) constness { \
|
||||
GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \
|
||||
tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
|
||||
== 11), \
|
||||
this_method_does_not_take_11_arguments); \
|
||||
GMOCK_MOCKER_(11, constness, Method).SetOwnerAndName(this, #Method); \
|
||||
return GMOCK_MOCKER_(11, constness, Method).Invoke(gmock_a1, gmock_a2, \
|
||||
gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
|
||||
gmock_a10, gmock_a11); \
|
||||
} \
|
||||
::testing::MockSpec<__VA_ARGS__>& \
|
||||
gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
|
||||
GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
|
||||
GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
|
||||
GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
|
||||
GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
|
||||
GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
|
||||
GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
|
||||
GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
|
||||
GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \
|
||||
GMOCK_MATCHER_(tn, 10, __VA_ARGS__) gmock_a10, \
|
||||
GMOCK_MATCHER_(tn, 11, \
|
||||
__VA_ARGS__) gmock_a11) constness { \
|
||||
GMOCK_MOCKER_(11, constness, Method).RegisterOwner(this); \
|
||||
return GMOCK_MOCKER_(11, constness, Method).With(gmock_a1, gmock_a2, \
|
||||
gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
|
||||
gmock_a10, gmock_a11); \
|
||||
} \
|
||||
mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(11, constness, \
|
||||
Method)
|
||||
|
||||
#define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__)
|
||||
#define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__)
|
||||
#define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)
|
||||
@@ -680,6 +755,7 @@ using internal::FunctionMocker;
|
||||
#define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__)
|
||||
#define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__)
|
||||
#define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__)
|
||||
#define MOCK_METHOD11(m, ...) GMOCK_METHOD11_(, , , m, __VA_ARGS__)
|
||||
|
||||
#define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__)
|
||||
#define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__)
|
||||
@@ -692,6 +768,7 @@ using internal::FunctionMocker;
|
||||
#define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__)
|
||||
#define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__)
|
||||
#define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__)
|
||||
#define MOCK_CONST_METHOD11(m, ...) GMOCK_METHOD11_(, const, , m, __VA_ARGS__)
|
||||
|
||||
#define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__)
|
||||
#define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__)
|
||||
@@ -704,6 +781,7 @@ using internal::FunctionMocker;
|
||||
#define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__)
|
||||
#define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__)
|
||||
#define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__)
|
||||
#define MOCK_METHOD11_T(m, ...) GMOCK_METHOD11_(typename, , , m, __VA_ARGS__)
|
||||
|
||||
#define MOCK_CONST_METHOD0_T(m, ...) \
|
||||
GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__)
|
||||
@@ -727,6 +805,8 @@ using internal::FunctionMocker;
|
||||
GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__)
|
||||
#define MOCK_CONST_METHOD10_T(m, ...) \
|
||||
GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__)
|
||||
#define MOCK_CONST_METHOD11_T(m, ...) \
|
||||
GMOCK_METHOD11_(typename, const, , m, __VA_ARGS__)
|
||||
|
||||
#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \
|
||||
GMOCK_METHOD0_(, , ct, m, __VA_ARGS__)
|
||||
@@ -750,6 +830,8 @@ using internal::FunctionMocker;
|
||||
GMOCK_METHOD9_(, , ct, m, __VA_ARGS__)
|
||||
#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \
|
||||
GMOCK_METHOD10_(, , ct, m, __VA_ARGS__)
|
||||
#define MOCK_METHOD11_WITH_CALLTYPE(ct, m, ...) \
|
||||
GMOCK_METHOD11_(, , ct, m, __VA_ARGS__)
|
||||
|
||||
#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \
|
||||
GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__)
|
||||
@@ -773,6 +855,8 @@ using internal::FunctionMocker;
|
||||
GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__)
|
||||
#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \
|
||||
GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__)
|
||||
#define MOCK_CONST_METHOD11_WITH_CALLTYPE(ct, m, ...) \
|
||||
GMOCK_METHOD11_(, const, ct, m, __VA_ARGS__)
|
||||
|
||||
#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
|
||||
GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__)
|
||||
@@ -796,6 +880,8 @@ using internal::FunctionMocker;
|
||||
GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__)
|
||||
#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
|
||||
GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__)
|
||||
#define MOCK_METHOD11_T_WITH_CALLTYPE(ct, m, ...) \
|
||||
GMOCK_METHOD11_(typename, , ct, m, __VA_ARGS__)
|
||||
|
||||
#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
|
||||
GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__)
|
||||
@@ -819,6 +905,8 @@ using internal::FunctionMocker;
|
||||
GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__)
|
||||
#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
|
||||
GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__)
|
||||
#define MOCK_CONST_METHOD11_T_WITH_CALLTYPE(ct, m, ...) \
|
||||
GMOCK_METHOD11_(typename, const, ct, m, __VA_ARGS__)
|
||||
|
||||
// A MockFunction<F> class has one mock method whose type is F. It is
|
||||
// useful when you just want your test code to emit some messages and
|
||||
@@ -986,6 +1074,19 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
|
||||
GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
|
||||
};
|
||||
|
||||
template <typename R, typename A0, typename A1, typename A2, typename A3,
|
||||
typename A4, typename A5, typename A6, typename A7, typename A8,
|
||||
typename A9, typename A10>
|
||||
class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> {
|
||||
public:
|
||||
MockFunction() {}
|
||||
|
||||
MOCK_METHOD11_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10));
|
||||
|
||||
private:
|
||||
GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
|
||||
};
|
||||
|
||||
} // namespace testing
|
||||
|
||||
#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
|
||||
|
||||
@@ -2,7 +2,7 @@ $$ -*- mode: c++; -*-
|
||||
$$ This is a Pump source file. Please use Pump to convert it to
|
||||
$$ gmock-generated-function-mockers.h.
|
||||
$$
|
||||
$var n = 10 $$ The maximum arity we support.
|
||||
$var n = 11 $$ The maximum arity we support.
|
||||
// Copyright 2007, Google Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
|
||||
@@ -64,12 +64,12 @@ namespace internal {
|
||||
|
||||
template <class Tuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
|
||||
int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
|
||||
int k9 = -1>
|
||||
int k9 = -1, int k10 = -1>
|
||||
class TupleFields;
|
||||
|
||||
// This generic version is used when there are 10 selectors.
|
||||
// This generic version is used when there are 11 selectors.
|
||||
template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
|
||||
int k7, int k8, int k9>
|
||||
int k7, int k8, int k9, int k10>
|
||||
class TupleFields {
|
||||
public:
|
||||
typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
|
||||
@@ -77,18 +77,19 @@ class TupleFields {
|
||||
GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k9)> type;
|
||||
GMOCK_FIELD_TYPE_(Tuple, k9), GMOCK_FIELD_TYPE_(Tuple, k10)> type;
|
||||
static type GetSelectedFields(const Tuple& t) {
|
||||
using ::std::tr1::get;
|
||||
return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
|
||||
get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t));
|
||||
get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t),
|
||||
get<k10>(t));
|
||||
}
|
||||
};
|
||||
|
||||
// The following specialization is used for 0 ~ 9 selectors.
|
||||
// The following specialization is used for 0 ~ 10 selectors.
|
||||
|
||||
template <class Tuple>
|
||||
class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef ::std::tr1::tuple<> type;
|
||||
static type GetSelectedFields(const Tuple& /* t */) {
|
||||
@@ -98,7 +99,7 @@ class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
};
|
||||
|
||||
template <class Tuple, int k0>
|
||||
class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type;
|
||||
static type GetSelectedFields(const Tuple& t) {
|
||||
@@ -108,7 +109,7 @@ class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
};
|
||||
|
||||
template <class Tuple, int k0, int k1>
|
||||
class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k1)> type;
|
||||
@@ -119,7 +120,7 @@ class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
};
|
||||
|
||||
template <class Tuple, int k0, int k1, int k2>
|
||||
class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> {
|
||||
class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type;
|
||||
@@ -130,7 +131,7 @@ class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> {
|
||||
};
|
||||
|
||||
template <class Tuple, int k0, int k1, int k2, int k3>
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> {
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
|
||||
@@ -142,7 +143,7 @@ class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> {
|
||||
};
|
||||
|
||||
template <class Tuple, int k0, int k1, int k2, int k3, int k4>
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> {
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
|
||||
@@ -154,7 +155,7 @@ class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> {
|
||||
};
|
||||
|
||||
template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5>
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> {
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
|
||||
@@ -168,7 +169,7 @@ class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> {
|
||||
};
|
||||
|
||||
template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6>
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1> {
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1, -1> {
|
||||
public:
|
||||
typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
|
||||
@@ -183,7 +184,7 @@ class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1> {
|
||||
|
||||
template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
|
||||
int k7>
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> {
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1, -1> {
|
||||
public:
|
||||
typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
|
||||
@@ -199,7 +200,7 @@ class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> {
|
||||
|
||||
template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
|
||||
int k7, int k8>
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> {
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1, -1> {
|
||||
public:
|
||||
typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
|
||||
@@ -213,18 +214,35 @@ class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> {
|
||||
}
|
||||
};
|
||||
|
||||
template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
|
||||
int k7, int k8, int k9>
|
||||
class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, -1> {
|
||||
public:
|
||||
typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8),
|
||||
GMOCK_FIELD_TYPE_(Tuple, k9)> type;
|
||||
static type GetSelectedFields(const Tuple& t) {
|
||||
using ::std::tr1::get;
|
||||
return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
|
||||
get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t));
|
||||
}
|
||||
};
|
||||
|
||||
#undef GMOCK_FIELD_TYPE_
|
||||
|
||||
// Implements the Args() matcher.
|
||||
template <class ArgsTuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
|
||||
int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
|
||||
int k9 = -1>
|
||||
int k9 = -1, int k10 = -1>
|
||||
class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
|
||||
public:
|
||||
// ArgsTuple may have top-level const or reference modifiers.
|
||||
typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple;
|
||||
typedef typename internal::TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5,
|
||||
k6, k7, k8, k9>::type SelectedArgs;
|
||||
k6, k7, k8, k9, k10>::type SelectedArgs;
|
||||
typedef Matcher<const SelectedArgs&> MonomorphicInnerMatcher;
|
||||
|
||||
template <typename InnerMatcher>
|
||||
@@ -261,15 +279,15 @@ class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
|
||||
|
||||
private:
|
||||
static SelectedArgs GetSelectedArgs(ArgsTuple args) {
|
||||
return TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5, k6, k7, k8,
|
||||
k9>::GetSelectedFields(args);
|
||||
return TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, k9,
|
||||
k10>::GetSelectedFields(args);
|
||||
}
|
||||
|
||||
// Prints the indices of the selected fields.
|
||||
static void PrintIndices(::std::ostream* os) {
|
||||
*os << "whose fields (";
|
||||
const int indices[10] = { k0, k1, k2, k3, k4, k5, k6, k7, k8, k9 };
|
||||
for (int i = 0; i < 10; i++) {
|
||||
const int indices[11] = { k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10 };
|
||||
for (int i = 0; i < 11; i++) {
|
||||
if (indices[i] < 0)
|
||||
break;
|
||||
|
||||
@@ -288,7 +306,7 @@ class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
|
||||
|
||||
template <class InnerMatcher, int k0 = -1, int k1 = -1, int k2 = -1,
|
||||
int k3 = -1, int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1,
|
||||
int k8 = -1, int k9 = -1>
|
||||
int k8 = -1, int k9 = -1, int k10 = -1>
|
||||
class ArgsMatcher {
|
||||
public:
|
||||
explicit ArgsMatcher(const InnerMatcher& inner_matcher)
|
||||
@@ -297,7 +315,7 @@ class ArgsMatcher {
|
||||
template <typename ArgsTuple>
|
||||
operator Matcher<ArgsTuple>() const {
|
||||
return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, k0, k1, k2, k3, k4, k5,
|
||||
k6, k7, k8, k9>(inner_matcher_));
|
||||
k6, k7, k8, k9, k10>(inner_matcher_));
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -394,6 +412,16 @@ struct AllOfResult10 {
|
||||
> type;
|
||||
};
|
||||
|
||||
template <typename M1, typename M2, typename M3, typename M4, typename M5,
|
||||
typename M6, typename M7, typename M8, typename M9, typename M10,
|
||||
typename M11>
|
||||
struct AllOfResult11 {
|
||||
typedef BothOfMatcher<
|
||||
typename AllOfResult5<M1, M2, M3, M4, M5>::type,
|
||||
typename AllOfResult6<M6, M7, M8, M9, M10, M11>::type
|
||||
> type;
|
||||
};
|
||||
|
||||
// A set of metafunctions for computing the result type of AnyOf.
|
||||
// AnyOf(m1, ..., mN) returns
|
||||
// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.
|
||||
@@ -482,6 +510,16 @@ struct AnyOfResult10 {
|
||||
> type;
|
||||
};
|
||||
|
||||
template <typename M1, typename M2, typename M3, typename M4, typename M5,
|
||||
typename M6, typename M7, typename M8, typename M9, typename M10,
|
||||
typename M11>
|
||||
struct AnyOfResult11 {
|
||||
typedef EitherOfMatcher<
|
||||
typename AnyOfResult5<M1, M2, M3, M4, M5>::type,
|
||||
typename AnyOfResult6<M6, M7, M8, M9, M10, M11>::type
|
||||
> type;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
// Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
|
||||
@@ -562,11 +600,20 @@ Args(const InnerMatcher& matcher) {
|
||||
k9, k10>(matcher);
|
||||
}
|
||||
|
||||
template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
|
||||
int k9, int k10, int k11, typename InnerMatcher>
|
||||
inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9,
|
||||
k10, k11>
|
||||
Args(const InnerMatcher& matcher) {
|
||||
return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
|
||||
k9, k10, k11>(matcher);
|
||||
}
|
||||
|
||||
// ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with
|
||||
// n elements, where the i-th element in the container must
|
||||
// match the i-th argument in the list. Each argument of
|
||||
// ElementsAre() can be either a value or a matcher. We support up to
|
||||
// 10 arguments.
|
||||
// 11 arguments.
|
||||
//
|
||||
// The use of DecayArray in the implementation allows ElementsAre()
|
||||
// to accept string literals, whose type is const char[N], but we
|
||||
@@ -788,8 +835,43 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
|
||||
e8, e9, e10));
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
||||
typename T6, typename T7, typename T8, typename T9, typename T10,
|
||||
typename T11>
|
||||
inline internal::ElementsAreMatcher<
|
||||
std::tr1::tuple<
|
||||
typename internal::DecayArray<T1>::type,
|
||||
typename internal::DecayArray<T2>::type,
|
||||
typename internal::DecayArray<T3>::type,
|
||||
typename internal::DecayArray<T4>::type,
|
||||
typename internal::DecayArray<T5>::type,
|
||||
typename internal::DecayArray<T6>::type,
|
||||
typename internal::DecayArray<T7>::type,
|
||||
typename internal::DecayArray<T8>::type,
|
||||
typename internal::DecayArray<T9>::type,
|
||||
typename internal::DecayArray<T10>::type,
|
||||
typename internal::DecayArray<T11>::type> >
|
||||
ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
|
||||
const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,
|
||||
const T10& e10, const T11& e11) {
|
||||
typedef std::tr1::tuple<
|
||||
typename internal::DecayArray<T1>::type,
|
||||
typename internal::DecayArray<T2>::type,
|
||||
typename internal::DecayArray<T3>::type,
|
||||
typename internal::DecayArray<T4>::type,
|
||||
typename internal::DecayArray<T5>::type,
|
||||
typename internal::DecayArray<T6>::type,
|
||||
typename internal::DecayArray<T7>::type,
|
||||
typename internal::DecayArray<T8>::type,
|
||||
typename internal::DecayArray<T9>::type,
|
||||
typename internal::DecayArray<T10>::type,
|
||||
typename internal::DecayArray<T11>::type> Args;
|
||||
return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
|
||||
e8, e9, e10, e11));
|
||||
}
|
||||
|
||||
// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
|
||||
// that matches n elements in any order. We support up to n=10 arguments.
|
||||
// that matches n elements in any order. We support up to n=11 arguments.
|
||||
|
||||
inline internal::UnorderedElementsAreMatcher<
|
||||
std::tr1::tuple<> >
|
||||
@@ -1005,6 +1087,41 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
|
||||
e6, e7, e8, e9, e10));
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
||||
typename T6, typename T7, typename T8, typename T9, typename T10,
|
||||
typename T11>
|
||||
inline internal::UnorderedElementsAreMatcher<
|
||||
std::tr1::tuple<
|
||||
typename internal::DecayArray<T1>::type,
|
||||
typename internal::DecayArray<T2>::type,
|
||||
typename internal::DecayArray<T3>::type,
|
||||
typename internal::DecayArray<T4>::type,
|
||||
typename internal::DecayArray<T5>::type,
|
||||
typename internal::DecayArray<T6>::type,
|
||||
typename internal::DecayArray<T7>::type,
|
||||
typename internal::DecayArray<T8>::type,
|
||||
typename internal::DecayArray<T9>::type,
|
||||
typename internal::DecayArray<T10>::type,
|
||||
typename internal::DecayArray<T11>::type> >
|
||||
UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
|
||||
const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,
|
||||
const T10& e10, const T11& e11) {
|
||||
typedef std::tr1::tuple<
|
||||
typename internal::DecayArray<T1>::type,
|
||||
typename internal::DecayArray<T2>::type,
|
||||
typename internal::DecayArray<T3>::type,
|
||||
typename internal::DecayArray<T4>::type,
|
||||
typename internal::DecayArray<T5>::type,
|
||||
typename internal::DecayArray<T6>::type,
|
||||
typename internal::DecayArray<T7>::type,
|
||||
typename internal::DecayArray<T8>::type,
|
||||
typename internal::DecayArray<T9>::type,
|
||||
typename internal::DecayArray<T10>::type,
|
||||
typename internal::DecayArray<T11>::type> Args;
|
||||
return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
|
||||
e6, e7, e8, e9, e10, e11));
|
||||
}
|
||||
|
||||
// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
|
||||
// sub-matchers. AllOf is called fully qualified to prevent ADL from firing.
|
||||
|
||||
@@ -1088,6 +1205,19 @@ AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
::testing::AllOf(m6, m7, m8, m9, m10));
|
||||
}
|
||||
|
||||
template <typename M1, typename M2, typename M3, typename M4, typename M5,
|
||||
typename M6, typename M7, typename M8, typename M9, typename M10,
|
||||
typename M11>
|
||||
inline typename internal::AllOfResult11<M1, M2, M3, M4, M5, M6, M7, M8, M9,
|
||||
M10, M11>::type
|
||||
AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10,
|
||||
M11 m11) {
|
||||
return typename internal::AllOfResult11<M1, M2, M3, M4, M5, M6, M7, M8, M9,
|
||||
M10, M11>::type(
|
||||
::testing::AllOf(m1, m2, m3, m4, m5),
|
||||
::testing::AllOf(m6, m7, m8, m9, m10, m11));
|
||||
}
|
||||
|
||||
// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given
|
||||
// sub-matchers. AnyOf is called fully qualified to prevent ADL from firing.
|
||||
|
||||
@@ -1171,6 +1301,19 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
::testing::AnyOf(m6, m7, m8, m9, m10));
|
||||
}
|
||||
|
||||
template <typename M1, typename M2, typename M3, typename M4, typename M5,
|
||||
typename M6, typename M7, typename M8, typename M9, typename M10,
|
||||
typename M11>
|
||||
inline typename internal::AnyOfResult11<M1, M2, M3, M4, M5, M6, M7, M8, M9,
|
||||
M10, M11>::type
|
||||
AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10,
|
||||
M11 m11) {
|
||||
return typename internal::AnyOfResult11<M1, M2, M3, M4, M5, M6, M7, M8, M9,
|
||||
M10, M11>::type(
|
||||
::testing::AnyOf(m1, m2, m3, m4, m5),
|
||||
::testing::AnyOf(m6, m7, m8, m9, m10, m11));
|
||||
}
|
||||
|
||||
} // namespace testing
|
||||
|
||||
|
||||
@@ -1263,7 +1406,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
// body of MATCHER_P(HasAbsoluteValue, value) above, you can write
|
||||
// 'value_type' to refer to the type of 'value'.
|
||||
//
|
||||
// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to
|
||||
// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P11 to
|
||||
// support multi-parameter matchers.
|
||||
//
|
||||
// Describing Parameterized Matchers
|
||||
@@ -2187,4 +2330,109 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
#define MATCHER_P11(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, \
|
||||
description)\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type, typename p4##_type, typename p5##_type, \
|
||||
typename p6##_type, typename p7##_type, typename p8##_type, \
|
||||
typename p9##_type, typename p10##_type>\
|
||||
class name##MatcherP11 {\
|
||||
public:\
|
||||
template <typename arg_type>\
|
||||
class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
|
||||
public:\
|
||||
gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
|
||||
p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
|
||||
p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
|
||||
p9##_type gmock_p9, p10##_type gmock_p10)\
|
||||
: p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
|
||||
p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
|
||||
p8(gmock_p8), p9(gmock_p9), p10(gmock_p10) {}\
|
||||
virtual bool MatchAndExplain(\
|
||||
arg_type arg, ::testing::MatchResultListener* result_listener) const;\
|
||||
virtual void DescribeTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(false);\
|
||||
}\
|
||||
virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
|
||||
*gmock_os << FormatDescription(true);\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p6##_type p6;\
|
||||
p7##_type p7;\
|
||||
p8##_type p8;\
|
||||
p9##_type p9;\
|
||||
p10##_type p10;\
|
||||
private:\
|
||||
::testing::internal::string FormatDescription(bool negation) const {\
|
||||
const ::testing::internal::string gmock_description = (description);\
|
||||
if (!gmock_description.empty())\
|
||||
return gmock_description;\
|
||||
return ::testing::internal::FormatMatcherDescription(\
|
||||
negation, #name, \
|
||||
::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
|
||||
::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
|
||||
p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
|
||||
p9##_type, p10##_type>(p0, p1, p2, p3, p4, p5, p6, p7, \
|
||||
p8, p9, p10)));\
|
||||
}\
|
||||
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
|
||||
};\
|
||||
template <typename arg_type>\
|
||||
operator ::testing::Matcher<arg_type>() const {\
|
||||
return ::testing::Matcher<arg_type>(\
|
||||
new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, \
|
||||
p10));\
|
||||
}\
|
||||
name##MatcherP11(p0##_type gmock_p0, p1##_type gmock_p1, \
|
||||
p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
|
||||
p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
|
||||
p8##_type gmock_p8, p9##_type gmock_p9, \
|
||||
p10##_type gmock_p10) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
|
||||
p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
|
||||
p8(gmock_p8), p9(gmock_p9), p10(gmock_p10) {\
|
||||
}\
|
||||
p0##_type p0;\
|
||||
p1##_type p1;\
|
||||
p2##_type p2;\
|
||||
p3##_type p3;\
|
||||
p4##_type p4;\
|
||||
p5##_type p5;\
|
||||
p6##_type p6;\
|
||||
p7##_type p7;\
|
||||
p8##_type p8;\
|
||||
p9##_type p9;\
|
||||
p10##_type p10;\
|
||||
private:\
|
||||
GTEST_DISALLOW_ASSIGN_(name##MatcherP11);\
|
||||
};\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type, typename p4##_type, typename p5##_type, \
|
||||
typename p6##_type, typename p7##_type, typename p8##_type, \
|
||||
typename p9##_type, typename p10##_type>\
|
||||
inline name##MatcherP11<p0##_type, p1##_type, p2##_type, p3##_type, \
|
||||
p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type, \
|
||||
p10##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
|
||||
p3##_type p3, p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
|
||||
p8##_type p8, p9##_type p9, p10##_type p10) {\
|
||||
return name##MatcherP11<p0##_type, p1##_type, p2##_type, p3##_type, \
|
||||
p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type, \
|
||||
p10##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);\
|
||||
}\
|
||||
template <typename p0##_type, typename p1##_type, typename p2##_type, \
|
||||
typename p3##_type, typename p4##_type, typename p5##_type, \
|
||||
typename p6##_type, typename p7##_type, typename p8##_type, \
|
||||
typename p9##_type, typename p10##_type>\
|
||||
template <typename arg_type>\
|
||||
bool name##MatcherP11<p0##_type, p1##_type, p2##_type, p3##_type, \
|
||||
p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type, \
|
||||
p10##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
|
||||
arg_type arg, \
|
||||
::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
|
||||
const
|
||||
|
||||
#endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
|
||||
|
||||
@@ -2,7 +2,7 @@ $$ -*- mode: c++; -*-
|
||||
$$ This is a Pump source file. Please use Pump to convert it to
|
||||
$$ gmock-generated-actions.h.
|
||||
$$
|
||||
$var n = 10 $$ The maximum arity we support.
|
||||
$var n = 11 $$ The maximum arity we support.
|
||||
$$ }} This line fixes auto-indentation of the following code in Emacs.
|
||||
// Copyright 2008, Google Inc.
|
||||
// All rights reserved.
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
// NiceMock<MockFoo>.
|
||||
//
|
||||
// NiceMock, NaggyMock, and StrictMock "inherit" the constructors of
|
||||
// their respective base class, with up-to 10 arguments. Therefore
|
||||
// their respective base class, with up-to 11 arguments. Therefore
|
||||
// you can write NiceMock<MockFoo>(5, "a") to construct a nice mock
|
||||
// where MockFoo has a constructor that accepts (int, const char*),
|
||||
// for example.
|
||||
@@ -163,6 +163,17 @@ class NiceMock : public MockClass {
|
||||
internal::ImplicitCast_<MockClass*>(this));
|
||||
}
|
||||
|
||||
template <typename A1, typename A2, typename A3, typename A4, typename A5,
|
||||
typename A6, typename A7, typename A8, typename A9, typename A10,
|
||||
typename A11>
|
||||
NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
|
||||
const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,
|
||||
const A10& a10, const A11& a11) : MockClass(a1, a2, a3, a4, a5, a6, a7,
|
||||
a8, a9, a10, a11) {
|
||||
::testing::Mock::AllowUninterestingCalls(
|
||||
internal::ImplicitCast_<MockClass*>(this));
|
||||
}
|
||||
|
||||
virtual ~NiceMock() {
|
||||
::testing::Mock::UnregisterCallReaction(
|
||||
internal::ImplicitCast_<MockClass*>(this));
|
||||
@@ -259,6 +270,17 @@ class NaggyMock : public MockClass {
|
||||
internal::ImplicitCast_<MockClass*>(this));
|
||||
}
|
||||
|
||||
template <typename A1, typename A2, typename A3, typename A4, typename A5,
|
||||
typename A6, typename A7, typename A8, typename A9, typename A10,
|
||||
typename A11>
|
||||
NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
|
||||
const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,
|
||||
const A10& a10, const A11& a11) : MockClass(a1, a2, a3, a4, a5, a6, a7,
|
||||
a8, a9, a10, a11) {
|
||||
::testing::Mock::WarnUninterestingCalls(
|
||||
internal::ImplicitCast_<MockClass*>(this));
|
||||
}
|
||||
|
||||
virtual ~NaggyMock() {
|
||||
::testing::Mock::UnregisterCallReaction(
|
||||
internal::ImplicitCast_<MockClass*>(this));
|
||||
@@ -355,6 +377,17 @@ class StrictMock : public MockClass {
|
||||
internal::ImplicitCast_<MockClass*>(this));
|
||||
}
|
||||
|
||||
template <typename A1, typename A2, typename A3, typename A4, typename A5,
|
||||
typename A6, typename A7, typename A8, typename A9, typename A10,
|
||||
typename A11>
|
||||
StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
|
||||
const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,
|
||||
const A10& a10, const A11& a11) : MockClass(a1, a2, a3, a4, a5, a6, a7,
|
||||
a8, a9, a10, a11) {
|
||||
::testing::Mock::FailUninterestingCalls(
|
||||
internal::ImplicitCast_<MockClass*>(this));
|
||||
}
|
||||
|
||||
virtual ~StrictMock() {
|
||||
::testing::Mock::UnregisterCallReaction(
|
||||
internal::ImplicitCast_<MockClass*>(this));
|
||||
|
||||
@@ -2,7 +2,7 @@ $$ -*- mode: c++; -*-
|
||||
$$ This is a Pump source file. Please use Pump to convert it to
|
||||
$$ gmock-generated-nice-strict.h.
|
||||
$$
|
||||
$var n = 10 $$ The maximum arity we support.
|
||||
$var n = 11 $$ The maximum arity we support.
|
||||
// Copyright 2008, Google Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
|
||||
@@ -137,6 +137,16 @@ struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
|
||||
Matcher<A10> > type;
|
||||
};
|
||||
|
||||
template <typename A1, typename A2, typename A3, typename A4, typename A5,
|
||||
typename A6, typename A7, typename A8, typename A9, typename A10,
|
||||
typename A11>
|
||||
struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10,
|
||||
A11> > {
|
||||
typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
|
||||
Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9>,
|
||||
Matcher<A10>, Matcher<A11> > type;
|
||||
};
|
||||
|
||||
// Template struct Function<F>, where F must be a function type, contains
|
||||
// the following typedefs:
|
||||
//
|
||||
@@ -272,6 +282,20 @@ struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
|
||||
A9, A10);
|
||||
};
|
||||
|
||||
template <typename R, typename A1, typename A2, typename A3, typename A4,
|
||||
typename A5, typename A6, typename A7, typename A8, typename A9,
|
||||
typename A10, typename A11>
|
||||
struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)>
|
||||
: Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> {
|
||||
typedef A11 Argument11;
|
||||
typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10,
|
||||
A11> ArgumentTuple;
|
||||
typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
|
||||
typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11);
|
||||
typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
|
||||
A9, A10, A11);
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
} // namespace testing
|
||||
|
||||
@@ -2,7 +2,7 @@ $$ -*- mode: c++; -*-
|
||||
$$ This is a Pump source file. Please use Pump to convert it to
|
||||
$$ gmock-generated-function-mockers.h.
|
||||
$$
|
||||
$var n = 10 $$ The maximum arity we support.
|
||||
$var n = 11 $$ The maximum arity we support.
|
||||
// Copyright 2007, Google Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user