~raof/mir/symbols-file

« back to all changes in this revision

Viewing changes to 3rd_party/gmock/include/gmock/gmock-generated-matchers.h

  • Committer: Tarmac
  • Author(s): Kevin DuBois
  • Date: 2013-07-12 06:12:08 UTC
  • mfrom: (835.4.12 rm-internal-gmock)
  • Revision ID: tarmac-20130712061208-axrnr0n8xgjgexhz
remove google mock from the internal source tree. Rather, use the google-mock package and build the source externally. Fixes: https://bugs.launchpad.net/bugs/1185265, https://bugs.launchpad.net/bugs/1194017.

Approved by Didier Roche, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

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