Widevine CDM Now Goes to Eleven
(This is a merge of http://go/wvgerrit/13980) Adding origins to Android is going to push the number of arguments to GenerateKeyRequest over the maximum allowed by gMock. This change increases the maximum to 11 in order to continue supporting us. Bug: 19771858 Change-Id: Id04609d70da194f1491573b1b4aa9c23a67b78ab
This commit is contained in:
@@ -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_
|
||||
|
||||
Reference in New Issue
Block a user