gmock-generated-matchers.h
Go to the documentation of this file.
1 // This file was GENERATED by command:
2 // pump.py gmock-generated-matchers.h.pump
3 // DO NOT EDIT BY HAND!!!
4 
5 // Copyright 2008, Google Inc.
6 // All rights reserved.
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions are
10 // met:
11 //
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
17 // distribution.
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.
21 //
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.
33 
34 // Google Mock - a framework for writing C++ mock classes.
35 //
36 // This file implements some commonly used variadic matchers.
37 
38 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
39 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
40 
41 #include <iterator>
42 #include <sstream>
43 #include <string>
44 #include <vector>
45 #include "gmock/gmock-matchers.h"
46 
47 namespace testing
48 {
49 namespace internal
50 {
51 
52 // The type of the i-th (0-based) field of Tuple.
53 #define GMOCK_FIELD_TYPE_(Tuple, i) \
54  typename ::std::tr1::tuple_element<i, Tuple>::type
55 
56 // TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
57 // tuple of type Tuple. It has two members:
58 //
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.
61 //
62 // For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:
63 //
64 // type is tuple<int, bool>, and
65 // GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).
66 
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,
69  int k9 = -1 >
70 class TupleFields;
71 
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>
75 class TupleFields
76 {
77 public:
78  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
79  GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
80  GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
81  GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
82  GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8),
83  GMOCK_FIELD_TYPE_(Tuple, k9)> type;
84  static type GetSelectedFields(const Tuple & t)
85  {
87  return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
88  get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t));
89  }
90 };
91 
92 // The following specialization is used for 0 ~ 9 selectors.
93 
94 template <class Tuple>
95 class TupleFields < Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 >
96 {
97 public:
98  typedef ::std::tr1::tuple<> type;
99  static type GetSelectedFields(const Tuple & /* t */)
100  {
102  return type();
103  }
104 };
105 
106 template <class Tuple, int k0>
107 class TupleFields < Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1 >
108 {
109 public:
110  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type;
111  static type GetSelectedFields(const Tuple & t)
112  {
114  return type(get<k0>(t));
115  }
116 };
117 
118 template <class Tuple, int k0, int k1>
119 class TupleFields < Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1 >
120 {
121 public:
122  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
123  GMOCK_FIELD_TYPE_(Tuple, k1)> type;
124  static type GetSelectedFields(const Tuple & t)
125  {
127  return type(get<k0>(t), get<k1>(t));
128  }
129 };
130 
131 template <class Tuple, int k0, int k1, int k2>
132 class TupleFields < Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1 >
133 {
134 public:
135  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
136  GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type;
137  static type GetSelectedFields(const Tuple & t)
138  {
140  return type(get<k0>(t), get<k1>(t), get<k2>(t));
141  }
142 };
143 
144 template <class Tuple, int k0, int k1, int k2, int k3>
145 class TupleFields < Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1 >
146 {
147 public:
148  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
149  GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
150  GMOCK_FIELD_TYPE_(Tuple, k3)> type;
151  static type GetSelectedFields(const Tuple & t)
152  {
154  return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t));
155  }
156 };
157 
158 template <class Tuple, int k0, int k1, int k2, int k3, int k4>
159 class TupleFields < Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1 >
160 {
161 public:
162  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
163  GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
164  GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4)> type;
165  static type GetSelectedFields(const Tuple & t)
166  {
168  return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t));
169  }
170 };
171 
172 template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5>
173 class TupleFields < Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1 >
174 {
175 public:
176  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
177  GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
178  GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
179  GMOCK_FIELD_TYPE_(Tuple, k5)> type;
180  static type GetSelectedFields(const Tuple & t)
181  {
183  return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
184  get<k5>(t));
185  }
186 };
187 
188 template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6>
189 class TupleFields < Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1 >
190 {
191 public:
192  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
193  GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
194  GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
195  GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6)> type;
196  static type GetSelectedFields(const Tuple & t)
197  {
199  return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
200  get<k5>(t), get<k6>(t));
201  }
202 };
203 
204 template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
205  int k7>
206 class TupleFields < Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1 >
207 {
208 public:
209  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
210  GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
211  GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
212  GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
213  GMOCK_FIELD_TYPE_(Tuple, k7)> type;
214  static type GetSelectedFields(const Tuple & t)
215  {
217  return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
218  get<k5>(t), get<k6>(t), get<k7>(t));
219  }
220 };
221 
222 template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
223  int k7, int k8>
224 class TupleFields < Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1 >
225 {
226 public:
227  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
228  GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
229  GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
230  GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
231  GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8)> type;
232  static type GetSelectedFields(const Tuple & t)
233  {
235  return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
236  get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t));
237  }
238 };
239 
240 #undef GMOCK_FIELD_TYPE_
241 
242 // Implements the Args() matcher.
243 template < class ArgsTuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
244  int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
245  int k9 = -1 >
246 class ArgsMatcherImpl : public MatcherInterface<ArgsTuple>
247 {
248 public:
249  // ArgsTuple may have top-level const or reference modifiers.
250  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple;
251  typedef typename internal::TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5,
252  k6, k7, k8, k9>::type SelectedArgs;
254 
255  template <typename InnerMatcher>
256  explicit ArgsMatcherImpl(const InnerMatcher & inner_matcher)
257  : inner_matcher_(SafeMatcherCast<const SelectedArgs & >(inner_matcher)) {}
258 
259  virtual bool MatchAndExplain(ArgsTuple args,
260  MatchResultListener * listener) const
261  {
262  const SelectedArgs & selected_args = GetSelectedArgs(args);
263 
264  if (!listener->IsInterested())
265  { return inner_matcher_.Matches(selected_args); }
266 
267  PrintIndices(listener->stream());
268  *listener << "are " << PrintToString(selected_args);
269 
270  StringMatchResultListener inner_listener;
271  const bool match = inner_matcher_.MatchAndExplain(selected_args,
272  &inner_listener);
273  PrintIfNotEmpty(inner_listener.str(), listener->stream());
274  return match;
275  }
276 
277  virtual void DescribeTo(::std::ostream * os) const
278  {
279  *os << "are a tuple ";
280  PrintIndices(os);
281  inner_matcher_.DescribeTo(os);
282  }
283 
284  virtual void DescribeNegationTo(::std::ostream * os) const
285  {
286  *os << "are a tuple ";
287  PrintIndices(os);
288  inner_matcher_.DescribeNegationTo(os);
289  }
290 
291 private:
292  static SelectedArgs GetSelectedArgs(ArgsTuple args)
293  {
294  return TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5, k6, k7, k8,
295  k9>::GetSelectedFields(args);
296  }
297 
298  // Prints the indices of the selected fields.
299  static void PrintIndices(::std::ostream * os)
300  {
301  *os << "whose fields (";
302  const int indices[10] = { k0, k1, k2, k3, k4, k5, k6, k7, k8, k9 };
303 
304  for (int i = 0; i < 10; i++)
305  {
306  if (indices[i] < 0)
307  { break; }
308 
309  if (i >= 1)
310  { *os << ", "; }
311 
312  *os << "#" << indices[i];
313  }
314 
315  *os << ") ";
316  }
317 
318  const MonomorphicInnerMatcher inner_matcher_;
319 
321 };
322 
323 template < class InnerMatcher, int k0 = -1, int k1 = -1, int k2 = -1,
324  int k3 = -1, int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1,
325  int k8 = -1, int k9 = -1 >
326 class ArgsMatcher
327 {
328 public:
329  explicit ArgsMatcher(const InnerMatcher & inner_matcher)
330  : inner_matcher_(inner_matcher) {}
331 
332  template <typename ArgsTuple>
333  operator Matcher<ArgsTuple>() const
334  {
335  return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, k0, k1, k2, k3, k4, k5,
336  k6, k7, k8, k9>(inner_matcher_));
337  }
338 
339 private:
340  const InnerMatcher inner_matcher_;
341 
343 };
344 
345 // A set of metafunctions for computing the result type of AllOf.
346 // AllOf(m1, ..., mN) returns
347 // AllOfResultN<decltype(m1), ..., decltype(mN)>::type.
348 
349 // Although AllOf isn't defined for one argument, AllOfResult1 is defined
350 // to simplify the implementation.
351 template <typename M1>
352 struct AllOfResult1
353 {
354  typedef M1 type;
355 };
356 
357 template <typename M1, typename M2>
358 struct AllOfResult2
359 {
360  typedef BothOfMatcher <
361  typename AllOfResult1<M1>::type,
362  typename AllOfResult1<M2>::type
363  > type;
364 };
365 
366 template <typename M1, typename M2, typename M3>
367 struct AllOfResult3
368 {
369  typedef BothOfMatcher <
370  typename AllOfResult1<M1>::type,
372  > type;
373 };
374 
375 template <typename M1, typename M2, typename M3, typename M4>
376 struct AllOfResult4
377 {
378  typedef BothOfMatcher <
381  > type;
382 };
383 
384 template <typename M1, typename M2, typename M3, typename M4, typename M5>
385 struct AllOfResult5
386 {
387  typedef BothOfMatcher <
390  > type;
391 };
392 
393 template <typename M1, typename M2, typename M3, typename M4, typename M5,
394  typename M6>
395 struct AllOfResult6
396 {
397  typedef BothOfMatcher <
400  > type;
401 };
402 
403 template <typename M1, typename M2, typename M3, typename M4, typename M5,
404  typename M6, typename M7>
405 struct AllOfResult7
406 {
407  typedef BothOfMatcher <
410  > type;
411 };
412 
413 template <typename M1, typename M2, typename M3, typename M4, typename M5,
414  typename M6, typename M7, typename M8>
415 struct AllOfResult8
416 {
417  typedef BothOfMatcher <
420  > type;
421 };
422 
423 template <typename M1, typename M2, typename M3, typename M4, typename M5,
424  typename M6, typename M7, typename M8, typename M9>
425 struct AllOfResult9
426 {
427  typedef BothOfMatcher <
430  > type;
431 };
432 
433 template <typename M1, typename M2, typename M3, typename M4, typename M5,
434  typename M6, typename M7, typename M8, typename M9, typename M10>
435 struct AllOfResult10
436 {
437  typedef BothOfMatcher <
440  > type;
441 };
442 
443 // A set of metafunctions for computing the result type of AnyOf.
444 // AnyOf(m1, ..., mN) returns
445 // AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.
446 
447 // Although AnyOf isn't defined for one argument, AnyOfResult1 is defined
448 // to simplify the implementation.
449 template <typename M1>
450 struct AnyOfResult1
451 {
452  typedef M1 type;
453 };
454 
455 template <typename M1, typename M2>
456 struct AnyOfResult2
457 {
458  typedef EitherOfMatcher <
459  typename AnyOfResult1<M1>::type,
460  typename AnyOfResult1<M2>::type
461  > type;
462 };
463 
464 template <typename M1, typename M2, typename M3>
465 struct AnyOfResult3
466 {
467  typedef EitherOfMatcher <
468  typename AnyOfResult1<M1>::type,
470  > type;
471 };
472 
473 template <typename M1, typename M2, typename M3, typename M4>
474 struct AnyOfResult4
475 {
476  typedef EitherOfMatcher <
479  > type;
480 };
481 
482 template <typename M1, typename M2, typename M3, typename M4, typename M5>
483 struct AnyOfResult5
484 {
485  typedef EitherOfMatcher <
488  > type;
489 };
490 
491 template <typename M1, typename M2, typename M3, typename M4, typename M5,
492  typename M6>
493 struct AnyOfResult6
494 {
495  typedef EitherOfMatcher <
498  > type;
499 };
500 
501 template <typename M1, typename M2, typename M3, typename M4, typename M5,
502  typename M6, typename M7>
503 struct AnyOfResult7
504 {
505  typedef EitherOfMatcher <
508  > type;
509 };
510 
511 template <typename M1, typename M2, typename M3, typename M4, typename M5,
512  typename M6, typename M7, typename M8>
513 struct AnyOfResult8
514 {
515  typedef EitherOfMatcher <
518  > type;
519 };
520 
521 template <typename M1, typename M2, typename M3, typename M4, typename M5,
522  typename M6, typename M7, typename M8, typename M9>
523 struct AnyOfResult9
524 {
525  typedef EitherOfMatcher <
528  > type;
529 };
530 
531 template <typename M1, typename M2, typename M3, typename M4, typename M5,
532  typename M6, typename M7, typename M8, typename M9, typename M10>
533 struct AnyOfResult10
534 {
535  typedef EitherOfMatcher <
538  > type;
539 };
540 
541 } // namespace internal
542 
543 // Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
544 // fields of it matches a_matcher. C++ doesn't support default
545 // arguments for function templates, so we have to overload it.
546 template <typename InnerMatcher>
548 Args(const InnerMatcher & matcher)
549 {
550  return internal::ArgsMatcher<InnerMatcher>(matcher);
551 }
552 
553 template <int k1, typename InnerMatcher>
555 Args(const InnerMatcher & matcher)
556 {
558 }
559 
560 template <int k1, int k2, typename InnerMatcher>
562 Args(const InnerMatcher & matcher)
563 {
565 }
566 
567 template <int k1, int k2, int k3, typename InnerMatcher>
569 Args(const InnerMatcher & matcher)
570 {
572 }
573 
574 template <int k1, int k2, int k3, int k4, typename InnerMatcher>
576 Args(const InnerMatcher & matcher)
577 {
579 }
580 
581 template <int k1, int k2, int k3, int k4, int k5, typename InnerMatcher>
583 Args(const InnerMatcher & matcher)
584 {
586 }
587 
588 template <int k1, int k2, int k3, int k4, int k5, int k6, typename InnerMatcher>
590 Args(const InnerMatcher & matcher)
591 {
593 }
594 
595 template <int k1, int k2, int k3, int k4, int k5, int k6, int k7,
596  typename InnerMatcher>
598 Args(const InnerMatcher & matcher)
599 {
600  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6,
601  k7>(matcher);
602 }
603 
604 template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
605  typename InnerMatcher>
607 Args(const InnerMatcher & matcher)
608 {
609  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7,
610  k8>(matcher);
611 }
612 
613 template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
614  int k9, typename InnerMatcher>
616 Args(const InnerMatcher & matcher)
617 {
618  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
619  k9>(matcher);
620 }
621 
622 template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
623  int k9, int k10, typename InnerMatcher>
624 inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9,
625  k10>
626  Args(const InnerMatcher & matcher)
627 {
628  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
629  k9, k10>(matcher);
630 }
631 
632 // ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with
633 // n elements, where the i-th element in the container must
634 // match the i-th argument in the list. Each argument of
635 // ElementsAre() can be either a value or a matcher. We support up to
636 // 10 arguments.
637 //
638 // The use of DecayArray in the implementation allows ElementsAre()
639 // to accept string literals, whose type is const char[N], but we
640 // want to treat them as const char*.
641 //
642 // NOTE: Since ElementsAre() cares about the order of the elements, it
643 // must not be used with containers whose elements's order is
644 // undefined (e.g. hash_map).
645 
648 ElementsAre()
649 {
650  typedef std::tr1::tuple<> Args;
652 }
653 
654 template <typename T1>
658 ElementsAre(const T1 & e1)
659 {
660  typedef std::tr1::tuple <
663 }
664 
665 template <typename T1, typename T2>
669  typename internal::DecayArray<T2>::type > >
670  ElementsAre(const T1 & e1, const T2 & e2)
671 {
672  typedef std::tr1::tuple <
673  typename internal::DecayArray<T1>::type,
676 }
677 
678 template <typename T1, typename T2, typename T3>
681 typename internal::DecayArray<T1>::type,
683  typename internal::DecayArray<T3>::type > >
684  ElementsAre(const T1 & e1, const T2 & e2, const T3 & e3)
685 {
686  typedef std::tr1::tuple <
687  typename internal::DecayArray<T1>::type,
688  typename internal::DecayArray<T2>::type,
690  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3));
691 }
692 
693 template <typename T1, typename T2, typename T3, typename T4>
696 typename internal::DecayArray<T1>::type,
697  typename internal::DecayArray<T2>::type,
699  typename internal::DecayArray<T4>::type > >
700  ElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4)
701 {
702  typedef std::tr1::tuple <
703  typename internal::DecayArray<T1>::type,
704  typename internal::DecayArray<T2>::type,
705  typename internal::DecayArray<T3>::type,
707  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4));
708 }
709 
710 template <typename T1, typename T2, typename T3, typename T4, typename T5>
713 typename internal::DecayArray<T1>::type,
714  typename internal::DecayArray<T2>::type,
715  typename internal::DecayArray<T3>::type,
717  typename internal::DecayArray<T5>::type > >
718  ElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4,
719  const T5 & e5)
720 {
721  typedef std::tr1::tuple <
722  typename internal::DecayArray<T1>::type,
723  typename internal::DecayArray<T2>::type,
724  typename internal::DecayArray<T3>::type,
725  typename internal::DecayArray<T4>::type,
727  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5));
728 }
729 
730 template <typename T1, typename T2, typename T3, typename T4, typename T5,
731  typename T6>
734 typename internal::DecayArray<T1>::type,
735  typename internal::DecayArray<T2>::type,
736  typename internal::DecayArray<T3>::type,
737  typename internal::DecayArray<T4>::type,
739  typename internal::DecayArray<T6>::type > >
740  ElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4,
741  const T5 & e5, const T6 & e6)
742 {
743  typedef std::tr1::tuple <
744  typename internal::DecayArray<T1>::type,
745  typename internal::DecayArray<T2>::type,
746  typename internal::DecayArray<T3>::type,
747  typename internal::DecayArray<T4>::type,
748  typename internal::DecayArray<T5>::type,
750  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6));
751 }
752 
753 template <typename T1, typename T2, typename T3, typename T4, typename T5,
754  typename T6, typename T7>
757 typename internal::DecayArray<T1>::type,
758  typename internal::DecayArray<T2>::type,
759  typename internal::DecayArray<T3>::type,
760  typename internal::DecayArray<T4>::type,
761  typename internal::DecayArray<T5>::type,
763  typename internal::DecayArray<T7>::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)
766 {
767  typedef std::tr1::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,
775  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7));
776 }
777 
778 template <typename T1, typename T2, typename T3, typename T4, typename T5,
779  typename T6, typename T7, typename T8>
782 typename internal::DecayArray<T1>::type,
783  typename internal::DecayArray<T2>::type,
784  typename internal::DecayArray<T3>::type,
785  typename internal::DecayArray<T4>::type,
786  typename internal::DecayArray<T5>::type,
787  typename internal::DecayArray<T6>::type,
789  typename internal::DecayArray<T8>::type > >
790  ElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4,
791  const T5 & e5, const T6 & e6, const T7 & e7, const T8 & e8)
792 {
793  typedef std::tr1::tuple <
794  typename internal::DecayArray<T1>::type,
795  typename internal::DecayArray<T2>::type,
796  typename internal::DecayArray<T3>::type,
797  typename internal::DecayArray<T4>::type,
798  typename internal::DecayArray<T5>::type,
799  typename internal::DecayArray<T6>::type,
800  typename internal::DecayArray<T7>::type,
802  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
803  e8));
804 }
805 
806 template <typename T1, typename T2, typename T3, typename T4, typename T5,
807  typename T6, typename T7, typename T8, typename T9>
810 typename internal::DecayArray<T1>::type,
811  typename internal::DecayArray<T2>::type,
812  typename internal::DecayArray<T3>::type,
813  typename internal::DecayArray<T4>::type,
814  typename internal::DecayArray<T5>::type,
815  typename internal::DecayArray<T6>::type,
816  typename internal::DecayArray<T7>::type,
818  typename internal::DecayArray<T9>::type > >
819  ElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4,
820  const T5 & e5, const T6 & e6, const T7 & e7, const T8 & e8, const T9 & e9)
821 {
822  typedef std::tr1::tuple <
823  typename internal::DecayArray<T1>::type,
824  typename internal::DecayArray<T2>::type,
825  typename internal::DecayArray<T3>::type,
826  typename internal::DecayArray<T4>::type,
827  typename internal::DecayArray<T5>::type,
828  typename internal::DecayArray<T6>::type,
829  typename internal::DecayArray<T7>::type,
830  typename internal::DecayArray<T8>::type,
832  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
833  e8, e9));
834 }
835 
836 template <typename T1, typename T2, typename T3, typename T4, typename T5,
837  typename T6, typename T7, typename T8, typename T9, typename T10>
840 typename internal::DecayArray<T1>::type,
841  typename internal::DecayArray<T2>::type,
842  typename internal::DecayArray<T3>::type,
843  typename internal::DecayArray<T4>::type,
844  typename internal::DecayArray<T5>::type,
845  typename internal::DecayArray<T6>::type,
846  typename internal::DecayArray<T7>::type,
847  typename internal::DecayArray<T8>::type,
850  ElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4,
851  const T5 & e5, const T6 & e6, const T7 & e7, const T8 & e8, const T9 & e9,
852  const T10 & e10)
853 {
854  typedef std::tr1::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,
860  typename internal::DecayArray<T6>::type,
861  typename internal::DecayArray<T7>::type,
862  typename internal::DecayArray<T8>::type,
863  typename internal::DecayArray<T9>::type,
865  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
866  e8, e9, e10));
867 }
868 
869 // UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
870 // that matches n elements in any order. We support up to n=10 arguments.
871 
875 {
876  typedef std::tr1::tuple<> Args;
878 }
879 
880 template <typename T1>
883 typename internal::DecayArray<T1>::type > >
884 UnorderedElementsAre(const T1 & e1)
885 {
886  typedef std::tr1::tuple <
887  typename internal::DecayArray<T1>::type > Args;
889 }
890 
891 template <typename T1, typename T2>
894 typename internal::DecayArray<T1>::type,
895  typename internal::DecayArray<T2>::type > >
896  UnorderedElementsAre(const T1 & e1, const T2 & e2)
897 {
898  typedef std::tr1::tuple <
899  typename internal::DecayArray<T1>::type,
900  typename internal::DecayArray<T2>::type > Args;
902 }
903 
904 template <typename T1, typename T2, typename T3>
907 typename internal::DecayArray<T1>::type,
908  typename internal::DecayArray<T2>::type,
909  typename internal::DecayArray<T3>::type > >
910  UnorderedElementsAre(const T1 & e1, const T2 & e2, const T3 & e3)
911 {
912  typedef std::tr1::tuple <
913  typename internal::DecayArray<T1>::type,
914  typename internal::DecayArray<T2>::type,
915  typename internal::DecayArray<T3>::type > Args;
917 }
918 
919 template <typename T1, typename T2, typename T3, typename T4>
922 typename internal::DecayArray<T1>::type,
923  typename internal::DecayArray<T2>::type,
924  typename internal::DecayArray<T3>::type,
925  typename internal::DecayArray<T4>::type > >
926  UnorderedElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4)
927 {
928  typedef std::tr1::tuple <
929  typename internal::DecayArray<T1>::type,
930  typename internal::DecayArray<T2>::type,
931  typename internal::DecayArray<T3>::type,
932  typename internal::DecayArray<T4>::type > Args;
933  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4));
934 }
935 
936 template <typename T1, typename T2, typename T3, typename T4, typename T5>
939 typename internal::DecayArray<T1>::type,
940  typename internal::DecayArray<T2>::type,
941  typename internal::DecayArray<T3>::type,
942  typename internal::DecayArray<T4>::type,
943  typename internal::DecayArray<T5>::type > >
944  UnorderedElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4,
945  const T5 & e5)
946 {
947  typedef std::tr1::tuple <
948  typename internal::DecayArray<T1>::type,
949  typename internal::DecayArray<T2>::type,
950  typename internal::DecayArray<T3>::type,
951  typename internal::DecayArray<T4>::type,
952  typename internal::DecayArray<T5>::type > Args;
953  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5));
954 }
955 
956 template <typename T1, typename T2, typename T3, typename T4, typename T5,
957  typename T6>
960 typename internal::DecayArray<T1>::type,
961  typename internal::DecayArray<T2>::type,
962  typename internal::DecayArray<T3>::type,
963  typename internal::DecayArray<T4>::type,
964  typename internal::DecayArray<T5>::type,
965  typename internal::DecayArray<T6>::type > >
966  UnorderedElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4,
967  const T5 & e5, const T6 & e6)
968 {
969  typedef std::tr1::tuple <
970  typename internal::DecayArray<T1>::type,
971  typename internal::DecayArray<T2>::type,
972  typename internal::DecayArray<T3>::type,
973  typename internal::DecayArray<T4>::type,
974  typename internal::DecayArray<T5>::type,
975  typename internal::DecayArray<T6>::type > Args;
976  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
977  e6));
978 }
979 
980 template <typename T1, typename T2, typename T3, typename T4, typename T5,
981  typename T6, typename T7>
984 typename internal::DecayArray<T1>::type,
985  typename internal::DecayArray<T2>::type,
986  typename internal::DecayArray<T3>::type,
987  typename internal::DecayArray<T4>::type,
988  typename internal::DecayArray<T5>::type,
989  typename internal::DecayArray<T6>::type,
990  typename internal::DecayArray<T7>::type > >
991  UnorderedElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4,
992  const T5 & e5, const T6 & e6, const T7 & e7)
993 {
994  typedef std::tr1::tuple <
995  typename internal::DecayArray<T1>::type,
996  typename internal::DecayArray<T2>::type,
997  typename internal::DecayArray<T3>::type,
998  typename internal::DecayArray<T4>::type,
999  typename internal::DecayArray<T5>::type,
1000  typename internal::DecayArray<T6>::type,
1001  typename internal::DecayArray<T7>::type > Args;
1002  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
1003  e6, e7));
1004 }
1005 
1006 template <typename T1, typename T2, typename T3, typename T4, typename T5,
1007  typename T6, typename T7, typename T8>
1010 typename internal::DecayArray<T1>::type,
1011  typename internal::DecayArray<T2>::type,
1012  typename internal::DecayArray<T3>::type,
1013  typename internal::DecayArray<T4>::type,
1014  typename internal::DecayArray<T5>::type,
1015  typename internal::DecayArray<T6>::type,
1016  typename internal::DecayArray<T7>::type,
1017  typename internal::DecayArray<T8>::type > >
1018  UnorderedElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4,
1019  const T5 & e5, const T6 & e6, const T7 & e7, const T8 & e8)
1020 {
1021  typedef std::tr1::tuple <
1022  typename internal::DecayArray<T1>::type,
1023  typename internal::DecayArray<T2>::type,
1024  typename internal::DecayArray<T3>::type,
1025  typename internal::DecayArray<T4>::type,
1026  typename internal::DecayArray<T5>::type,
1027  typename internal::DecayArray<T6>::type,
1028  typename internal::DecayArray<T7>::type,
1029  typename internal::DecayArray<T8>::type > Args;
1030  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
1031  e6, e7, e8));
1032 }
1033 
1034 template <typename T1, typename T2, typename T3, typename T4, typename T5,
1035  typename T6, typename T7, typename T8, typename T9>
1038 typename internal::DecayArray<T1>::type,
1039  typename internal::DecayArray<T2>::type,
1040  typename internal::DecayArray<T3>::type,
1041  typename internal::DecayArray<T4>::type,
1042  typename internal::DecayArray<T5>::type,
1043  typename internal::DecayArray<T6>::type,
1044  typename internal::DecayArray<T7>::type,
1045  typename internal::DecayArray<T8>::type,
1046  typename internal::DecayArray<T9>::type > >
1047  UnorderedElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4,
1048  const T5 & e5, const T6 & e6, const T7 & e7, const T8 & e8, const T9 & e9)
1049 {
1050  typedef std::tr1::tuple <
1051  typename internal::DecayArray<T1>::type,
1052  typename internal::DecayArray<T2>::type,
1053  typename internal::DecayArray<T3>::type,
1054  typename internal::DecayArray<T4>::type,
1055  typename internal::DecayArray<T5>::type,
1056  typename internal::DecayArray<T6>::type,
1057  typename internal::DecayArray<T7>::type,
1058  typename internal::DecayArray<T8>::type,
1059  typename internal::DecayArray<T9>::type > Args;
1060  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
1061  e6, e7, e8, e9));
1062 }
1063 
1064 template <typename T1, typename T2, typename T3, typename T4, typename T5,
1065  typename T6, typename T7, typename T8, typename T9, typename T10>
1068 typename internal::DecayArray<T1>::type,
1069  typename internal::DecayArray<T2>::type,
1070  typename internal::DecayArray<T3>::type,
1071  typename internal::DecayArray<T4>::type,
1072  typename internal::DecayArray<T5>::type,
1073  typename internal::DecayArray<T6>::type,
1074  typename internal::DecayArray<T7>::type,
1075  typename internal::DecayArray<T8>::type,
1076  typename internal::DecayArray<T9>::type,
1077  typename internal::DecayArray<T10>::type > >
1078  UnorderedElementsAre(const T1 & e1, const T2 & e2, const T3 & e3, const T4 & e4,
1079  const T5 & e5, const T6 & e6, const T7 & e7, const T8 & e8, const T9 & e9,
1080  const T10 & e10)
1081 {
1082  typedef std::tr1::tuple <
1083  typename internal::DecayArray<T1>::type,
1084  typename internal::DecayArray<T2>::type,
1085  typename internal::DecayArray<T3>::type,
1086  typename internal::DecayArray<T4>::type,
1087  typename internal::DecayArray<T5>::type,
1088  typename internal::DecayArray<T6>::type,
1089  typename internal::DecayArray<T7>::type,
1090  typename internal::DecayArray<T8>::type,
1091  typename internal::DecayArray<T9>::type,
1093  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
1094  e6, e7, e8, e9, e10));
1095 }
1096 
1097 // AllOf(m1, m2, ..., mk) matches any value that matches all of the given
1098 // sub-matchers. AllOf is called fully qualified to prevent ADL from firing.
1099 
1100 template <typename M1, typename M2>
1102 AllOf(M1 m1, M2 m2)
1103 {
1104  return typename internal::AllOfResult2<M1, M2>::type(
1105  m1,
1106  m2);
1107 }
1108 
1109 template <typename M1, typename M2, typename M3>
1111 AllOf(M1 m1, M2 m2, M3 m3)
1112 {
1114  m1,
1115  ::testing::AllOf(m2, m3));
1116 }
1117 
1118 template <typename M1, typename M2, typename M3, typename M4>
1120 AllOf(M1 m1, M2 m2, M3 m3, M4 m4)
1121 {
1123  ::testing::AllOf(m1, m2),
1124  ::testing::AllOf(m3, m4));
1125 }
1126 
1127 template <typename M1, typename M2, typename M3, typename M4, typename M5>
1129 AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5)
1130 {
1132  ::testing::AllOf(m1, m2),
1133  ::testing::AllOf(m3, m4, m5));
1134 }
1135 
1136 template <typename M1, typename M2, typename M3, typename M4, typename M5,
1137  typename M6>
1139 AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6)
1140 {
1142  ::testing::AllOf(m1, m2, m3),
1143  ::testing::AllOf(m4, m5, m6));
1144 }
1145 
1146 template <typename M1, typename M2, typename M3, typename M4, typename M5,
1147  typename M6, typename M7>
1149 AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7)
1150 {
1152  ::testing::AllOf(m1, m2, m3),
1153  ::testing::AllOf(m4, m5, m6, m7));
1154 }
1155 
1156 template <typename M1, typename M2, typename M3, typename M4, typename M5,
1157  typename M6, typename M7, typename M8>
1159 AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8)
1160 {
1162  ::testing::AllOf(m1, m2, m3, m4),
1163  ::testing::AllOf(m5, m6, m7, m8));
1164 }
1165 
1166 template <typename M1, typename M2, typename M3, typename M4, typename M5,
1167  typename M6, typename M7, typename M8, typename M9>
1169 AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9)
1170 {
1171  return typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,
1172  M9>::type(
1173  ::testing::AllOf(m1, m2, m3, m4),
1174  ::testing::AllOf(m5, m6, m7, m8, m9));
1175 }
1176 
1177 template <typename M1, typename M2, typename M3, typename M4, typename M5,
1178  typename M6, typename M7, typename M8, typename M9, typename M10>
1179 inline typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
1180  M10>::type
1181  AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10)
1182 {
1183  return typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
1184  M10>::type(
1185  ::testing::AllOf(m1, m2, m3, m4, m5),
1186  ::testing::AllOf(m6, m7, m8, m9, m10));
1187 }
1188 
1189 // AnyOf(m1, m2, ..., mk) matches any value that matches any of the given
1190 // sub-matchers. AnyOf is called fully qualified to prevent ADL from firing.
1191 
1192 template <typename M1, typename M2>
1194 AnyOf(M1 m1, M2 m2)
1195 {
1196  return typename internal::AnyOfResult2<M1, M2>::type(
1197  m1,
1198  m2);
1199 }
1200 
1201 template <typename M1, typename M2, typename M3>
1203 AnyOf(M1 m1, M2 m2, M3 m3)
1204 {
1206  m1,
1207  ::testing::AnyOf(m2, m3));
1208 }
1209 
1210 template <typename M1, typename M2, typename M3, typename M4>
1212 AnyOf(M1 m1, M2 m2, M3 m3, M4 m4)
1213 {
1215  ::testing::AnyOf(m1, m2),
1216  ::testing::AnyOf(m3, m4));
1217 }
1218 
1219 template <typename M1, typename M2, typename M3, typename M4, typename M5>
1221 AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5)
1222 {
1224  ::testing::AnyOf(m1, m2),
1225  ::testing::AnyOf(m3, m4, m5));
1226 }
1227 
1228 template <typename M1, typename M2, typename M3, typename M4, typename M5,
1229  typename M6>
1231 AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6)
1232 {
1234  ::testing::AnyOf(m1, m2, m3),
1235  ::testing::AnyOf(m4, m5, m6));
1236 }
1237 
1238 template <typename M1, typename M2, typename M3, typename M4, typename M5,
1239  typename M6, typename M7>
1241 AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7)
1242 {
1244  ::testing::AnyOf(m1, m2, m3),
1245  ::testing::AnyOf(m4, m5, m6, m7));
1246 }
1247 
1248 template <typename M1, typename M2, typename M3, typename M4, typename M5,
1249  typename M6, typename M7, typename M8>
1251 AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8)
1252 {
1254  ::testing::AnyOf(m1, m2, m3, m4),
1255  ::testing::AnyOf(m5, m6, m7, m8));
1256 }
1257 
1258 template <typename M1, typename M2, typename M3, typename M4, typename M5,
1259  typename M6, typename M7, typename M8, typename M9>
1261 AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9)
1262 {
1263  return typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,
1264  M9>::type(
1265  ::testing::AnyOf(m1, m2, m3, m4),
1266  ::testing::AnyOf(m5, m6, m7, m8, m9));
1267 }
1268 
1269 template <typename M1, typename M2, typename M3, typename M4, typename M5,
1270  typename M6, typename M7, typename M8, typename M9, typename M10>
1271 inline typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
1272  M10>::type
1273  AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10)
1274 {
1275  return typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
1276  M10>::type(
1277  ::testing::AnyOf(m1, m2, m3, m4, m5),
1278  ::testing::AnyOf(m6, m7, m8, m9, m10));
1279 }
1280 
1281 } // namespace testing
1282 
1283 
1284 // The MATCHER* family of macros can be used in a namespace scope to
1285 // define custom matchers easily.
1286 //
1287 // Basic Usage
1288 // ===========
1289 //
1290 // The syntax
1291 //
1292 // MATCHER(name, description_string) { statements; }
1293 //
1294 // defines a matcher with the given name that executes the statements,
1295 // which must return a bool to indicate if the match succeeds. Inside
1296 // the statements, you can refer to the value being matched by 'arg',
1297 // and refer to its type by 'arg_type'.
1298 //
1299 // The description string documents what the matcher does, and is used
1300 // to generate the failure message when the match fails. Since a
1301 // MATCHER() is usually defined in a header file shared by multiple
1302 // C++ source files, we require the description to be a C-string
1303 // literal to avoid possible side effects. It can be empty, in which
1304 // case we'll use the sequence of words in the matcher name as the
1305 // description.
1306 //
1307 // For example:
1308 //
1309 // MATCHER(IsEven, "") { return (arg % 2) == 0; }
1310 //
1311 // allows you to write
1312 //
1313 // // Expects mock_foo.Bar(n) to be called where n is even.
1314 // EXPECT_CALL(mock_foo, Bar(IsEven()));
1315 //
1316 // or,
1317 //
1318 // // Verifies that the value of some_expression is even.
1319 // EXPECT_THAT(some_expression, IsEven());
1320 //
1321 // If the above assertion fails, it will print something like:
1322 //
1323 // Value of: some_expression
1324 // Expected: is even
1325 // Actual: 7
1326 //
1327 // where the description "is even" is automatically calculated from the
1328 // matcher name IsEven.
1329 //
1330 // Argument Type
1331 // =============
1332 //
1333 // Note that the type of the value being matched (arg_type) is
1334 // determined by the context in which you use the matcher and is
1335 // supplied to you by the compiler, so you don't need to worry about
1336 // declaring it (nor can you). This allows the matcher to be
1337 // polymorphic. For example, IsEven() can be used to match any type
1338 // where the value of "(arg % 2) == 0" can be implicitly converted to
1339 // a bool. In the "Bar(IsEven())" example above, if method Bar()
1340 // takes an int, 'arg_type' will be int; if it takes an unsigned long,
1341 // 'arg_type' will be unsigned long; and so on.
1342 //
1343 // Parameterizing Matchers
1344 // =======================
1345 //
1346 // Sometimes you'll want to parameterize the matcher. For that you
1347 // can use another macro:
1348 //
1349 // MATCHER_P(name, param_name, description_string) { statements; }
1350 //
1351 // For example:
1352 //
1353 // MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
1354 //
1355 // will allow you to write:
1356 //
1357 // EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
1358 //
1359 // which may lead to this message (assuming n is 10):
1360 //
1361 // Value of: Blah("a")
1362 // Expected: has absolute value 10
1363 // Actual: -9
1364 //
1365 // Note that both the matcher description and its parameter are
1366 // printed, making the message human-friendly.
1367 //
1368 // In the matcher definition body, you can write 'foo_type' to
1369 // reference the type of a parameter named 'foo'. For example, in the
1370 // body of MATCHER_P(HasAbsoluteValue, value) above, you can write
1371 // 'value_type' to refer to the type of 'value'.
1372 //
1373 // We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to
1374 // support multi-parameter matchers.
1375 //
1376 // Describing Parameterized Matchers
1377 // =================================
1378 //
1379 // The last argument to MATCHER*() is a string-typed expression. The
1380 // expression can reference all of the matcher's parameters and a
1381 // special bool-typed variable named 'negation'. When 'negation' is
1382 // false, the expression should evaluate to the matcher's description;
1383 // otherwise it should evaluate to the description of the negation of
1384 // the matcher. For example,
1385 //
1386 // using testing::PrintToString;
1387 //
1388 // MATCHER_P2(InClosedRange, low, hi,
1389 // string(negation ? "is not" : "is") + " in range [" +
1390 // PrintToString(low) + ", " + PrintToString(hi) + "]") {
1391 // return low <= arg && arg <= hi;
1392 // }
1393 // ...
1394 // EXPECT_THAT(3, InClosedRange(4, 6));
1395 // EXPECT_THAT(3, Not(InClosedRange(2, 4)));
1396 //
1397 // would generate two failures that contain the text:
1398 //
1399 // Expected: is in range [4, 6]
1400 // ...
1401 // Expected: is not in range [2, 4]
1402 //
1403 // If you specify "" as the description, the failure message will
1404 // contain the sequence of words in the matcher name followed by the
1405 // parameter values printed as a tuple. For example,
1406 //
1407 // MATCHER_P2(InClosedRange, low, hi, "") { ... }
1408 // ...
1409 // EXPECT_THAT(3, InClosedRange(4, 6));
1410 // EXPECT_THAT(3, Not(InClosedRange(2, 4)));
1411 //
1412 // would generate two failures that contain the text:
1413 //
1414 // Expected: in closed range (4, 6)
1415 // ...
1416 // Expected: not (in closed range (2, 4))
1417 //
1418 // Types of Matcher Parameters
1419 // ===========================
1420 //
1421 // For the purpose of typing, you can view
1422 //
1423 // MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
1424 //
1425 // as shorthand for
1426 //
1427 // template <typename p1_type, ..., typename pk_type>
1428 // FooMatcherPk<p1_type, ..., pk_type>
1429 // Foo(p1_type p1, ..., pk_type pk) { ... }
1430 //
1431 // When you write Foo(v1, ..., vk), the compiler infers the types of
1432 // the parameters v1, ..., and vk for you. If you are not happy with
1433 // the result of the type inference, you can specify the types by
1434 // explicitly instantiating the template, as in Foo<long, bool>(5,
1435 // false). As said earlier, you don't get to (or need to) specify
1436 // 'arg_type' as that's determined by the context in which the matcher
1437 // is used. You can assign the result of expression Foo(p1, ..., pk)
1438 // to a variable of type FooMatcherPk<p1_type, ..., pk_type>. This
1439 // can be useful when composing matchers.
1440 //
1441 // While you can instantiate a matcher template with reference types,
1442 // passing the parameters by pointer usually makes your code more
1443 // readable. If, however, you still want to pass a parameter by
1444 // reference, be aware that in the failure message generated by the
1445 // matcher you will see the value of the referenced object but not its
1446 // address.
1447 //
1448 // Explaining Match Results
1449 // ========================
1450 //
1451 // Sometimes the matcher description alone isn't enough to explain why
1452 // the match has failed or succeeded. For example, when expecting a
1453 // long string, it can be very helpful to also print the diff between
1454 // the expected string and the actual one. To achieve that, you can
1455 // optionally stream additional information to a special variable
1456 // named result_listener, whose type is a pointer to class
1457 // MatchResultListener:
1458 //
1459 // MATCHER_P(EqualsLongString, str, "") {
1460 // if (arg == str) return true;
1461 //
1462 // *result_listener << "the difference: "
1464 // return false;
1465 // }
1466 //
1467 // Overloading Matchers
1468 // ====================
1469 //
1470 // You can overload matchers with different numbers of parameters:
1471 //
1472 // MATCHER_P(Blah, a, description_string1) { ... }
1473 // MATCHER_P2(Blah, a, b, description_string2) { ... }
1474 //
1475 // Caveats
1476 // =======
1477 //
1478 // When defining a new matcher, you should also consider implementing
1479 // MatcherInterface or using MakePolymorphicMatcher(). These
1480 // approaches require more work than the MATCHER* macros, but also
1481 // give you more control on the types of the value being matched and
1482 // the matcher parameters, which may leads to better compiler error
1483 // messages when the matcher is used wrong. They also allow
1484 // overloading matchers based on parameter types (as opposed to just
1485 // based on the number of parameters).
1486 //
1487 // MATCHER*() can only be used in a namespace scope. The reason is
1488 // that C++ doesn't yet allow function-local types to be used to
1489 // instantiate templates. The up-coming C++0x standard will fix this.
1490 // Once that's done, we'll consider supporting using MATCHER*() inside
1491 // a function.
1492 //
1493 // More Information
1494 // ================
1495 //
1496 // To learn more about using these macros, please search for 'MATCHER'
1497 // on http://code.google.com/p/googlemock/wiki/CookBook.
1498 
1499 #define MATCHER(name, description)\
1500  class name##Matcher {\
1501  public:\
1502  template <typename arg_type>\
1503  class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1504  public:\
1505  gmock_Impl()\
1506  {}\
1507  virtual bool MatchAndExplain(\
1508  arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1509  virtual void DescribeTo(::std::ostream* gmock_os) const {\
1510  *gmock_os << FormatDescription(false);\
1511  }\
1512  virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1513  *gmock_os << FormatDescription(true);\
1514  }\
1515  private:\
1516  ::testing::internal::string FormatDescription(bool negation) const {\
1517  const ::testing::internal::string gmock_description = (description);\
1518  if (!gmock_description.empty())\
1519  return gmock_description;\
1520  return ::testing::internal::FormatMatcherDescription(\
1521  negation, #name, \
1522  ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1523  ::std::tr1::tuple<>()));\
1524  }\
1525  GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1526  };\
1527  template <typename arg_type>\
1528  operator ::testing::Matcher<arg_type>() const {\
1529  return ::testing::Matcher<arg_type>(\
1530  new gmock_Impl<arg_type>());\
1531  }\
1532  name##Matcher() {\
1533  }\
1534  private:\
1535  GTEST_DISALLOW_ASSIGN_(name##Matcher);\
1536  };\
1537  inline name##Matcher name() {\
1538  return name##Matcher();\
1539  }\
1540  template <typename arg_type>\
1541  bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\
1542  arg_type arg, \
1543  ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1544  const
1545 
1546 #define MATCHER_P(name, p0, description)\
1547  template <typename p0##_type>\
1548  class name##MatcherP {\
1549  public:\
1550  template <typename arg_type>\
1551  class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1552  public:\
1553  explicit gmock_Impl(p0##_type gmock_p0)\
1554  : p0(gmock_p0) {}\
1555  virtual bool MatchAndExplain(\
1556  arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1557  virtual void DescribeTo(::std::ostream* gmock_os) const {\
1558  *gmock_os << FormatDescription(false);\
1559  }\
1560  virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1561  *gmock_os << FormatDescription(true);\
1562  }\
1563  p0##_type p0;\
1564  private:\
1565  ::testing::internal::string FormatDescription(bool negation) const {\
1566  const ::testing::internal::string gmock_description = (description);\
1567  if (!gmock_description.empty())\
1568  return gmock_description;\
1569  return ::testing::internal::FormatMatcherDescription(\
1570  negation, #name, \
1571  ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1572  ::std::tr1::tuple<p0##_type>(p0)));\
1573  }\
1574  GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1575  };\
1576  template <typename arg_type>\
1577  operator ::testing::Matcher<arg_type>() const {\
1578  return ::testing::Matcher<arg_type>(\
1579  new gmock_Impl<arg_type>(p0));\
1580  }\
1581  name##MatcherP(p0##_type gmock_p0) : p0(gmock_p0) {\
1582  }\
1583  p0##_type p0;\
1584  private:\
1585  GTEST_DISALLOW_ASSIGN_(name##MatcherP);\
1586  };\
1587  template <typename p0##_type>\
1588  inline name##MatcherP<p0##_type> name(p0##_type p0) {\
1589  return name##MatcherP<p0##_type>(p0);\
1590  }\
1591  template <typename p0##_type>\
1592  template <typename arg_type>\
1593  bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1594  arg_type arg, \
1595  ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1596  const
1597 
1598 #define MATCHER_P2(name, p0, p1, description)\
1599  template <typename p0##_type, typename p1##_type>\
1600  class name##MatcherP2 {\
1601  public:\
1602  template <typename arg_type>\
1603  class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1604  public:\
1605  gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\
1606  : p0(gmock_p0), p1(gmock_p1) {}\
1607  virtual bool MatchAndExplain(\
1608  arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1609  virtual void DescribeTo(::std::ostream* gmock_os) const {\
1610  *gmock_os << FormatDescription(false);\
1611  }\
1612  virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1613  *gmock_os << FormatDescription(true);\
1614  }\
1615  p0##_type p0;\
1616  p1##_type p1;\
1617  private:\
1618  ::testing::internal::string FormatDescription(bool negation) const {\
1619  const ::testing::internal::string gmock_description = (description);\
1620  if (!gmock_description.empty())\
1621  return gmock_description;\
1622  return ::testing::internal::FormatMatcherDescription(\
1623  negation, #name, \
1624  ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1625  ::std::tr1::tuple<p0##_type, p1##_type>(p0, p1)));\
1626  }\
1627  GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1628  };\
1629  template <typename arg_type>\
1630  operator ::testing::Matcher<arg_type>() const {\
1631  return ::testing::Matcher<arg_type>(\
1632  new gmock_Impl<arg_type>(p0, p1));\
1633  }\
1634  name##MatcherP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
1635  p1(gmock_p1) {\
1636  }\
1637  p0##_type p0;\
1638  p1##_type p1;\
1639  private:\
1640  GTEST_DISALLOW_ASSIGN_(name##MatcherP2);\
1641  };\
1642  template <typename p0##_type, typename p1##_type>\
1643  inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \
1644  p1##_type p1) {\
1645  return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\
1646  }\
1647  template <typename p0##_type, typename p1##_type>\
1648  template <typename arg_type>\
1649  bool name##MatcherP2<p0##_type, \
1650  p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1651  arg_type arg, \
1652  ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1653  const
1654 
1655 #define MATCHER_P3(name, p0, p1, p2, description)\
1656  template <typename p0##_type, typename p1##_type, typename p2##_type>\
1657  class name##MatcherP3 {\
1658  public:\
1659  template <typename arg_type>\
1660  class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1661  public:\
1662  gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\
1663  : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
1664  virtual bool MatchAndExplain(\
1665  arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1666  virtual void DescribeTo(::std::ostream* gmock_os) const {\
1667  *gmock_os << FormatDescription(false);\
1668  }\
1669  virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1670  *gmock_os << FormatDescription(true);\
1671  }\
1672  p0##_type p0;\
1673  p1##_type p1;\
1674  p2##_type p2;\
1675  private:\
1676  ::testing::internal::string FormatDescription(bool negation) const {\
1677  const ::testing::internal::string gmock_description = (description);\
1678  if (!gmock_description.empty())\
1679  return gmock_description;\
1680  return ::testing::internal::FormatMatcherDescription(\
1681  negation, #name, \
1682  ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1683  ::std::tr1::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \
1684  p2)));\
1685  }\
1686  GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1687  };\
1688  template <typename arg_type>\
1689  operator ::testing::Matcher<arg_type>() const {\
1690  return ::testing::Matcher<arg_type>(\
1691  new gmock_Impl<arg_type>(p0, p1, p2));\
1692  }\
1693  name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \
1694  p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {\
1695  }\
1696  p0##_type p0;\
1697  p1##_type p1;\
1698  p2##_type p2;\
1699  private:\
1700  GTEST_DISALLOW_ASSIGN_(name##MatcherP3);\
1701  };\
1702  template <typename p0##_type, typename p1##_type, typename p2##_type>\
1703  inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
1704  p1##_type p1, p2##_type p2) {\
1705  return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
1706  }\
1707  template <typename p0##_type, typename p1##_type, typename p2##_type>\
1708  template <typename arg_type>\
1709  bool name##MatcherP3<p0##_type, p1##_type, \
1710  p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1711  arg_type arg, \
1712  ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1713  const
1714 
1715 #define MATCHER_P4(name, p0, p1, p2, p3, description)\
1716  template <typename p0##_type, typename p1##_type, typename p2##_type, \
1717  typename p3##_type>\
1718  class name##MatcherP4 {\
1719  public:\
1720  template <typename arg_type>\
1721  class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1722  public:\
1723  gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1724  p3##_type gmock_p3)\
1725  : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3) {}\
1726  virtual bool MatchAndExplain(\
1727  arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1728  virtual void DescribeTo(::std::ostream* gmock_os) const {\
1729  *gmock_os << FormatDescription(false);\
1730  }\
1731  virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1732  *gmock_os << FormatDescription(true);\
1733  }\
1734  p0##_type p0;\
1735  p1##_type p1;\
1736  p2##_type p2;\
1737  p3##_type p3;\
1738  private:\
1739  ::testing::internal::string FormatDescription(bool negation) const {\
1740  const ::testing::internal::string gmock_description = (description);\
1741  if (!gmock_description.empty())\
1742  return gmock_description;\
1743  return ::testing::internal::FormatMatcherDescription(\
1744  negation, #name, \
1745  ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1746  ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, \
1747  p3##_type>(p0, p1, p2, p3)));\
1748  }\
1749  GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1750  };\
1751  template <typename arg_type>\
1752  operator ::testing::Matcher<arg_type>() const {\
1753  return ::testing::Matcher<arg_type>(\
1754  new gmock_Impl<arg_type>(p0, p1, p2, p3));\
1755  }\
1756  name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \
1757  p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \
1758  p2(gmock_p2), p3(gmock_p3) {\
1759  }\
1760  p0##_type p0;\
1761  p1##_type p1;\
1762  p2##_type p2;\
1763  p3##_type p3;\
1764  private:\
1765  GTEST_DISALLOW_ASSIGN_(name##MatcherP4);\
1766  };\
1767  template <typename p0##_type, typename p1##_type, typename p2##_type, \
1768  typename p3##_type>\
1769  inline name##MatcherP4<p0##_type, p1##_type, p2##_type, \
1770  p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1771  p3##_type p3) {\
1772  return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
1773  p1, p2, p3);\
1774  }\
1775  template <typename p0##_type, typename p1##_type, typename p2##_type, \
1776  typename p3##_type>\
1777  template <typename arg_type>\
1778  bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \
1779  p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1780  arg_type arg, \
1781  ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1782  const
1783 
1784 #define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\
1785  template <typename p0##_type, typename p1##_type, typename p2##_type, \
1786  typename p3##_type, typename p4##_type>\
1787  class name##MatcherP5 {\
1788  public:\
1789  template <typename arg_type>\
1790  class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1791  public:\
1792  gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1793  p3##_type gmock_p3, p4##_type gmock_p4)\
1794  : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
1795  p4(gmock_p4) {}\
1796  virtual bool MatchAndExplain(\
1797  arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1798  virtual void DescribeTo(::std::ostream* gmock_os) const {\
1799  *gmock_os << FormatDescription(false);\
1800  }\
1801  virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1802  *gmock_os << FormatDescription(true);\
1803  }\
1804  p0##_type p0;\
1805  p1##_type p1;\
1806  p2##_type p2;\
1807  p3##_type p3;\
1808  p4##_type p4;\
1809  private:\
1810  ::testing::internal::string FormatDescription(bool negation) const {\
1811  const ::testing::internal::string gmock_description = (description);\
1812  if (!gmock_description.empty())\
1813  return gmock_description;\
1814  return ::testing::internal::FormatMatcherDescription(\
1815  negation, #name, \
1816  ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1817  ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1818  p4##_type>(p0, p1, p2, p3, p4)));\
1819  }\
1820  GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1821  };\
1822  template <typename arg_type>\
1823  operator ::testing::Matcher<arg_type>() const {\
1824  return ::testing::Matcher<arg_type>(\
1825  new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\
1826  }\
1827  name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \
1828  p2##_type gmock_p2, p3##_type gmock_p3, \
1829  p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
1830  p3(gmock_p3), p4(gmock_p4) {\
1831  }\
1832  p0##_type p0;\
1833  p1##_type p1;\
1834  p2##_type p2;\
1835  p3##_type p3;\
1836  p4##_type p4;\
1837  private:\
1838  GTEST_DISALLOW_ASSIGN_(name##MatcherP5);\
1839  };\
1840  template <typename p0##_type, typename p1##_type, typename p2##_type, \
1841  typename p3##_type, typename p4##_type>\
1842  inline name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1843  p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1844  p4##_type p4) {\
1845  return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1846  p4##_type>(p0, p1, p2, p3, p4);\
1847  }\
1848  template <typename p0##_type, typename p1##_type, typename p2##_type, \
1849  typename p3##_type, typename p4##_type>\
1850  template <typename arg_type>\
1851  bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1852  p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1853  arg_type arg, \
1854  ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1855  const
1856 
1857 #define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\
1858  template <typename p0##_type, typename p1##_type, typename p2##_type, \
1859  typename p3##_type, typename p4##_type, typename p5##_type>\
1860  class name##MatcherP6 {\
1861  public:\
1862  template <typename arg_type>\
1863  class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1864  public:\
1865  gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1866  p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\
1867  : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
1868  p4(gmock_p4), p5(gmock_p5) {}\
1869  virtual bool MatchAndExplain(\
1870  arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1871  virtual void DescribeTo(::std::ostream* gmock_os) const {\
1872  *gmock_os << FormatDescription(false);\
1873  }\
1874  virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1875  *gmock_os << FormatDescription(true);\
1876  }\
1877  p0##_type p0;\
1878  p1##_type p1;\
1879  p2##_type p2;\
1880  p3##_type p3;\
1881  p4##_type p4;\
1882  p5##_type p5;\
1883  private:\
1884  ::testing::internal::string FormatDescription(bool negation) const {\
1885  const ::testing::internal::string gmock_description = (description);\
1886  if (!gmock_description.empty())\
1887  return gmock_description;\
1888  return ::testing::internal::FormatMatcherDescription(\
1889  negation, #name, \
1890  ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1891  ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1892  p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
1893  }\
1894  GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1895  };\
1896  template <typename arg_type>\
1897  operator ::testing::Matcher<arg_type>() const {\
1898  return ::testing::Matcher<arg_type>(\
1899  new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\
1900  }\
1901  name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \
1902  p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1903  p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
1904  p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {\
1905  }\
1906  p0##_type p0;\
1907  p1##_type p1;\
1908  p2##_type p2;\
1909  p3##_type p3;\
1910  p4##_type p4;\
1911  p5##_type p5;\
1912  private:\
1913  GTEST_DISALLOW_ASSIGN_(name##MatcherP6);\
1914  };\
1915  template <typename p0##_type, typename p1##_type, typename p2##_type, \
1916  typename p3##_type, typename p4##_type, typename p5##_type>\
1917  inline name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1918  p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1919  p3##_type p3, p4##_type p4, p5##_type p5) {\
1920  return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1921  p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
1922  }\
1923  template <typename p0##_type, typename p1##_type, typename p2##_type, \
1924  typename p3##_type, typename p4##_type, typename p5##_type>\
1925  template <typename arg_type>\
1926  bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1927  p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1928  arg_type arg, \
1929  ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1930  const
1931 
1932 #define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\
1933  template <typename p0##_type, typename p1##_type, typename p2##_type, \
1934  typename p3##_type, typename p4##_type, typename p5##_type, \
1935  typename p6##_type>\
1936  class name##MatcherP7 {\
1937  public:\
1938  template <typename arg_type>\
1939  class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
1940  public:\
1941  gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1942  p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1943  p6##_type gmock_p6)\
1944  : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
1945  p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\
1946  virtual bool MatchAndExplain(\
1947  arg_type arg, ::testing::MatchResultListener* result_listener) const;\
1948  virtual void DescribeTo(::std::ostream* gmock_os) const {\
1949  *gmock_os << FormatDescription(false);\
1950  }\
1951  virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1952  *gmock_os << FormatDescription(true);\
1953  }\
1954  p0##_type p0;\
1955  p1##_type p1;\
1956  p2##_type p2;\
1957  p3##_type p3;\
1958  p4##_type p4;\
1959  p5##_type p5;\
1960  p6##_type p6;\
1961  private:\
1962  ::testing::internal::string FormatDescription(bool negation) const {\
1963  const ::testing::internal::string gmock_description = (description);\
1964  if (!gmock_description.empty())\
1965  return gmock_description;\
1966  return ::testing::internal::FormatMatcherDescription(\
1967  negation, #name, \
1968  ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1969  ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1970  p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
1971  p6)));\
1972  }\
1973  GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1974  };\
1975  template <typename arg_type>\
1976  operator ::testing::Matcher<arg_type>() const {\
1977  return ::testing::Matcher<arg_type>(\
1978  new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6));\
1979  }\
1980  name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \
1981  p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1982  p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \
1983  p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
1984  p6(gmock_p6) {\
1985  }\
1986  p0##_type p0;\
1987  p1##_type p1;\
1988  p2##_type p2;\
1989  p3##_type p3;\
1990  p4##_type p4;\
1991  p5##_type p5;\
1992  p6##_type p6;\
1993  private:\
1994  GTEST_DISALLOW_ASSIGN_(name##MatcherP7);\
1995  };\
1996  template <typename p0##_type, typename p1##_type, typename p2##_type, \
1997  typename p3##_type, typename p4##_type, typename p5##_type, \
1998  typename p6##_type>\
1999  inline name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
2000  p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
2001  p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
2002  p6##_type p6) {\
2003  return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
2004  p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
2005  }\
2006  template <typename p0##_type, typename p1##_type, typename p2##_type, \
2007  typename p3##_type, typename p4##_type, typename p5##_type, \
2008  typename p6##_type>\
2009  template <typename arg_type>\
2010  bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
2011  p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
2012  arg_type arg, \
2013  ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
2014  const
2015 
2016 #define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\
2017  template <typename p0##_type, typename p1##_type, typename p2##_type, \
2018  typename p3##_type, typename p4##_type, typename p5##_type, \
2019  typename p6##_type, typename p7##_type>\
2020  class name##MatcherP8 {\
2021  public:\
2022  template <typename arg_type>\
2023  class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
2024  public:\
2025  gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
2026  p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
2027  p6##_type gmock_p6, p7##_type gmock_p7)\
2028  : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
2029  p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\
2030  virtual bool MatchAndExplain(\
2031  arg_type arg, ::testing::MatchResultListener* result_listener) const;\
2032  virtual void DescribeTo(::std::ostream* gmock_os) const {\
2033  *gmock_os << FormatDescription(false);\
2034  }\
2035  virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
2036  *gmock_os << FormatDescription(true);\
2037  }\
2038  p0##_type p0;\
2039  p1##_type p1;\
2040  p2##_type p2;\
2041  p3##_type p3;\
2042  p4##_type p4;\
2043  p5##_type p5;\
2044  p6##_type p6;\
2045  p7##_type p7;\
2046  private:\
2047  ::testing::internal::string FormatDescription(bool negation) const {\
2048  const ::testing::internal::string gmock_description = (description);\
2049  if (!gmock_description.empty())\
2050  return gmock_description;\
2051  return ::testing::internal::FormatMatcherDescription(\
2052  negation, #name, \
2053  ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
2054  ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
2055  p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
2056  p3, p4, p5, p6, p7)));\
2057  }\
2058  GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
2059  };\
2060  template <typename arg_type>\
2061  operator ::testing::Matcher<arg_type>() const {\
2062  return ::testing::Matcher<arg_type>(\
2063  new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7));\
2064  }\
2065  name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \
2066  p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
2067  p5##_type gmock_p5, p6##_type gmock_p6, \
2068  p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
2069  p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
2070  p7(gmock_p7) {\
2071  }\
2072  p0##_type p0;\
2073  p1##_type p1;\
2074  p2##_type p2;\
2075  p3##_type p3;\
2076  p4##_type p4;\
2077  p5##_type p5;\
2078  p6##_type p6;\
2079  p7##_type p7;\
2080  private:\
2081  GTEST_DISALLOW_ASSIGN_(name##MatcherP8);\
2082  };\
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>\
2086  inline name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
2087  p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
2088  p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
2089  p6##_type p6, p7##_type p7) {\
2090  return name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
2091  p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
2092  p6, p7);\
2093  }\
2094  template <typename p0##_type, typename p1##_type, typename p2##_type, \
2095  typename p3##_type, typename p4##_type, typename p5##_type, \
2096  typename p6##_type, typename p7##_type>\
2097  template <typename arg_type>\
2098  bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
2099  p5##_type, p6##_type, \
2100  p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
2101  arg_type arg, \
2102  ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
2103  const
2104 
2105 #define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\
2106  template <typename p0##_type, typename p1##_type, typename p2##_type, \
2107  typename p3##_type, typename p4##_type, typename p5##_type, \
2108  typename p6##_type, typename p7##_type, typename p8##_type>\
2109  class name##MatcherP9 {\
2110  public:\
2111  template <typename arg_type>\
2112  class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
2113  public:\
2114  gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
2115  p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
2116  p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\
2117  : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
2118  p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
2119  p8(gmock_p8) {}\
2120  virtual bool MatchAndExplain(\
2121  arg_type arg, ::testing::MatchResultListener* result_listener) const;\
2122  virtual void DescribeTo(::std::ostream* gmock_os) const {\
2123  *gmock_os << FormatDescription(false);\
2124  }\
2125  virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
2126  *gmock_os << FormatDescription(true);\
2127  }\
2128  p0##_type p0;\
2129  p1##_type p1;\
2130  p2##_type p2;\
2131  p3##_type p3;\
2132  p4##_type p4;\
2133  p5##_type p5;\
2134  p6##_type p6;\
2135  p7##_type p7;\
2136  p8##_type p8;\
2137  private:\
2138  ::testing::internal::string FormatDescription(bool negation) const {\
2139  const ::testing::internal::string gmock_description = (description);\
2140  if (!gmock_description.empty())\
2141  return gmock_description;\
2142  return ::testing::internal::FormatMatcherDescription(\
2143  negation, #name, \
2144  ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
2145  ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
2146  p4##_type, p5##_type, p6##_type, p7##_type, \
2147  p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
2148  }\
2149  GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
2150  };\
2151  template <typename arg_type>\
2152  operator ::testing::Matcher<arg_type>() const {\
2153  return ::testing::Matcher<arg_type>(\
2154  new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8));\
2155  }\
2156  name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \
2157  p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
2158  p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
2159  p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
2160  p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
2161  p8(gmock_p8) {\
2162  }\
2163  p0##_type p0;\
2164  p1##_type p1;\
2165  p2##_type p2;\
2166  p3##_type p3;\
2167  p4##_type p4;\
2168  p5##_type p5;\
2169  p6##_type p6;\
2170  p7##_type p7;\
2171  p8##_type p8;\
2172  private:\
2173  GTEST_DISALLOW_ASSIGN_(name##MatcherP9);\
2174  };\
2175  template <typename p0##_type, typename p1##_type, typename p2##_type, \
2176  typename p3##_type, typename p4##_type, typename p5##_type, \
2177  typename p6##_type, typename p7##_type, typename p8##_type>\
2178  inline name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
2179  p4##_type, p5##_type, p6##_type, p7##_type, \
2180  p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
2181  p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
2182  p8##_type p8) {\
2183  return name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
2184  p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
2185  p3, p4, p5, p6, p7, p8);\
2186  }\
2187  template <typename p0##_type, typename p1##_type, typename p2##_type, \
2188  typename p3##_type, typename p4##_type, typename p5##_type, \
2189  typename p6##_type, typename p7##_type, typename p8##_type>\
2190  template <typename arg_type>\
2191  bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
2192  p5##_type, p6##_type, p7##_type, \
2193  p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
2194  arg_type arg, \
2195  ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
2196  const
2197 
2198 #define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)\
2199  template <typename p0##_type, typename p1##_type, typename p2##_type, \
2200  typename p3##_type, typename p4##_type, typename p5##_type, \
2201  typename p6##_type, typename p7##_type, typename p8##_type, \
2202  typename p9##_type>\
2203  class name##MatcherP10 {\
2204  public:\
2205  template <typename arg_type>\
2206  class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
2207  public:\
2208  gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
2209  p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
2210  p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
2211  p9##_type gmock_p9)\
2212  : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
2213  p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
2214  p8(gmock_p8), p9(gmock_p9) {}\
2215  virtual bool MatchAndExplain(\
2216  arg_type arg, ::testing::MatchResultListener* result_listener) const;\
2217  virtual void DescribeTo(::std::ostream* gmock_os) const {\
2218  *gmock_os << FormatDescription(false);\
2219  }\
2220  virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
2221  *gmock_os << FormatDescription(true);\
2222  }\
2223  p0##_type p0;\
2224  p1##_type p1;\
2225  p2##_type p2;\
2226  p3##_type p3;\
2227  p4##_type p4;\
2228  p5##_type p5;\
2229  p6##_type p6;\
2230  p7##_type p7;\
2231  p8##_type p8;\
2232  p9##_type p9;\
2233  private:\
2234  ::testing::internal::string FormatDescription(bool negation) const {\
2235  const ::testing::internal::string gmock_description = (description);\
2236  if (!gmock_description.empty())\
2237  return gmock_description;\
2238  return ::testing::internal::FormatMatcherDescription(\
2239  negation, #name, \
2240  ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
2241  ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
2242  p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
2243  p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
2244  }\
2245  GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
2246  };\
2247  template <typename arg_type>\
2248  operator ::testing::Matcher<arg_type>() const {\
2249  return ::testing::Matcher<arg_type>(\
2250  new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9));\
2251  }\
2252  name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \
2253  p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
2254  p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
2255  p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \
2256  p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
2257  p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {\
2258  }\
2259  p0##_type p0;\
2260  p1##_type p1;\
2261  p2##_type p2;\
2262  p3##_type p3;\
2263  p4##_type p4;\
2264  p5##_type p5;\
2265  p6##_type p6;\
2266  p7##_type p7;\
2267  p8##_type p8;\
2268  p9##_type p9;\
2269  private:\
2270  GTEST_DISALLOW_ASSIGN_(name##MatcherP10);\
2271  };\
2272  template <typename p0##_type, typename p1##_type, typename p2##_type, \
2273  typename p3##_type, typename p4##_type, typename p5##_type, \
2274  typename p6##_type, typename p7##_type, typename p8##_type, \
2275  typename p9##_type>\
2276  inline name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2277  p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
2278  p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
2279  p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
2280  p9##_type p9) {\
2281  return name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2282  p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
2283  p1, p2, p3, p4, p5, p6, p7, p8, p9);\
2284  }\
2285  template <typename p0##_type, typename p1##_type, typename p2##_type, \
2286  typename p3##_type, typename p4##_type, typename p5##_type, \
2287  typename p6##_type, typename p7##_type, typename p8##_type, \
2288  typename p9##_type>\
2289  template <typename arg_type>\
2290  bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2291  p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
2292  p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
2293  arg_type arg, \
2294  ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
2295  const
2296 
2297 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
virtual void DescribeNegationTo(::std::ostream *os) const
BothOfMatcher< typename AllOfResult3< M1, M2, M3 >::type, typename AllOfResult3< M4, M5, M6 >::type > type
EitherOfMatcher< typename AnyOfResult3< M1, M2, M3 >::type, typename AnyOfResult3< M4, M5, M6 >::type > type
BothOfMatcher< typename AllOfResult4< M1, M2, M3, M4 >::type, typename AllOfResult4< M5, M6, M7, M8 >::type > type
::std::string PrintToString(const T &value)
static void PrintIndices(::std::ostream *os)
virtual bool MatchAndExplain(ArgsTuple args, MatchResultListener *listener) const
EitherOfMatcher< typename AnyOfResult2< M1, M2 >::type, typename AnyOfResult3< M3, M4, M5 >::type > type
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
::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)> type
EitherOfMatcher< typename AnyOfResult5< M1, M2, M3, M4, M5 >::type, typename AnyOfResult5< M6, M7, M8, M9, M10 >::type > type
internal::AllOfResult2< M1, M2 >::type AllOf(M1 m1, M2 m2)
internal::TupleFields< RawArgsTuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, k9 >::type SelectedArgs
EitherOfMatcher< typename AnyOfResult2< M1, M2 >::type, typename AnyOfResult2< M3, M4 >::type > type
BothOfMatcher< typename AllOfResult2< M1, M2 >::type, typename AllOfResult3< M3, M4, M5 >::type > type
BothOfMatcher< typename AllOfResult5< M1, M2, M3, M4, M5 >::type, typename AllOfResult5< M6, M7, M8, M9, M10 >::type > type
internal::UnorderedElementsAreMatcher< std::tr1::tuple<> > UnorderedElementsAre()
internal::ElementsAreMatcher< std::tr1::tuple<> > ElementsAre()
static type GetSelectedFields(const Tuple &t)
::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
void PrintIfNotEmpty(const internal::string &explanation,::std::ostream *os)
::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)> type
internal::AnyOfResult2< M1, M2 >::type AnyOf(M1 m1, M2 m2)
Matcher< T > MakeMatcher(const MatcherInterface< T > *impl)
Matcher< T > SafeMatcherCast(const M &polymorphic_matcher)
EitherOfMatcher< typename AnyOfResult4< M1, M2, M3, M4 >::type, typename AnyOfResult5< M5, M6, M7, M8, M9 >::type > type
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)
#define GTEST_DISALLOW_ASSIGN_(type)
static SelectedArgs GetSelectedArgs(ArgsTuple args)
BothOfMatcher< typename AllOfResult4< M1, M2, M3, M4 >::type, typename AllOfResult5< M5, M6, M7, M8, M9 >::type > type
EitherOfMatcher< typename AnyOfResult3< M1, M2, M3 >::type, typename AnyOfResult4< M4, M5, M6, M7 >::type > type
::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)> type
#define GMOCK_FIELD_TYPE_(Tuple, i)
ArgsMatcher(const InnerMatcher &inner_matcher)
::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)> type
EitherOfMatcher< typename AnyOfResult1< M1 >::type, typename AnyOfResult2< M2, M3 >::type > type
virtual void DescribeTo(::std::ostream *os) const
BothOfMatcher< typename AllOfResult3< M1, M2, M3 >::type, typename AllOfResult4< M4, M5, M6, M7 >::type > type
BothOfMatcher< typename AllOfResult2< M1, M2 >::type, typename AllOfResult2< M3, M4 >::type > type
EitherOfMatcher< typename AnyOfResult1< M1 >::type, typename AnyOfResult1< M2 >::type > type
BothOfMatcher< typename AllOfResult1< M1 >::type, typename AllOfResult1< M2 >::type > type
BothOfMatcher< typename AllOfResult1< M1 >::type, typename AllOfResult2< M2, M3 >::type > type
Matcher< const SelectedArgs & > MonomorphicInnerMatcher
::std::tr1::tuple< GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple, k1)> type
::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)> type
::std::tr1::tuple< GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type
EitherOfMatcher< typename AnyOfResult4< M1, M2, M3, M4 >::type, typename AnyOfResult4< M5, M6, M7, M8 >::type > type
ArgsMatcherImpl(const InnerMatcher &inner_matcher)
::std::tr1::tuple< GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3)> type


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:06:05