1 // This file was GENERATED by command:
2 // pump.py gmock-generated-matchers.h.pump
3 // DO NOT EDIT BY HAND!!!
5 // Copyright 2008, Google Inc.
6 // All rights reserved.
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions are
12 // * Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 // * Redistributions in binary form must reproduce the above
15 // copyright notice, this list of conditions and the following disclaimer
16 // in the documentation and/or other materials provided with the
18 // * Neither the name of Google Inc. nor the names of its
19 // contributors may be used to endorse or promote products derived from
20 // this software without specific prior written permission.
22 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 // Google Mock - a framework for writing C++ mock classes.
36 // This file implements some commonly used variadic matchers.
38 // IWYU pragma: private, include "gmock/gmock.h"
40 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
41 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
47 #include "gmock/gmock-matchers.h"
52 // The type of the i-th (0-based) field of Tuple.
53 #define GMOCK_FIELD_TYPE_(Tuple, i) \
54 typename ::testing::tuple_element<i, Tuple>::type
56 // TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
57 // tuple of type Tuple. It has two members:
59 // type: a tuple type whose i-th field is the ki-th field of Tuple.
60 // GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.
62 // For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:
64 // type is tuple<int, bool>, and
65 // GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).
67 template <class Tuple
, int k0
= -1, int k1
= -1, int k2
= -1, int k3
= -1,
68 int k4
= -1, int k5
= -1, int k6
= -1, int k7
= -1, int k8
= -1,
72 // This generic version is used when there are 10 selectors.
73 template <class Tuple
, int k0
, int k1
, int k2
, int k3
, int k4
, int k5
, int k6
,
74 int k7
, int k8
, int k9
>
77 typedef ::testing::tuple
<GMOCK_FIELD_TYPE_(Tuple
, k0
),
78 GMOCK_FIELD_TYPE_(Tuple
, k1
), GMOCK_FIELD_TYPE_(Tuple
, k2
),
79 GMOCK_FIELD_TYPE_(Tuple
, k3
), GMOCK_FIELD_TYPE_(Tuple
, k4
),
80 GMOCK_FIELD_TYPE_(Tuple
, k5
), GMOCK_FIELD_TYPE_(Tuple
, k6
),
81 GMOCK_FIELD_TYPE_(Tuple
, k7
), GMOCK_FIELD_TYPE_(Tuple
, k8
),
82 GMOCK_FIELD_TYPE_(Tuple
, k9
)> type
;
83 static type
GetSelectedFields(const Tuple
& t
) {
84 return type(get
<k0
>(t
), get
<k1
>(t
), get
<k2
>(t
), get
<k3
>(t
), get
<k4
>(t
),
85 get
<k5
>(t
), get
<k6
>(t
), get
<k7
>(t
), get
<k8
>(t
), get
<k9
>(t
));
89 // The following specialization is used for 0 ~ 9 selectors.
91 template <class Tuple
>
92 class TupleFields
<Tuple
, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
94 typedef ::testing::tuple
<> type
;
95 static type
GetSelectedFields(const Tuple
& /* t */) {
100 template <class Tuple
, int k0
>
101 class TupleFields
<Tuple
, k0
, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
103 typedef ::testing::tuple
<GMOCK_FIELD_TYPE_(Tuple
, k0
)> type
;
104 static type
GetSelectedFields(const Tuple
& t
) {
105 return type(get
<k0
>(t
));
109 template <class Tuple
, int k0
, int k1
>
110 class TupleFields
<Tuple
, k0
, k1
, -1, -1, -1, -1, -1, -1, -1, -1> {
112 typedef ::testing::tuple
<GMOCK_FIELD_TYPE_(Tuple
, k0
),
113 GMOCK_FIELD_TYPE_(Tuple
, k1
)> type
;
114 static type
GetSelectedFields(const Tuple
& t
) {
115 return type(get
<k0
>(t
), get
<k1
>(t
));
119 template <class Tuple
, int k0
, int k1
, int k2
>
120 class TupleFields
<Tuple
, k0
, k1
, k2
, -1, -1, -1, -1, -1, -1, -1> {
122 typedef ::testing::tuple
<GMOCK_FIELD_TYPE_(Tuple
, k0
),
123 GMOCK_FIELD_TYPE_(Tuple
, k1
), GMOCK_FIELD_TYPE_(Tuple
, k2
)> type
;
124 static type
GetSelectedFields(const Tuple
& t
) {
125 return type(get
<k0
>(t
), get
<k1
>(t
), get
<k2
>(t
));
129 template <class Tuple
, int k0
, int k1
, int k2
, int k3
>
130 class TupleFields
<Tuple
, k0
, k1
, k2
, k3
, -1, -1, -1, -1, -1, -1> {
132 typedef ::testing::tuple
<GMOCK_FIELD_TYPE_(Tuple
, k0
),
133 GMOCK_FIELD_TYPE_(Tuple
, k1
), GMOCK_FIELD_TYPE_(Tuple
, k2
),
134 GMOCK_FIELD_TYPE_(Tuple
, k3
)> type
;
135 static type
GetSelectedFields(const Tuple
& t
) {
136 return type(get
<k0
>(t
), get
<k1
>(t
), get
<k2
>(t
), get
<k3
>(t
));
140 template <class Tuple
, int k0
, int k1
, int k2
, int k3
, int k4
>
141 class TupleFields
<Tuple
, k0
, k1
, k2
, k3
, k4
, -1, -1, -1, -1, -1> {
143 typedef ::testing::tuple
<GMOCK_FIELD_TYPE_(Tuple
, k0
),
144 GMOCK_FIELD_TYPE_(Tuple
, k1
), GMOCK_FIELD_TYPE_(Tuple
, k2
),
145 GMOCK_FIELD_TYPE_(Tuple
, k3
), GMOCK_FIELD_TYPE_(Tuple
, k4
)> type
;
146 static type
GetSelectedFields(const Tuple
& t
) {
147 return type(get
<k0
>(t
), get
<k1
>(t
), get
<k2
>(t
), get
<k3
>(t
), get
<k4
>(t
));
151 template <class Tuple
, int k0
, int k1
, int k2
, int k3
, int k4
, int k5
>
152 class TupleFields
<Tuple
, k0
, k1
, k2
, k3
, k4
, k5
, -1, -1, -1, -1> {
154 typedef ::testing::tuple
<GMOCK_FIELD_TYPE_(Tuple
, k0
),
155 GMOCK_FIELD_TYPE_(Tuple
, k1
), GMOCK_FIELD_TYPE_(Tuple
, k2
),
156 GMOCK_FIELD_TYPE_(Tuple
, k3
), GMOCK_FIELD_TYPE_(Tuple
, k4
),
157 GMOCK_FIELD_TYPE_(Tuple
, k5
)> type
;
158 static type
GetSelectedFields(const Tuple
& t
) {
159 return type(get
<k0
>(t
), get
<k1
>(t
), get
<k2
>(t
), get
<k3
>(t
), get
<k4
>(t
),
164 template <class Tuple
, int k0
, int k1
, int k2
, int k3
, int k4
, int k5
, int k6
>
165 class TupleFields
<Tuple
, k0
, k1
, k2
, k3
, k4
, k5
, k6
, -1, -1, -1> {
167 typedef ::testing::tuple
<GMOCK_FIELD_TYPE_(Tuple
, k0
),
168 GMOCK_FIELD_TYPE_(Tuple
, k1
), GMOCK_FIELD_TYPE_(Tuple
, k2
),
169 GMOCK_FIELD_TYPE_(Tuple
, k3
), GMOCK_FIELD_TYPE_(Tuple
, k4
),
170 GMOCK_FIELD_TYPE_(Tuple
, k5
), GMOCK_FIELD_TYPE_(Tuple
, k6
)> type
;
171 static type
GetSelectedFields(const Tuple
& t
) {
172 return type(get
<k0
>(t
), get
<k1
>(t
), get
<k2
>(t
), get
<k3
>(t
), get
<k4
>(t
),
173 get
<k5
>(t
), get
<k6
>(t
));
177 template <class Tuple
, int k0
, int k1
, int k2
, int k3
, int k4
, int k5
, int k6
,
179 class TupleFields
<Tuple
, k0
, k1
, k2
, k3
, k4
, k5
, k6
, k7
, -1, -1> {
181 typedef ::testing::tuple
<GMOCK_FIELD_TYPE_(Tuple
, k0
),
182 GMOCK_FIELD_TYPE_(Tuple
, k1
), GMOCK_FIELD_TYPE_(Tuple
, k2
),
183 GMOCK_FIELD_TYPE_(Tuple
, k3
), GMOCK_FIELD_TYPE_(Tuple
, k4
),
184 GMOCK_FIELD_TYPE_(Tuple
, k5
), GMOCK_FIELD_TYPE_(Tuple
, k6
),
185 GMOCK_FIELD_TYPE_(Tuple
, k7
)> type
;
186 static type
GetSelectedFields(const Tuple
& t
) {
187 return type(get
<k0
>(t
), get
<k1
>(t
), get
<k2
>(t
), get
<k3
>(t
), get
<k4
>(t
),
188 get
<k5
>(t
), get
<k6
>(t
), get
<k7
>(t
));
192 template <class Tuple
, int k0
, int k1
, int k2
, int k3
, int k4
, int k5
, int k6
,
194 class TupleFields
<Tuple
, k0
, k1
, k2
, k3
, k4
, k5
, k6
, k7
, k8
, -1> {
196 typedef ::testing::tuple
<GMOCK_FIELD_TYPE_(Tuple
, k0
),
197 GMOCK_FIELD_TYPE_(Tuple
, k1
), GMOCK_FIELD_TYPE_(Tuple
, k2
),
198 GMOCK_FIELD_TYPE_(Tuple
, k3
), GMOCK_FIELD_TYPE_(Tuple
, k4
),
199 GMOCK_FIELD_TYPE_(Tuple
, k5
), GMOCK_FIELD_TYPE_(Tuple
, k6
),
200 GMOCK_FIELD_TYPE_(Tuple
, k7
), GMOCK_FIELD_TYPE_(Tuple
, k8
)> type
;
201 static type
GetSelectedFields(const Tuple
& t
) {
202 return type(get
<k0
>(t
), get
<k1
>(t
), get
<k2
>(t
), get
<k3
>(t
), get
<k4
>(t
),
203 get
<k5
>(t
), get
<k6
>(t
), get
<k7
>(t
), get
<k8
>(t
));
207 #undef GMOCK_FIELD_TYPE_
209 // Implements the Args() matcher.
210 template <class ArgsTuple
, int k0
= -1, int k1
= -1, int k2
= -1, int k3
= -1,
211 int k4
= -1, int k5
= -1, int k6
= -1, int k7
= -1, int k8
= -1,
213 class ArgsMatcherImpl
: public MatcherInterface
<ArgsTuple
> {
215 // ArgsTuple may have top-level const or reference modifiers.
216 typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple
) RawArgsTuple
;
217 typedef typename
internal::TupleFields
<RawArgsTuple
, k0
, k1
, k2
, k3
, k4
, k5
,
218 k6
, k7
, k8
, k9
>::type SelectedArgs
;
219 typedef Matcher
<const SelectedArgs
&> MonomorphicInnerMatcher
;
221 template <typename InnerMatcher
>
222 explicit ArgsMatcherImpl(const InnerMatcher
& inner_matcher
)
223 : inner_matcher_(SafeMatcherCast
<const SelectedArgs
&>(inner_matcher
)) {}
225 virtual bool MatchAndExplain(ArgsTuple args
,
226 MatchResultListener
* listener
) const {
227 const SelectedArgs
& selected_args
= GetSelectedArgs(args
);
228 if (!listener
->IsInterested())
229 return inner_matcher_
.Matches(selected_args
);
231 PrintIndices(listener
->stream());
232 *listener
<< "are " << PrintToString(selected_args
);
234 StringMatchResultListener inner_listener
;
235 const bool match
= inner_matcher_
.MatchAndExplain(selected_args
,
237 PrintIfNotEmpty(inner_listener
.str(), listener
->stream());
241 virtual void DescribeTo(::std::ostream
* os
) const {
242 *os
<< "are a tuple ";
244 inner_matcher_
.DescribeTo(os
);
247 virtual void DescribeNegationTo(::std::ostream
* os
) const {
248 *os
<< "are a tuple ";
250 inner_matcher_
.DescribeNegationTo(os
);
254 static SelectedArgs
GetSelectedArgs(ArgsTuple args
) {
255 return TupleFields
<RawArgsTuple
, k0
, k1
, k2
, k3
, k4
, k5
, k6
, k7
, k8
,
256 k9
>::GetSelectedFields(args
);
259 // Prints the indices of the selected fields.
260 static void PrintIndices(::std::ostream
* os
) {
261 *os
<< "whose fields (";
262 const int indices
[10] = { k0
, k1
, k2
, k3
, k4
, k5
, k6
, k7
, k8
, k9
};
263 for (int i
= 0; i
< 10; i
++) {
270 *os
<< "#" << indices
[i
];
275 const MonomorphicInnerMatcher inner_matcher_
;
277 GTEST_DISALLOW_ASSIGN_(ArgsMatcherImpl
);
280 template <class InnerMatcher
, int k0
= -1, int k1
= -1, int k2
= -1,
281 int k3
= -1, int k4
= -1, int k5
= -1, int k6
= -1, int k7
= -1,
282 int k8
= -1, int k9
= -1>
285 explicit ArgsMatcher(const InnerMatcher
& inner_matcher
)
286 : inner_matcher_(inner_matcher
) {}
288 template <typename ArgsTuple
>
289 operator Matcher
<ArgsTuple
>() const {
290 return MakeMatcher(new ArgsMatcherImpl
<ArgsTuple
, k0
, k1
, k2
, k3
, k4
, k5
,
291 k6
, k7
, k8
, k9
>(inner_matcher_
));
295 const InnerMatcher inner_matcher_
;
297 GTEST_DISALLOW_ASSIGN_(ArgsMatcher
);
300 // A set of metafunctions for computing the result type of AllOf.
301 // AllOf(m1, ..., mN) returns
302 // AllOfResultN<decltype(m1), ..., decltype(mN)>::type.
304 // Although AllOf isn't defined for one argument, AllOfResult1 is defined
305 // to simplify the implementation.
306 template <typename M1
>
307 struct AllOfResult1
{
311 template <typename M1
, typename M2
>
312 struct AllOfResult2
{
313 typedef BothOfMatcher
<
314 typename AllOfResult1
<M1
>::type
,
315 typename AllOfResult1
<M2
>::type
319 template <typename M1
, typename M2
, typename M3
>
320 struct AllOfResult3
{
321 typedef BothOfMatcher
<
322 typename AllOfResult1
<M1
>::type
,
323 typename AllOfResult2
<M2
, M3
>::type
327 template <typename M1
, typename M2
, typename M3
, typename M4
>
328 struct AllOfResult4
{
329 typedef BothOfMatcher
<
330 typename AllOfResult2
<M1
, M2
>::type
,
331 typename AllOfResult2
<M3
, M4
>::type
335 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
>
336 struct AllOfResult5
{
337 typedef BothOfMatcher
<
338 typename AllOfResult2
<M1
, M2
>::type
,
339 typename AllOfResult3
<M3
, M4
, M5
>::type
343 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
345 struct AllOfResult6
{
346 typedef BothOfMatcher
<
347 typename AllOfResult3
<M1
, M2
, M3
>::type
,
348 typename AllOfResult3
<M4
, M5
, M6
>::type
352 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
353 typename M6
, typename M7
>
354 struct AllOfResult7
{
355 typedef BothOfMatcher
<
356 typename AllOfResult3
<M1
, M2
, M3
>::type
,
357 typename AllOfResult4
<M4
, M5
, M6
, M7
>::type
361 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
362 typename M6
, typename M7
, typename M8
>
363 struct AllOfResult8
{
364 typedef BothOfMatcher
<
365 typename AllOfResult4
<M1
, M2
, M3
, M4
>::type
,
366 typename AllOfResult4
<M5
, M6
, M7
, M8
>::type
370 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
371 typename M6
, typename M7
, typename M8
, typename M9
>
372 struct AllOfResult9
{
373 typedef BothOfMatcher
<
374 typename AllOfResult4
<M1
, M2
, M3
, M4
>::type
,
375 typename AllOfResult5
<M5
, M6
, M7
, M8
, M9
>::type
379 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
380 typename M6
, typename M7
, typename M8
, typename M9
, typename M10
>
381 struct AllOfResult10
{
382 typedef BothOfMatcher
<
383 typename AllOfResult5
<M1
, M2
, M3
, M4
, M5
>::type
,
384 typename AllOfResult5
<M6
, M7
, M8
, M9
, M10
>::type
388 // A set of metafunctions for computing the result type of AnyOf.
389 // AnyOf(m1, ..., mN) returns
390 // AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.
392 // Although AnyOf isn't defined for one argument, AnyOfResult1 is defined
393 // to simplify the implementation.
394 template <typename M1
>
395 struct AnyOfResult1
{
399 template <typename M1
, typename M2
>
400 struct AnyOfResult2
{
401 typedef EitherOfMatcher
<
402 typename AnyOfResult1
<M1
>::type
,
403 typename AnyOfResult1
<M2
>::type
407 template <typename M1
, typename M2
, typename M3
>
408 struct AnyOfResult3
{
409 typedef EitherOfMatcher
<
410 typename AnyOfResult1
<M1
>::type
,
411 typename AnyOfResult2
<M2
, M3
>::type
415 template <typename M1
, typename M2
, typename M3
, typename M4
>
416 struct AnyOfResult4
{
417 typedef EitherOfMatcher
<
418 typename AnyOfResult2
<M1
, M2
>::type
,
419 typename AnyOfResult2
<M3
, M4
>::type
423 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
>
424 struct AnyOfResult5
{
425 typedef EitherOfMatcher
<
426 typename AnyOfResult2
<M1
, M2
>::type
,
427 typename AnyOfResult3
<M3
, M4
, M5
>::type
431 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
433 struct AnyOfResult6
{
434 typedef EitherOfMatcher
<
435 typename AnyOfResult3
<M1
, M2
, M3
>::type
,
436 typename AnyOfResult3
<M4
, M5
, M6
>::type
440 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
441 typename M6
, typename M7
>
442 struct AnyOfResult7
{
443 typedef EitherOfMatcher
<
444 typename AnyOfResult3
<M1
, M2
, M3
>::type
,
445 typename AnyOfResult4
<M4
, M5
, M6
, M7
>::type
449 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
450 typename M6
, typename M7
, typename M8
>
451 struct AnyOfResult8
{
452 typedef EitherOfMatcher
<
453 typename AnyOfResult4
<M1
, M2
, M3
, M4
>::type
,
454 typename AnyOfResult4
<M5
, M6
, M7
, M8
>::type
458 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
459 typename M6
, typename M7
, typename M8
, typename M9
>
460 struct AnyOfResult9
{
461 typedef EitherOfMatcher
<
462 typename AnyOfResult4
<M1
, M2
, M3
, M4
>::type
,
463 typename AnyOfResult5
<M5
, M6
, M7
, M8
, M9
>::type
467 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
468 typename M6
, typename M7
, typename M8
, typename M9
, typename M10
>
469 struct AnyOfResult10
{
470 typedef EitherOfMatcher
<
471 typename AnyOfResult5
<M1
, M2
, M3
, M4
, M5
>::type
,
472 typename AnyOfResult5
<M6
, M7
, M8
, M9
, M10
>::type
476 } // namespace internal
478 // Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
479 // fields of it matches a_matcher. C++ doesn't support default
480 // arguments for function templates, so we have to overload it.
481 template <typename InnerMatcher
>
482 inline internal::ArgsMatcher
<InnerMatcher
>
483 Args(const InnerMatcher
& matcher
) {
484 return internal::ArgsMatcher
<InnerMatcher
>(matcher
);
487 template <int k1
, typename InnerMatcher
>
488 inline internal::ArgsMatcher
<InnerMatcher
, k1
>
489 Args(const InnerMatcher
& matcher
) {
490 return internal::ArgsMatcher
<InnerMatcher
, k1
>(matcher
);
493 template <int k1
, int k2
, typename InnerMatcher
>
494 inline internal::ArgsMatcher
<InnerMatcher
, k1
, k2
>
495 Args(const InnerMatcher
& matcher
) {
496 return internal::ArgsMatcher
<InnerMatcher
, k1
, k2
>(matcher
);
499 template <int k1
, int k2
, int k3
, typename InnerMatcher
>
500 inline internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
>
501 Args(const InnerMatcher
& matcher
) {
502 return internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
>(matcher
);
505 template <int k1
, int k2
, int k3
, int k4
, typename InnerMatcher
>
506 inline internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
>
507 Args(const InnerMatcher
& matcher
) {
508 return internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
>(matcher
);
511 template <int k1
, int k2
, int k3
, int k4
, int k5
, typename InnerMatcher
>
512 inline internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
, k5
>
513 Args(const InnerMatcher
& matcher
) {
514 return internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
, k5
>(matcher
);
517 template <int k1
, int k2
, int k3
, int k4
, int k5
, int k6
, typename InnerMatcher
>
518 inline internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
, k5
, k6
>
519 Args(const InnerMatcher
& matcher
) {
520 return internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
, k5
, k6
>(matcher
);
523 template <int k1
, int k2
, int k3
, int k4
, int k5
, int k6
, int k7
,
524 typename InnerMatcher
>
525 inline internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
, k5
, k6
, k7
>
526 Args(const InnerMatcher
& matcher
) {
527 return internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
, k5
, k6
,
531 template <int k1
, int k2
, int k3
, int k4
, int k5
, int k6
, int k7
, int k8
,
532 typename InnerMatcher
>
533 inline internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
, k5
, k6
, k7
, k8
>
534 Args(const InnerMatcher
& matcher
) {
535 return internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
, k5
, k6
, k7
,
539 template <int k1
, int k2
, int k3
, int k4
, int k5
, int k6
, int k7
, int k8
,
540 int k9
, typename InnerMatcher
>
541 inline internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
, k5
, k6
, k7
, k8
, k9
>
542 Args(const InnerMatcher
& matcher
) {
543 return internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
, k5
, k6
, k7
, k8
,
547 template <int k1
, int k2
, int k3
, int k4
, int k5
, int k6
, int k7
, int k8
,
548 int k9
, int k10
, typename InnerMatcher
>
549 inline internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
, k5
, k6
, k7
, k8
, k9
,
551 Args(const InnerMatcher
& matcher
) {
552 return internal::ArgsMatcher
<InnerMatcher
, k1
, k2
, k3
, k4
, k5
, k6
, k7
, k8
,
556 // ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with
557 // n elements, where the i-th element in the container must
558 // match the i-th argument in the list. Each argument of
559 // ElementsAre() can be either a value or a matcher. We support up to
562 // The use of DecayArray in the implementation allows ElementsAre()
563 // to accept string literals, whose type is const char[N], but we
564 // want to treat them as const char*.
566 // NOTE: Since ElementsAre() cares about the order of the elements, it
567 // must not be used with containers whose elements's order is
568 // undefined (e.g. hash_map).
570 inline internal::ElementsAreMatcher
<
573 typedef ::testing::tuple
<> Args
;
574 return internal::ElementsAreMatcher
<Args
>(Args());
577 template <typename T1
>
578 inline internal::ElementsAreMatcher
<
580 typename
internal::DecayArray
<T1
>::type
> >
581 ElementsAre(const T1
& e1
) {
582 typedef ::testing::tuple
<
583 typename
internal::DecayArray
<T1
>::type
> Args
;
584 return internal::ElementsAreMatcher
<Args
>(Args(e1
));
587 template <typename T1
, typename T2
>
588 inline internal::ElementsAreMatcher
<
590 typename
internal::DecayArray
<T1
>::type
,
591 typename
internal::DecayArray
<T2
>::type
> >
592 ElementsAre(const T1
& e1
, const T2
& e2
) {
593 typedef ::testing::tuple
<
594 typename
internal::DecayArray
<T1
>::type
,
595 typename
internal::DecayArray
<T2
>::type
> Args
;
596 return internal::ElementsAreMatcher
<Args
>(Args(e1
, e2
));
599 template <typename T1
, typename T2
, typename T3
>
600 inline internal::ElementsAreMatcher
<
602 typename
internal::DecayArray
<T1
>::type
,
603 typename
internal::DecayArray
<T2
>::type
,
604 typename
internal::DecayArray
<T3
>::type
> >
605 ElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
) {
606 typedef ::testing::tuple
<
607 typename
internal::DecayArray
<T1
>::type
,
608 typename
internal::DecayArray
<T2
>::type
,
609 typename
internal::DecayArray
<T3
>::type
> Args
;
610 return internal::ElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
));
613 template <typename T1
, typename T2
, typename T3
, typename T4
>
614 inline internal::ElementsAreMatcher
<
616 typename
internal::DecayArray
<T1
>::type
,
617 typename
internal::DecayArray
<T2
>::type
,
618 typename
internal::DecayArray
<T3
>::type
,
619 typename
internal::DecayArray
<T4
>::type
> >
620 ElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
) {
621 typedef ::testing::tuple
<
622 typename
internal::DecayArray
<T1
>::type
,
623 typename
internal::DecayArray
<T2
>::type
,
624 typename
internal::DecayArray
<T3
>::type
,
625 typename
internal::DecayArray
<T4
>::type
> Args
;
626 return internal::ElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
));
629 template <typename T1
, typename T2
, typename T3
, typename T4
, typename T5
>
630 inline internal::ElementsAreMatcher
<
632 typename
internal::DecayArray
<T1
>::type
,
633 typename
internal::DecayArray
<T2
>::type
,
634 typename
internal::DecayArray
<T3
>::type
,
635 typename
internal::DecayArray
<T4
>::type
,
636 typename
internal::DecayArray
<T5
>::type
> >
637 ElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
,
639 typedef ::testing::tuple
<
640 typename
internal::DecayArray
<T1
>::type
,
641 typename
internal::DecayArray
<T2
>::type
,
642 typename
internal::DecayArray
<T3
>::type
,
643 typename
internal::DecayArray
<T4
>::type
,
644 typename
internal::DecayArray
<T5
>::type
> Args
;
645 return internal::ElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
, e5
));
648 template <typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
650 inline internal::ElementsAreMatcher
<
652 typename
internal::DecayArray
<T1
>::type
,
653 typename
internal::DecayArray
<T2
>::type
,
654 typename
internal::DecayArray
<T3
>::type
,
655 typename
internal::DecayArray
<T4
>::type
,
656 typename
internal::DecayArray
<T5
>::type
,
657 typename
internal::DecayArray
<T6
>::type
> >
658 ElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
,
659 const T5
& e5
, const T6
& e6
) {
660 typedef ::testing::tuple
<
661 typename
internal::DecayArray
<T1
>::type
,
662 typename
internal::DecayArray
<T2
>::type
,
663 typename
internal::DecayArray
<T3
>::type
,
664 typename
internal::DecayArray
<T4
>::type
,
665 typename
internal::DecayArray
<T5
>::type
,
666 typename
internal::DecayArray
<T6
>::type
> Args
;
667 return internal::ElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
, e5
, e6
));
670 template <typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
671 typename T6
, typename T7
>
672 inline internal::ElementsAreMatcher
<
674 typename
internal::DecayArray
<T1
>::type
,
675 typename
internal::DecayArray
<T2
>::type
,
676 typename
internal::DecayArray
<T3
>::type
,
677 typename
internal::DecayArray
<T4
>::type
,
678 typename
internal::DecayArray
<T5
>::type
,
679 typename
internal::DecayArray
<T6
>::type
,
680 typename
internal::DecayArray
<T7
>::type
> >
681 ElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
,
682 const T5
& e5
, const T6
& e6
, const T7
& e7
) {
683 typedef ::testing::tuple
<
684 typename
internal::DecayArray
<T1
>::type
,
685 typename
internal::DecayArray
<T2
>::type
,
686 typename
internal::DecayArray
<T3
>::type
,
687 typename
internal::DecayArray
<T4
>::type
,
688 typename
internal::DecayArray
<T5
>::type
,
689 typename
internal::DecayArray
<T6
>::type
,
690 typename
internal::DecayArray
<T7
>::type
> Args
;
691 return internal::ElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
, e5
, e6
, e7
));
694 template <typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
695 typename T6
, typename T7
, typename T8
>
696 inline internal::ElementsAreMatcher
<
698 typename
internal::DecayArray
<T1
>::type
,
699 typename
internal::DecayArray
<T2
>::type
,
700 typename
internal::DecayArray
<T3
>::type
,
701 typename
internal::DecayArray
<T4
>::type
,
702 typename
internal::DecayArray
<T5
>::type
,
703 typename
internal::DecayArray
<T6
>::type
,
704 typename
internal::DecayArray
<T7
>::type
,
705 typename
internal::DecayArray
<T8
>::type
> >
706 ElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
,
707 const T5
& e5
, const T6
& e6
, const T7
& e7
, const T8
& e8
) {
708 typedef ::testing::tuple
<
709 typename
internal::DecayArray
<T1
>::type
,
710 typename
internal::DecayArray
<T2
>::type
,
711 typename
internal::DecayArray
<T3
>::type
,
712 typename
internal::DecayArray
<T4
>::type
,
713 typename
internal::DecayArray
<T5
>::type
,
714 typename
internal::DecayArray
<T6
>::type
,
715 typename
internal::DecayArray
<T7
>::type
,
716 typename
internal::DecayArray
<T8
>::type
> Args
;
717 return internal::ElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
, e5
, e6
, e7
,
721 template <typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
722 typename T6
, typename T7
, typename T8
, typename T9
>
723 inline internal::ElementsAreMatcher
<
725 typename
internal::DecayArray
<T1
>::type
,
726 typename
internal::DecayArray
<T2
>::type
,
727 typename
internal::DecayArray
<T3
>::type
,
728 typename
internal::DecayArray
<T4
>::type
,
729 typename
internal::DecayArray
<T5
>::type
,
730 typename
internal::DecayArray
<T6
>::type
,
731 typename
internal::DecayArray
<T7
>::type
,
732 typename
internal::DecayArray
<T8
>::type
,
733 typename
internal::DecayArray
<T9
>::type
> >
734 ElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
,
735 const T5
& e5
, const T6
& e6
, const T7
& e7
, const T8
& e8
, const T9
& e9
) {
736 typedef ::testing::tuple
<
737 typename
internal::DecayArray
<T1
>::type
,
738 typename
internal::DecayArray
<T2
>::type
,
739 typename
internal::DecayArray
<T3
>::type
,
740 typename
internal::DecayArray
<T4
>::type
,
741 typename
internal::DecayArray
<T5
>::type
,
742 typename
internal::DecayArray
<T6
>::type
,
743 typename
internal::DecayArray
<T7
>::type
,
744 typename
internal::DecayArray
<T8
>::type
,
745 typename
internal::DecayArray
<T9
>::type
> Args
;
746 return internal::ElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
, e5
, e6
, e7
,
750 template <typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
751 typename T6
, typename T7
, typename T8
, typename T9
, typename T10
>
752 inline internal::ElementsAreMatcher
<
754 typename
internal::DecayArray
<T1
>::type
,
755 typename
internal::DecayArray
<T2
>::type
,
756 typename
internal::DecayArray
<T3
>::type
,
757 typename
internal::DecayArray
<T4
>::type
,
758 typename
internal::DecayArray
<T5
>::type
,
759 typename
internal::DecayArray
<T6
>::type
,
760 typename
internal::DecayArray
<T7
>::type
,
761 typename
internal::DecayArray
<T8
>::type
,
762 typename
internal::DecayArray
<T9
>::type
,
763 typename
internal::DecayArray
<T10
>::type
> >
764 ElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
,
765 const T5
& e5
, const T6
& e6
, const T7
& e7
, const T8
& e8
, const T9
& e9
,
767 typedef ::testing::tuple
<
768 typename
internal::DecayArray
<T1
>::type
,
769 typename
internal::DecayArray
<T2
>::type
,
770 typename
internal::DecayArray
<T3
>::type
,
771 typename
internal::DecayArray
<T4
>::type
,
772 typename
internal::DecayArray
<T5
>::type
,
773 typename
internal::DecayArray
<T6
>::type
,
774 typename
internal::DecayArray
<T7
>::type
,
775 typename
internal::DecayArray
<T8
>::type
,
776 typename
internal::DecayArray
<T9
>::type
,
777 typename
internal::DecayArray
<T10
>::type
> Args
;
778 return internal::ElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
, e5
, e6
, e7
,
782 // UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
783 // that matches n elements in any order. We support up to n=10 arguments.
785 inline internal::UnorderedElementsAreMatcher
<
787 UnorderedElementsAre() {
788 typedef ::testing::tuple
<> Args
;
789 return internal::UnorderedElementsAreMatcher
<Args
>(Args());
792 template <typename T1
>
793 inline internal::UnorderedElementsAreMatcher
<
795 typename
internal::DecayArray
<T1
>::type
> >
796 UnorderedElementsAre(const T1
& e1
) {
797 typedef ::testing::tuple
<
798 typename
internal::DecayArray
<T1
>::type
> Args
;
799 return internal::UnorderedElementsAreMatcher
<Args
>(Args(e1
));
802 template <typename T1
, typename T2
>
803 inline internal::UnorderedElementsAreMatcher
<
805 typename
internal::DecayArray
<T1
>::type
,
806 typename
internal::DecayArray
<T2
>::type
> >
807 UnorderedElementsAre(const T1
& e1
, const T2
& e2
) {
808 typedef ::testing::tuple
<
809 typename
internal::DecayArray
<T1
>::type
,
810 typename
internal::DecayArray
<T2
>::type
> Args
;
811 return internal::UnorderedElementsAreMatcher
<Args
>(Args(e1
, e2
));
814 template <typename T1
, typename T2
, typename T3
>
815 inline internal::UnorderedElementsAreMatcher
<
817 typename
internal::DecayArray
<T1
>::type
,
818 typename
internal::DecayArray
<T2
>::type
,
819 typename
internal::DecayArray
<T3
>::type
> >
820 UnorderedElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
) {
821 typedef ::testing::tuple
<
822 typename
internal::DecayArray
<T1
>::type
,
823 typename
internal::DecayArray
<T2
>::type
,
824 typename
internal::DecayArray
<T3
>::type
> Args
;
825 return internal::UnorderedElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
));
828 template <typename T1
, typename T2
, typename T3
, typename T4
>
829 inline internal::UnorderedElementsAreMatcher
<
831 typename
internal::DecayArray
<T1
>::type
,
832 typename
internal::DecayArray
<T2
>::type
,
833 typename
internal::DecayArray
<T3
>::type
,
834 typename
internal::DecayArray
<T4
>::type
> >
835 UnorderedElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
) {
836 typedef ::testing::tuple
<
837 typename
internal::DecayArray
<T1
>::type
,
838 typename
internal::DecayArray
<T2
>::type
,
839 typename
internal::DecayArray
<T3
>::type
,
840 typename
internal::DecayArray
<T4
>::type
> Args
;
841 return internal::UnorderedElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
));
844 template <typename T1
, typename T2
, typename T3
, typename T4
, typename T5
>
845 inline internal::UnorderedElementsAreMatcher
<
847 typename
internal::DecayArray
<T1
>::type
,
848 typename
internal::DecayArray
<T2
>::type
,
849 typename
internal::DecayArray
<T3
>::type
,
850 typename
internal::DecayArray
<T4
>::type
,
851 typename
internal::DecayArray
<T5
>::type
> >
852 UnorderedElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
,
854 typedef ::testing::tuple
<
855 typename
internal::DecayArray
<T1
>::type
,
856 typename
internal::DecayArray
<T2
>::type
,
857 typename
internal::DecayArray
<T3
>::type
,
858 typename
internal::DecayArray
<T4
>::type
,
859 typename
internal::DecayArray
<T5
>::type
> Args
;
860 return internal::UnorderedElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
, e5
));
863 template <typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
865 inline internal::UnorderedElementsAreMatcher
<
867 typename
internal::DecayArray
<T1
>::type
,
868 typename
internal::DecayArray
<T2
>::type
,
869 typename
internal::DecayArray
<T3
>::type
,
870 typename
internal::DecayArray
<T4
>::type
,
871 typename
internal::DecayArray
<T5
>::type
,
872 typename
internal::DecayArray
<T6
>::type
> >
873 UnorderedElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
,
874 const T5
& e5
, const T6
& e6
) {
875 typedef ::testing::tuple
<
876 typename
internal::DecayArray
<T1
>::type
,
877 typename
internal::DecayArray
<T2
>::type
,
878 typename
internal::DecayArray
<T3
>::type
,
879 typename
internal::DecayArray
<T4
>::type
,
880 typename
internal::DecayArray
<T5
>::type
,
881 typename
internal::DecayArray
<T6
>::type
> Args
;
882 return internal::UnorderedElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
, e5
,
886 template <typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
887 typename T6
, typename T7
>
888 inline internal::UnorderedElementsAreMatcher
<
890 typename
internal::DecayArray
<T1
>::type
,
891 typename
internal::DecayArray
<T2
>::type
,
892 typename
internal::DecayArray
<T3
>::type
,
893 typename
internal::DecayArray
<T4
>::type
,
894 typename
internal::DecayArray
<T5
>::type
,
895 typename
internal::DecayArray
<T6
>::type
,
896 typename
internal::DecayArray
<T7
>::type
> >
897 UnorderedElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
,
898 const T5
& e5
, const T6
& e6
, const T7
& e7
) {
899 typedef ::testing::tuple
<
900 typename
internal::DecayArray
<T1
>::type
,
901 typename
internal::DecayArray
<T2
>::type
,
902 typename
internal::DecayArray
<T3
>::type
,
903 typename
internal::DecayArray
<T4
>::type
,
904 typename
internal::DecayArray
<T5
>::type
,
905 typename
internal::DecayArray
<T6
>::type
,
906 typename
internal::DecayArray
<T7
>::type
> Args
;
907 return internal::UnorderedElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
, e5
,
911 template <typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
912 typename T6
, typename T7
, typename T8
>
913 inline internal::UnorderedElementsAreMatcher
<
915 typename
internal::DecayArray
<T1
>::type
,
916 typename
internal::DecayArray
<T2
>::type
,
917 typename
internal::DecayArray
<T3
>::type
,
918 typename
internal::DecayArray
<T4
>::type
,
919 typename
internal::DecayArray
<T5
>::type
,
920 typename
internal::DecayArray
<T6
>::type
,
921 typename
internal::DecayArray
<T7
>::type
,
922 typename
internal::DecayArray
<T8
>::type
> >
923 UnorderedElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
,
924 const T5
& e5
, const T6
& e6
, const T7
& e7
, const T8
& e8
) {
925 typedef ::testing::tuple
<
926 typename
internal::DecayArray
<T1
>::type
,
927 typename
internal::DecayArray
<T2
>::type
,
928 typename
internal::DecayArray
<T3
>::type
,
929 typename
internal::DecayArray
<T4
>::type
,
930 typename
internal::DecayArray
<T5
>::type
,
931 typename
internal::DecayArray
<T6
>::type
,
932 typename
internal::DecayArray
<T7
>::type
,
933 typename
internal::DecayArray
<T8
>::type
> Args
;
934 return internal::UnorderedElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
, e5
,
938 template <typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
939 typename T6
, typename T7
, typename T8
, typename T9
>
940 inline internal::UnorderedElementsAreMatcher
<
942 typename
internal::DecayArray
<T1
>::type
,
943 typename
internal::DecayArray
<T2
>::type
,
944 typename
internal::DecayArray
<T3
>::type
,
945 typename
internal::DecayArray
<T4
>::type
,
946 typename
internal::DecayArray
<T5
>::type
,
947 typename
internal::DecayArray
<T6
>::type
,
948 typename
internal::DecayArray
<T7
>::type
,
949 typename
internal::DecayArray
<T8
>::type
,
950 typename
internal::DecayArray
<T9
>::type
> >
951 UnorderedElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
,
952 const T5
& e5
, const T6
& e6
, const T7
& e7
, const T8
& e8
, const T9
& e9
) {
953 typedef ::testing::tuple
<
954 typename
internal::DecayArray
<T1
>::type
,
955 typename
internal::DecayArray
<T2
>::type
,
956 typename
internal::DecayArray
<T3
>::type
,
957 typename
internal::DecayArray
<T4
>::type
,
958 typename
internal::DecayArray
<T5
>::type
,
959 typename
internal::DecayArray
<T6
>::type
,
960 typename
internal::DecayArray
<T7
>::type
,
961 typename
internal::DecayArray
<T8
>::type
,
962 typename
internal::DecayArray
<T9
>::type
> Args
;
963 return internal::UnorderedElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
, e5
,
967 template <typename T1
, typename T2
, typename T3
, typename T4
, typename T5
,
968 typename T6
, typename T7
, typename T8
, typename T9
, typename T10
>
969 inline internal::UnorderedElementsAreMatcher
<
971 typename
internal::DecayArray
<T1
>::type
,
972 typename
internal::DecayArray
<T2
>::type
,
973 typename
internal::DecayArray
<T3
>::type
,
974 typename
internal::DecayArray
<T4
>::type
,
975 typename
internal::DecayArray
<T5
>::type
,
976 typename
internal::DecayArray
<T6
>::type
,
977 typename
internal::DecayArray
<T7
>::type
,
978 typename
internal::DecayArray
<T8
>::type
,
979 typename
internal::DecayArray
<T9
>::type
,
980 typename
internal::DecayArray
<T10
>::type
> >
981 UnorderedElementsAre(const T1
& e1
, const T2
& e2
, const T3
& e3
, const T4
& e4
,
982 const T5
& e5
, const T6
& e6
, const T7
& e7
, const T8
& e8
, const T9
& e9
,
984 typedef ::testing::tuple
<
985 typename
internal::DecayArray
<T1
>::type
,
986 typename
internal::DecayArray
<T2
>::type
,
987 typename
internal::DecayArray
<T3
>::type
,
988 typename
internal::DecayArray
<T4
>::type
,
989 typename
internal::DecayArray
<T5
>::type
,
990 typename
internal::DecayArray
<T6
>::type
,
991 typename
internal::DecayArray
<T7
>::type
,
992 typename
internal::DecayArray
<T8
>::type
,
993 typename
internal::DecayArray
<T9
>::type
,
994 typename
internal::DecayArray
<T10
>::type
> Args
;
995 return internal::UnorderedElementsAreMatcher
<Args
>(Args(e1
, e2
, e3
, e4
, e5
,
996 e6
, e7
, e8
, e9
, e10
));
999 // AllOf(m1, m2, ..., mk) matches any value that matches all of the given
1000 // sub-matchers. AllOf is called fully qualified to prevent ADL from firing.
1002 template <typename M1
, typename M2
>
1003 inline typename
internal::AllOfResult2
<M1
, M2
>::type
1004 AllOf(M1 m1
, M2 m2
) {
1005 return typename
internal::AllOfResult2
<M1
, M2
>::type(
1010 template <typename M1
, typename M2
, typename M3
>
1011 inline typename
internal::AllOfResult3
<M1
, M2
, M3
>::type
1012 AllOf(M1 m1
, M2 m2
, M3 m3
) {
1013 return typename
internal::AllOfResult3
<M1
, M2
, M3
>::type(
1015 ::testing::AllOf(m2
, m3
));
1018 template <typename M1
, typename M2
, typename M3
, typename M4
>
1019 inline typename
internal::AllOfResult4
<M1
, M2
, M3
, M4
>::type
1020 AllOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
) {
1021 return typename
internal::AllOfResult4
<M1
, M2
, M3
, M4
>::type(
1022 ::testing::AllOf(m1
, m2
),
1023 ::testing::AllOf(m3
, m4
));
1026 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
>
1027 inline typename
internal::AllOfResult5
<M1
, M2
, M3
, M4
, M5
>::type
1028 AllOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
, M5 m5
) {
1029 return typename
internal::AllOfResult5
<M1
, M2
, M3
, M4
, M5
>::type(
1030 ::testing::AllOf(m1
, m2
),
1031 ::testing::AllOf(m3
, m4
, m5
));
1034 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
1036 inline typename
internal::AllOfResult6
<M1
, M2
, M3
, M4
, M5
, M6
>::type
1037 AllOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
, M5 m5
, M6 m6
) {
1038 return typename
internal::AllOfResult6
<M1
, M2
, M3
, M4
, M5
, M6
>::type(
1039 ::testing::AllOf(m1
, m2
, m3
),
1040 ::testing::AllOf(m4
, m5
, m6
));
1043 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
1044 typename M6
, typename M7
>
1045 inline typename
internal::AllOfResult7
<M1
, M2
, M3
, M4
, M5
, M6
, M7
>::type
1046 AllOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
, M5 m5
, M6 m6
, M7 m7
) {
1047 return typename
internal::AllOfResult7
<M1
, M2
, M3
, M4
, M5
, M6
, M7
>::type(
1048 ::testing::AllOf(m1
, m2
, m3
),
1049 ::testing::AllOf(m4
, m5
, m6
, m7
));
1052 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
1053 typename M6
, typename M7
, typename M8
>
1054 inline typename
internal::AllOfResult8
<M1
, M2
, M3
, M4
, M5
, M6
, M7
, M8
>::type
1055 AllOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
, M5 m5
, M6 m6
, M7 m7
, M8 m8
) {
1056 return typename
internal::AllOfResult8
<M1
, M2
, M3
, M4
, M5
, M6
, M7
, M8
>::type(
1057 ::testing::AllOf(m1
, m2
, m3
, m4
),
1058 ::testing::AllOf(m5
, m6
, m7
, m8
));
1061 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
1062 typename M6
, typename M7
, typename M8
, typename M9
>
1063 inline typename
internal::AllOfResult9
<M1
, M2
, M3
, M4
, M5
, M6
, M7
, M8
, M9
>::type
1064 AllOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
, M5 m5
, M6 m6
, M7 m7
, M8 m8
, M9 m9
) {
1065 return typename
internal::AllOfResult9
<M1
, M2
, M3
, M4
, M5
, M6
, M7
, M8
,
1067 ::testing::AllOf(m1
, m2
, m3
, m4
),
1068 ::testing::AllOf(m5
, m6
, m7
, m8
, m9
));
1071 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
1072 typename M6
, typename M7
, typename M8
, typename M9
, typename M10
>
1073 inline typename
internal::AllOfResult10
<M1
, M2
, M3
, M4
, M5
, M6
, M7
, M8
, M9
,
1075 AllOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
, M5 m5
, M6 m6
, M7 m7
, M8 m8
, M9 m9
, M10 m10
) {
1076 return typename
internal::AllOfResult10
<M1
, M2
, M3
, M4
, M5
, M6
, M7
, M8
, M9
,
1078 ::testing::AllOf(m1
, m2
, m3
, m4
, m5
),
1079 ::testing::AllOf(m6
, m7
, m8
, m9
, m10
));
1082 // AnyOf(m1, m2, ..., mk) matches any value that matches any of the given
1083 // sub-matchers. AnyOf is called fully qualified to prevent ADL from firing.
1085 template <typename M1
, typename M2
>
1086 inline typename
internal::AnyOfResult2
<M1
, M2
>::type
1087 AnyOf(M1 m1
, M2 m2
) {
1088 return typename
internal::AnyOfResult2
<M1
, M2
>::type(
1093 template <typename M1
, typename M2
, typename M3
>
1094 inline typename
internal::AnyOfResult3
<M1
, M2
, M3
>::type
1095 AnyOf(M1 m1
, M2 m2
, M3 m3
) {
1096 return typename
internal::AnyOfResult3
<M1
, M2
, M3
>::type(
1098 ::testing::AnyOf(m2
, m3
));
1101 template <typename M1
, typename M2
, typename M3
, typename M4
>
1102 inline typename
internal::AnyOfResult4
<M1
, M2
, M3
, M4
>::type
1103 AnyOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
) {
1104 return typename
internal::AnyOfResult4
<M1
, M2
, M3
, M4
>::type(
1105 ::testing::AnyOf(m1
, m2
),
1106 ::testing::AnyOf(m3
, m4
));
1109 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
>
1110 inline typename
internal::AnyOfResult5
<M1
, M2
, M3
, M4
, M5
>::type
1111 AnyOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
, M5 m5
) {
1112 return typename
internal::AnyOfResult5
<M1
, M2
, M3
, M4
, M5
>::type(
1113 ::testing::AnyOf(m1
, m2
),
1114 ::testing::AnyOf(m3
, m4
, m5
));
1117 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
1119 inline typename
internal::AnyOfResult6
<M1
, M2
, M3
, M4
, M5
, M6
>::type
1120 AnyOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
, M5 m5
, M6 m6
) {
1121 return typename
internal::AnyOfResult6
<M1
, M2
, M3
, M4
, M5
, M6
>::type(
1122 ::testing::AnyOf(m1
, m2
, m3
),
1123 ::testing::AnyOf(m4
, m5
, m6
));
1126 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
1127 typename M6
, typename M7
>
1128 inline typename
internal::AnyOfResult7
<M1
, M2
, M3
, M4
, M5
, M6
, M7
>::type
1129 AnyOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
, M5 m5
, M6 m6
, M7 m7
) {
1130 return typename
internal::AnyOfResult7
<M1
, M2
, M3
, M4
, M5
, M6
, M7
>::type(
1131 ::testing::AnyOf(m1
, m2
, m3
),
1132 ::testing::AnyOf(m4
, m5
, m6
, m7
));
1135 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
1136 typename M6
, typename M7
, typename M8
>
1137 inline typename
internal::AnyOfResult8
<M1
, M2
, M3
, M4
, M5
, M6
, M7
, M8
>::type
1138 AnyOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
, M5 m5
, M6 m6
, M7 m7
, M8 m8
) {
1139 return typename
internal::AnyOfResult8
<M1
, M2
, M3
, M4
, M5
, M6
, M7
, M8
>::type(
1140 ::testing::AnyOf(m1
, m2
, m3
, m4
),
1141 ::testing::AnyOf(m5
, m6
, m7
, m8
));
1144 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
1145 typename M6
, typename M7
, typename M8
, typename M9
>
1146 inline typename
internal::AnyOfResult9
<M1
, M2
, M3
, M4
, M5
, M6
, M7
, M8
, M9
>::type
1147 AnyOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
, M5 m5
, M6 m6
, M7 m7
, M8 m8
, M9 m9
) {
1148 return typename
internal::AnyOfResult9
<M1
, M2
, M3
, M4
, M5
, M6
, M7
, M8
,
1150 ::testing::AnyOf(m1
, m2
, m3
, m4
),
1151 ::testing::AnyOf(m5
, m6
, m7
, m8
, m9
));
1154 template <typename M1
, typename M2
, typename M3
, typename M4
, typename M5
,
1155 typename M6
, typename M7
, typename M8
, typename M9
, typename M10
>
1156 inline typename
internal::AnyOfResult10
<M1
, M2
, M3
, M4
, M5
, M6
, M7
, M8
, M9
,
1158 AnyOf(M1 m1
, M2 m2
, M3 m3
, M4 m4
, M5 m5
, M6 m6
, M7 m7
, M8 m8
, M9 m9
, M10 m10
) {
1159 return typename
internal::AnyOfResult10
<M1
, M2
, M3
, M4
, M5
, M6
, M7
, M8
, M9
,
1161 ::testing::AnyOf(m1
, m2
, m3
, m4
, m5
),
1162 ::testing::AnyOf(m6
, m7
, m8
, m9
, m10
));
1165 } // namespace testing
1168 // The MATCHER* family of macros can be used in a namespace scope to
1169 // define custom matchers easily.
1176 // MATCHER(name, description_string) { statements; }
1178 // defines a matcher with the given name that executes the statements,
1179 // which must return a bool to indicate if the match succeeds. Inside
1180 // the statements, you can refer to the value being matched by 'arg',
1181 // and refer to its type by 'arg_type'.
1183 // The description string documents what the matcher does, and is used
1184 // to generate the failure message when the match fails. Since a
1185 // MATCHER() is usually defined in a header file shared by multiple
1186 // C++ source files, we require the description to be a C-string
1187 // literal to avoid possible side effects. It can be empty, in which
1188 // case we'll use the sequence of words in the matcher name as the
1193 // MATCHER(IsEven, "") { return (arg % 2) == 0; }
1195 // allows you to write
1197 // // Expects mock_foo.Bar(n) to be called where n is even.
1198 // EXPECT_CALL(mock_foo, Bar(IsEven()));
1202 // // Verifies that the value of some_expression is even.
1203 // EXPECT_THAT(some_expression, IsEven());
1205 // If the above assertion fails, it will print something like:
1207 // Value of: some_expression
1208 // Expected: is even
1211 // where the description "is even" is automatically calculated from the
1212 // matcher name IsEven.
1217 // Note that the type of the value being matched (arg_type) is
1218 // determined by the context in which you use the matcher and is
1219 // supplied to you by the compiler, so you don't need to worry about
1220 // declaring it (nor can you). This allows the matcher to be
1221 // polymorphic. For example, IsEven() can be used to match any type
1222 // where the value of "(arg % 2) == 0" can be implicitly converted to
1223 // a bool. In the "Bar(IsEven())" example above, if method Bar()
1224 // takes an int, 'arg_type' will be int; if it takes an unsigned long,
1225 // 'arg_type' will be unsigned long; and so on.
1227 // Parameterizing Matchers
1228 // =======================
1230 // Sometimes you'll want to parameterize the matcher. For that you
1231 // can use another macro:
1233 // MATCHER_P(name, param_name, description_string) { statements; }
1237 // MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
1239 // will allow you to write:
1241 // EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
1243 // which may lead to this message (assuming n is 10):
1245 // Value of: Blah("a")
1246 // Expected: has absolute value 10
1249 // Note that both the matcher description and its parameter are
1250 // printed, making the message human-friendly.
1252 // In the matcher definition body, you can write 'foo_type' to
1253 // reference the type of a parameter named 'foo'. For example, in the
1254 // body of MATCHER_P(HasAbsoluteValue, value) above, you can write
1255 // 'value_type' to refer to the type of 'value'.
1257 // We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to
1258 // support multi-parameter matchers.
1260 // Describing Parameterized Matchers
1261 // =================================
1263 // The last argument to MATCHER*() is a string-typed expression. The
1264 // expression can reference all of the matcher's parameters and a
1265 // special bool-typed variable named 'negation'. When 'negation' is
1266 // false, the expression should evaluate to the matcher's description;
1267 // otherwise it should evaluate to the description of the negation of
1268 // the matcher. For example,
1270 // using testing::PrintToString;
1272 // MATCHER_P2(InClosedRange, low, hi,
1273 // string(negation ? "is not" : "is") + " in range [" +
1274 // PrintToString(low) + ", " + PrintToString(hi) + "]") {
1275 // return low <= arg && arg <= hi;
1278 // EXPECT_THAT(3, InClosedRange(4, 6));
1279 // EXPECT_THAT(3, Not(InClosedRange(2, 4)));
1281 // would generate two failures that contain the text:
1283 // Expected: is in range [4, 6]
1285 // Expected: is not in range [2, 4]
1287 // If you specify "" as the description, the failure message will
1288 // contain the sequence of words in the matcher name followed by the
1289 // parameter values printed as a tuple. For example,
1291 // MATCHER_P2(InClosedRange, low, hi, "") { ... }
1293 // EXPECT_THAT(3, InClosedRange(4, 6));
1294 // EXPECT_THAT(3, Not(InClosedRange(2, 4)));
1296 // would generate two failures that contain the text:
1298 // Expected: in closed range (4, 6)
1300 // Expected: not (in closed range (2, 4))
1302 // Types of Matcher Parameters
1303 // ===========================
1305 // For the purpose of typing, you can view
1307 // MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
1311 // template <typename p1_type, ..., typename pk_type>
1312 // FooMatcherPk<p1_type, ..., pk_type>
1313 // Foo(p1_type p1, ..., pk_type pk) { ... }
1315 // When you write Foo(v1, ..., vk), the compiler infers the types of
1316 // the parameters v1, ..., and vk for you. If you are not happy with
1317 // the result of the type inference, you can specify the types by
1318 // explicitly instantiating the template, as in Foo<long, bool>(5,
1319 // false). As said earlier, you don't get to (or need to) specify
1320 // 'arg_type' as that's determined by the context in which the matcher
1321 // is used. You can assign the result of expression Foo(p1, ..., pk)
1322 // to a variable of type FooMatcherPk<p1_type, ..., pk_type>. This
1323 // can be useful when composing matchers.
1325 // While you can instantiate a matcher template with reference types,
1326 // passing the parameters by pointer usually makes your code more
1327 // readable. If, however, you still want to pass a parameter by
1328 // reference, be aware that in the failure message generated by the
1329 // matcher you will see the value of the referenced object but not its
1332 // Explaining Match Results
1333 // ========================
1335 // Sometimes the matcher description alone isn't enough to explain why
1336 // the match has failed or succeeded. For example, when expecting a
1337 // long string, it can be very helpful to also print the diff between
1338 // the expected string and the actual one. To achieve that, you can
1339 // optionally stream additional information to a special variable
1340 // named result_listener, whose type is a pointer to class
1341 // MatchResultListener:
1343 // MATCHER_P(EqualsLongString, str, "") {
1344 // if (arg == str) return true;
1346 // *result_listener << "the difference: "
1347 /// << DiffStrings(str, arg);
1351 // Overloading Matchers
1352 // ====================
1354 // You can overload matchers with different numbers of parameters:
1356 // MATCHER_P(Blah, a, description_string1) { ... }
1357 // MATCHER_P2(Blah, a, b, description_string2) { ... }
1362 // When defining a new matcher, you should also consider implementing
1363 // MatcherInterface or using MakePolymorphicMatcher(). These
1364 // approaches require more work than the MATCHER* macros, but also
1365 // give you more control on the types of the value being matched and
1366 // the matcher parameters, which may leads to better compiler error
1367 // messages when the matcher is used wrong. They also allow
1368 // overloading matchers based on parameter types (as opposed to just
1369 // based on the number of parameters).
1371 // MATCHER*() can only be used in a namespace scope. The reason is
1372 // that C++ doesn't yet allow function-local types to be used to
1373 // instantiate templates. The up-coming C++0x standard will fix this.
1374 // Once that's done, we'll consider supporting using MATCHER*() inside
1380 // To learn more about using these macros, please search for 'MATCHER'
1381 // on http://code.google.com/p/googlemock/wiki/CookBook.
1383 #define MATCHER(name, description)\
1384 class name##Matcher {\
1386 template <typename arg_type>\
1387 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1391 virtual bool MatchAndExplain(\
1392 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1393 virtual void DescribeTo(::std::ostream* gmock_os) const {\
1394 *gmock_os << FormatDescription(false);\
1396 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1397 *gmock_os << FormatDescription(true);\
1400 ::testing::internal::string FormatDescription(bool negation) const {\
1401 const ::testing::internal::string gmock_description = (description);\
1402 if (!gmock_description.empty())\
1403 return gmock_description;\
1404 return ::testing::internal::FormatMatcherDescription(\
1406 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1407 ::testing::tuple<>()));\
1409 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1411 template <typename arg_type>\
1412 operator ::testing::Matcher<arg_type>() const {\
1413 return ::testing::Matcher<arg_type>(\
1414 new gmock_Impl<arg_type>());\
1419 GTEST_DISALLOW_ASSIGN_(name##Matcher);\
1421 inline name##Matcher name() {\
1422 return name##Matcher();\
1424 template <typename arg_type>\
1425 bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\
1427 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1430 #define MATCHER_P(name, p0, description)\
1431 template <typename p0##_type>\
1432 class name##MatcherP {\
1434 template <typename arg_type>\
1435 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1437 explicit gmock_Impl(p0##_type gmock_p0)\
1439 virtual bool MatchAndExplain(\
1440 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1441 virtual void DescribeTo(::std::ostream* gmock_os) const {\
1442 *gmock_os << FormatDescription(false);\
1444 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1445 *gmock_os << FormatDescription(true);\
1449 ::testing::internal::string FormatDescription(bool negation) const {\
1450 const ::testing::internal::string gmock_description = (description);\
1451 if (!gmock_description.empty())\
1452 return gmock_description;\
1453 return ::testing::internal::FormatMatcherDescription(\
1455 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1456 ::testing::tuple<p0##_type>(p0)));\
1458 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1460 template <typename arg_type>\
1461 operator ::testing::Matcher<arg_type>() const {\
1462 return ::testing::Matcher<arg_type>(\
1463 new gmock_Impl<arg_type>(p0));\
1465 explicit name##MatcherP(p0##_type gmock_p0) : p0(gmock_p0) {\
1469 GTEST_DISALLOW_ASSIGN_(name##MatcherP);\
1471 template <typename p0##_type>\
1472 inline name##MatcherP<p0##_type> name(p0##_type p0) {\
1473 return name##MatcherP<p0##_type>(p0);\
1475 template <typename p0##_type>\
1476 template <typename arg_type>\
1477 bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1479 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1482 #define MATCHER_P2(name, p0, p1, description)\
1483 template <typename p0##_type, typename p1##_type>\
1484 class name##MatcherP2 {\
1486 template <typename arg_type>\
1487 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1489 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\
1490 : p0(gmock_p0), p1(gmock_p1) {}\
1491 virtual bool MatchAndExplain(\
1492 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1493 virtual void DescribeTo(::std::ostream* gmock_os) const {\
1494 *gmock_os << FormatDescription(false);\
1496 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1497 *gmock_os << FormatDescription(true);\
1502 ::testing::internal::string FormatDescription(bool negation) const {\
1503 const ::testing::internal::string gmock_description = (description);\
1504 if (!gmock_description.empty())\
1505 return gmock_description;\
1506 return ::testing::internal::FormatMatcherDescription(\
1508 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1509 ::testing::tuple<p0##_type, p1##_type>(p0, p1)));\
1511 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1513 template <typename arg_type>\
1514 operator ::testing::Matcher<arg_type>() const {\
1515 return ::testing::Matcher<arg_type>(\
1516 new gmock_Impl<arg_type>(p0, p1));\
1518 name##MatcherP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
1524 GTEST_DISALLOW_ASSIGN_(name##MatcherP2);\
1526 template <typename p0##_type, typename p1##_type>\
1527 inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \
1529 return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\
1531 template <typename p0##_type, typename p1##_type>\
1532 template <typename arg_type>\
1533 bool name##MatcherP2<p0##_type, \
1534 p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1536 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1539 #define MATCHER_P3(name, p0, p1, p2, description)\
1540 template <typename p0##_type, typename p1##_type, typename p2##_type>\
1541 class name##MatcherP3 {\
1543 template <typename arg_type>\
1544 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1546 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\
1547 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
1548 virtual bool MatchAndExplain(\
1549 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1550 virtual void DescribeTo(::std::ostream* gmock_os) const {\
1551 *gmock_os << FormatDescription(false);\
1553 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1554 *gmock_os << FormatDescription(true);\
1560 ::testing::internal::string FormatDescription(bool negation) const {\
1561 const ::testing::internal::string gmock_description = (description);\
1562 if (!gmock_description.empty())\
1563 return gmock_description;\
1564 return ::testing::internal::FormatMatcherDescription(\
1566 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1567 ::testing::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \
1570 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1572 template <typename arg_type>\
1573 operator ::testing::Matcher<arg_type>() const {\
1574 return ::testing::Matcher<arg_type>(\
1575 new gmock_Impl<arg_type>(p0, p1, p2));\
1577 name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \
1578 p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {\
1584 GTEST_DISALLOW_ASSIGN_(name##MatcherP3);\
1586 template <typename p0##_type, typename p1##_type, typename p2##_type>\
1587 inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
1588 p1##_type p1, p2##_type p2) {\
1589 return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
1591 template <typename p0##_type, typename p1##_type, typename p2##_type>\
1592 template <typename arg_type>\
1593 bool name##MatcherP3<p0##_type, p1##_type, \
1594 p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1596 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1599 #define MATCHER_P4(name, p0, p1, p2, p3, description)\
1600 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1601 typename p3##_type>\
1602 class name##MatcherP4 {\
1604 template <typename arg_type>\
1605 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1607 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1608 p3##_type gmock_p3)\
1609 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3) {}\
1610 virtual bool MatchAndExplain(\
1611 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1612 virtual void DescribeTo(::std::ostream* gmock_os) const {\
1613 *gmock_os << FormatDescription(false);\
1615 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1616 *gmock_os << FormatDescription(true);\
1623 ::testing::internal::string FormatDescription(bool negation) const {\
1624 const ::testing::internal::string gmock_description = (description);\
1625 if (!gmock_description.empty())\
1626 return gmock_description;\
1627 return ::testing::internal::FormatMatcherDescription(\
1629 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1630 ::testing::tuple<p0##_type, p1##_type, p2##_type, \
1631 p3##_type>(p0, p1, p2, p3)));\
1633 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1635 template <typename arg_type>\
1636 operator ::testing::Matcher<arg_type>() const {\
1637 return ::testing::Matcher<arg_type>(\
1638 new gmock_Impl<arg_type>(p0, p1, p2, p3));\
1640 name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \
1641 p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \
1642 p2(gmock_p2), p3(gmock_p3) {\
1649 GTEST_DISALLOW_ASSIGN_(name##MatcherP4);\
1651 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1652 typename p3##_type>\
1653 inline name##MatcherP4<p0##_type, p1##_type, p2##_type, \
1654 p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1656 return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
1659 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1660 typename p3##_type>\
1661 template <typename arg_type>\
1662 bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \
1663 p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1665 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1668 #define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\
1669 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1670 typename p3##_type, typename p4##_type>\
1671 class name##MatcherP5 {\
1673 template <typename arg_type>\
1674 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1676 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1677 p3##_type gmock_p3, p4##_type gmock_p4)\
1678 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
1680 virtual bool MatchAndExplain(\
1681 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1682 virtual void DescribeTo(::std::ostream* gmock_os) const {\
1683 *gmock_os << FormatDescription(false);\
1685 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1686 *gmock_os << FormatDescription(true);\
1694 ::testing::internal::string FormatDescription(bool negation) const {\
1695 const ::testing::internal::string gmock_description = (description);\
1696 if (!gmock_description.empty())\
1697 return gmock_description;\
1698 return ::testing::internal::FormatMatcherDescription(\
1700 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1701 ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1702 p4##_type>(p0, p1, p2, p3, p4)));\
1704 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1706 template <typename arg_type>\
1707 operator ::testing::Matcher<arg_type>() const {\
1708 return ::testing::Matcher<arg_type>(\
1709 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\
1711 name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \
1712 p2##_type gmock_p2, p3##_type gmock_p3, \
1713 p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
1714 p3(gmock_p3), p4(gmock_p4) {\
1722 GTEST_DISALLOW_ASSIGN_(name##MatcherP5);\
1724 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1725 typename p3##_type, typename p4##_type>\
1726 inline name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1727 p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1729 return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1730 p4##_type>(p0, p1, p2, p3, p4);\
1732 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1733 typename p3##_type, typename p4##_type>\
1734 template <typename arg_type>\
1735 bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1736 p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1738 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1741 #define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\
1742 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1743 typename p3##_type, typename p4##_type, typename p5##_type>\
1744 class name##MatcherP6 {\
1746 template <typename arg_type>\
1747 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1749 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1750 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\
1751 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
1752 p4(gmock_p4), p5(gmock_p5) {}\
1753 virtual bool MatchAndExplain(\
1754 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1755 virtual void DescribeTo(::std::ostream* gmock_os) const {\
1756 *gmock_os << FormatDescription(false);\
1758 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1759 *gmock_os << FormatDescription(true);\
1768 ::testing::internal::string FormatDescription(bool negation) const {\
1769 const ::testing::internal::string gmock_description = (description);\
1770 if (!gmock_description.empty())\
1771 return gmock_description;\
1772 return ::testing::internal::FormatMatcherDescription(\
1774 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1775 ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1776 p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
1778 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1780 template <typename arg_type>\
1781 operator ::testing::Matcher<arg_type>() const {\
1782 return ::testing::Matcher<arg_type>(\
1783 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\
1785 name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \
1786 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1787 p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
1788 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {\
1797 GTEST_DISALLOW_ASSIGN_(name##MatcherP6);\
1799 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1800 typename p3##_type, typename p4##_type, typename p5##_type>\
1801 inline name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1802 p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1803 p3##_type p3, p4##_type p4, p5##_type p5) {\
1804 return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1805 p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
1807 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1808 typename p3##_type, typename p4##_type, typename p5##_type>\
1809 template <typename arg_type>\
1810 bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1811 p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1813 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1816 #define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\
1817 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1818 typename p3##_type, typename p4##_type, typename p5##_type, \
1819 typename p6##_type>\
1820 class name##MatcherP7 {\
1822 template <typename arg_type>\
1823 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1825 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1826 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1827 p6##_type gmock_p6)\
1828 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
1829 p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\
1830 virtual bool MatchAndExplain(\
1831 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1832 virtual void DescribeTo(::std::ostream* gmock_os) const {\
1833 *gmock_os << FormatDescription(false);\
1835 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1836 *gmock_os << FormatDescription(true);\
1846 ::testing::internal::string FormatDescription(bool negation) const {\
1847 const ::testing::internal::string gmock_description = (description);\
1848 if (!gmock_description.empty())\
1849 return gmock_description;\
1850 return ::testing::internal::FormatMatcherDescription(\
1852 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1853 ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1854 p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
1857 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1859 template <typename arg_type>\
1860 operator ::testing::Matcher<arg_type>() const {\
1861 return ::testing::Matcher<arg_type>(\
1862 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6));\
1864 name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \
1865 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1866 p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \
1867 p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
1878 GTEST_DISALLOW_ASSIGN_(name##MatcherP7);\
1880 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1881 typename p3##_type, typename p4##_type, typename p5##_type, \
1882 typename p6##_type>\
1883 inline name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
1884 p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
1885 p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
1887 return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
1888 p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
1890 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1891 typename p3##_type, typename p4##_type, typename p5##_type, \
1892 typename p6##_type>\
1893 template <typename arg_type>\
1894 bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1895 p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1897 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1900 #define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\
1901 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1902 typename p3##_type, typename p4##_type, typename p5##_type, \
1903 typename p6##_type, typename p7##_type>\
1904 class name##MatcherP8 {\
1906 template <typename arg_type>\
1907 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1909 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1910 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1911 p6##_type gmock_p6, p7##_type gmock_p7)\
1912 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
1913 p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\
1914 virtual bool MatchAndExplain(\
1915 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1916 virtual void DescribeTo(::std::ostream* gmock_os) const {\
1917 *gmock_os << FormatDescription(false);\
1919 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1920 *gmock_os << FormatDescription(true);\
1931 ::testing::internal::string FormatDescription(bool negation) const {\
1932 const ::testing::internal::string gmock_description = (description);\
1933 if (!gmock_description.empty())\
1934 return gmock_description;\
1935 return ::testing::internal::FormatMatcherDescription(\
1937 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1938 ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1939 p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
1940 p3, p4, p5, p6, p7)));\
1942 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1944 template <typename arg_type>\
1945 operator ::testing::Matcher<arg_type>() const {\
1946 return ::testing::Matcher<arg_type>(\
1947 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7));\
1949 name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \
1950 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1951 p5##_type gmock_p5, p6##_type gmock_p6, \
1952 p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
1953 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
1965 GTEST_DISALLOW_ASSIGN_(name##MatcherP8);\
1967 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1968 typename p3##_type, typename p4##_type, typename p5##_type, \
1969 typename p6##_type, typename p7##_type>\
1970 inline name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
1971 p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
1972 p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
1973 p6##_type p6, p7##_type p7) {\
1974 return name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
1975 p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
1978 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1979 typename p3##_type, typename p4##_type, typename p5##_type, \
1980 typename p6##_type, typename p7##_type>\
1981 template <typename arg_type>\
1982 bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1983 p5##_type, p6##_type, \
1984 p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1986 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1989 #define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\
1990 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1991 typename p3##_type, typename p4##_type, typename p5##_type, \
1992 typename p6##_type, typename p7##_type, typename p8##_type>\
1993 class name##MatcherP9 {\
1995 template <typename arg_type>\
1996 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1998 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1999 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
2000 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\
2001 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
2002 p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
2004 virtual bool MatchAndExplain(\
2005 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
2006 virtual void DescribeTo(::std::ostream* gmock_os) const {\
2007 *gmock_os << FormatDescription(false);\
2009 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
2010 *gmock_os << FormatDescription(true);\
2022 ::testing::internal::string FormatDescription(bool negation) const {\
2023 const ::testing::internal::string gmock_description = (description);\
2024 if (!gmock_description.empty())\
2025 return gmock_description;\
2026 return ::testing::internal::FormatMatcherDescription(\
2028 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
2029 ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
2030 p4##_type, p5##_type, p6##_type, p7##_type, \
2031 p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
2033 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
2035 template <typename arg_type>\
2036 operator ::testing::Matcher<arg_type>() const {\
2037 return ::testing::Matcher<arg_type>(\
2038 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8));\
2040 name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \
2041 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
2042 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
2043 p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
2044 p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
2057 GTEST_DISALLOW_ASSIGN_(name##MatcherP9);\
2059 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2060 typename p3##_type, typename p4##_type, typename p5##_type, \
2061 typename p6##_type, typename p7##_type, typename p8##_type>\
2062 inline name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
2063 p4##_type, p5##_type, p6##_type, p7##_type, \
2064 p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
2065 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
2067 return name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
2068 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
2069 p3, p4, p5, p6, p7, p8);\
2071 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2072 typename p3##_type, typename p4##_type, typename p5##_type, \
2073 typename p6##_type, typename p7##_type, typename p8##_type>\
2074 template <typename arg_type>\
2075 bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
2076 p5##_type, p6##_type, p7##_type, \
2077 p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
2079 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
2082 #define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)\
2083 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2084 typename p3##_type, typename p4##_type, typename p5##_type, \
2085 typename p6##_type, typename p7##_type, typename p8##_type, \
2086 typename p9##_type>\
2087 class name##MatcherP10 {\
2089 template <typename arg_type>\
2090 class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
2092 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
2093 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
2094 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
2095 p9##_type gmock_p9)\
2096 : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
2097 p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
2098 p8(gmock_p8), p9(gmock_p9) {}\
2099 virtual bool MatchAndExplain(\
2100 arg_type arg, ::testing::MatchResultListener* result_listener) const;\
2101 virtual void DescribeTo(::std::ostream* gmock_os) const {\
2102 *gmock_os << FormatDescription(false);\
2104 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
2105 *gmock_os << FormatDescription(true);\
2118 ::testing::internal::string FormatDescription(bool negation) const {\
2119 const ::testing::internal::string gmock_description = (description);\
2120 if (!gmock_description.empty())\
2121 return gmock_description;\
2122 return ::testing::internal::FormatMatcherDescription(\
2124 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
2125 ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
2126 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
2127 p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
2129 GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
2131 template <typename arg_type>\
2132 operator ::testing::Matcher<arg_type>() const {\
2133 return ::testing::Matcher<arg_type>(\
2134 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9));\
2136 name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \
2137 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
2138 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
2139 p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \
2140 p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
2141 p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {\
2154 GTEST_DISALLOW_ASSIGN_(name##MatcherP10);\
2156 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2157 typename p3##_type, typename p4##_type, typename p5##_type, \
2158 typename p6##_type, typename p7##_type, typename p8##_type, \
2159 typename p9##_type>\
2160 inline name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2161 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
2162 p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
2163 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
2165 return name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2166 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
2167 p1, p2, p3, p4, p5, p6, p7, p8, p9);\
2169 template <typename p0##_type, typename p1##_type, typename p2##_type, \
2170 typename p3##_type, typename p4##_type, typename p5##_type, \
2171 typename p6##_type, typename p7##_type, typename p8##_type, \
2172 typename p9##_type>\
2173 template <typename arg_type>\
2174 bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2175 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
2176 p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
2178 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
2181 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_