gmock-generated-matchers.h 44.5 KB
Newer Older
1
2
3
// This file was GENERATED by command:
//     pump.py gmock-generated-matchers.h.pump
// DO NOT EDIT BY HAND!!!
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

// Copyright 2008, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// Google Mock - a framework for writing C++ mock classes.
//
// This file implements some commonly used variadic matchers.

Gennadiy Civil's avatar
 
Gennadiy Civil committed
38
39
// GOOGLETEST_CM0002 DO NOT DELETE

40
41
42
#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_

43
#include <iterator>
44
45
#include <sstream>
#include <string>
Abseil Team's avatar
Abseil Team committed
46
#include <utility>
47
#include <vector>
48
#include "gmock/gmock-matchers.h"
49

zhanyong.wan's avatar
zhanyong.wan committed
50
// The MATCHER* family of macros can be used in a namespace scope to
zhanyong.wan's avatar
zhanyong.wan committed
51
52
53
54
55
56
// define custom matchers easily.
//
// Basic Usage
// ===========
//
// The syntax
zhanyong.wan's avatar
zhanyong.wan committed
57
58
59
//
//   MATCHER(name, description_string) { statements; }
//
zhanyong.wan's avatar
zhanyong.wan committed
60
61
62
63
// defines a matcher with the given name that executes the statements,
// which must return a bool to indicate if the match succeeds.  Inside
// the statements, you can refer to the value being matched by 'arg',
// and refer to its type by 'arg_type'.
64
65
66
67
68
69
70
71
72
73
//
// The description string documents what the matcher does, and is used
// to generate the failure message when the match fails.  Since a
// MATCHER() is usually defined in a header file shared by multiple
// C++ source files, we require the description to be a C-string
// literal to avoid possible side effects.  It can be empty, in which
// case we'll use the sequence of words in the matcher name as the
// description.
//
// For example:
zhanyong.wan's avatar
zhanyong.wan committed
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//
//   MATCHER(IsEven, "") { return (arg % 2) == 0; }
//
// allows you to write
//
//   // Expects mock_foo.Bar(n) to be called where n is even.
//   EXPECT_CALL(mock_foo, Bar(IsEven()));
//
// or,
//
//   // Verifies that the value of some_expression is even.
//   EXPECT_THAT(some_expression, IsEven());
//
// If the above assertion fails, it will print something like:
//
//   Value of: some_expression
//   Expected: is even
//     Actual: 7
//
// where the description "is even" is automatically calculated from the
// matcher name IsEven.
//
zhanyong.wan's avatar
zhanyong.wan committed
96
97
98
// Argument Type
// =============
//
zhanyong.wan's avatar
zhanyong.wan committed
99
100
101
102
103
104
105
106
107
108
// Note that the type of the value being matched (arg_type) is
// determined by the context in which you use the matcher and is
// supplied to you by the compiler, so you don't need to worry about
// declaring it (nor can you).  This allows the matcher to be
// polymorphic.  For example, IsEven() can be used to match any type
// where the value of "(arg % 2) == 0" can be implicitly converted to
// a bool.  In the "Bar(IsEven())" example above, if method Bar()
// takes an int, 'arg_type' will be int; if it takes an unsigned long,
// 'arg_type' will be unsigned long; and so on.
//
zhanyong.wan's avatar
zhanyong.wan committed
109
110
111
// Parameterizing Matchers
// =======================
//
zhanyong.wan's avatar
zhanyong.wan committed
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// Sometimes you'll want to parameterize the matcher.  For that you
// can use another macro:
//
//   MATCHER_P(name, param_name, description_string) { statements; }
//
// For example:
//
//   MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
//
// will allow you to write:
//
//   EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
//
// which may lead to this message (assuming n is 10):
//
//   Value of: Blah("a")
//   Expected: has absolute value 10
//     Actual: -9
//
// Note that both the matcher description and its parameter are
// printed, making the message human-friendly.
//
// In the matcher definition body, you can write 'foo_type' to
// reference the type of a parameter named 'foo'.  For example, in the
// body of MATCHER_P(HasAbsoluteValue, value) above, you can write
// 'value_type' to refer to the type of 'value'.
//
// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to
// support multi-parameter matchers.
//
zhanyong.wan's avatar
zhanyong.wan committed
142
143
144
// Describing Parameterized Matchers
// =================================
//
145
146
147
148
149
150
151
152
153
154
// The last argument to MATCHER*() is a string-typed expression.  The
// expression can reference all of the matcher's parameters and a
// special bool-typed variable named 'negation'.  When 'negation' is
// false, the expression should evaluate to the matcher's description;
// otherwise it should evaluate to the description of the negation of
// the matcher.  For example,
//
//   using testing::PrintToString;
//
//   MATCHER_P2(InClosedRange, low, hi,
155
//       std::string(negation ? "is not" : "is") + " in range [" +
156
//       PrintToString(low) + ", " + PrintToString(hi) + "]") {
157
158
159
160
//     return low <= arg && arg <= hi;
//   }
//   ...
//   EXPECT_THAT(3, InClosedRange(4, 6));
161
//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));
162
//
163
// would generate two failures that contain the text:
164
165
//
//   Expected: is in range [4, 6]
166
167
//   ...
//   Expected: is not in range [2, 4]
168
169
170
171
172
173
174
175
//
// If you specify "" as the description, the failure message will
// contain the sequence of words in the matcher name followed by the
// parameter values printed as a tuple.  For example,
//
//   MATCHER_P2(InClosedRange, low, hi, "") { ... }
//   ...
//   EXPECT_THAT(3, InClosedRange(4, 6));
176
//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));
177
//
178
// would generate two failures that contain the text:
179
180
//
//   Expected: in closed range (4, 6)
181
182
//   ...
//   Expected: not (in closed range (2, 4))
183
//
zhanyong.wan's avatar
zhanyong.wan committed
184
185
186
// Types of Matcher Parameters
// ===========================
//
zhanyong.wan's avatar
zhanyong.wan committed
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
// For the purpose of typing, you can view
//
//   MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
//
// as shorthand for
//
//   template <typename p1_type, ..., typename pk_type>
//   FooMatcherPk<p1_type, ..., pk_type>
//   Foo(p1_type p1, ..., pk_type pk) { ... }
//
// When you write Foo(v1, ..., vk), the compiler infers the types of
// the parameters v1, ..., and vk for you.  If you are not happy with
// the result of the type inference, you can specify the types by
// explicitly instantiating the template, as in Foo<long, bool>(5,
// false).  As said earlier, you don't get to (or need to) specify
// 'arg_type' as that's determined by the context in which the matcher
// is used.  You can assign the result of expression Foo(p1, ..., pk)
// to a variable of type FooMatcherPk<p1_type, ..., pk_type>.  This
// can be useful when composing matchers.
//
// While you can instantiate a matcher template with reference types,
// passing the parameters by pointer usually makes your code more
// readable.  If, however, you still want to pass a parameter by
// reference, be aware that in the failure message generated by the
// matcher you will see the value of the referenced object but not its
// address.
//
zhanyong.wan's avatar
zhanyong.wan committed
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
// Explaining Match Results
// ========================
//
// Sometimes the matcher description alone isn't enough to explain why
// the match has failed or succeeded.  For example, when expecting a
// long string, it can be very helpful to also print the diff between
// the expected string and the actual one.  To achieve that, you can
// optionally stream additional information to a special variable
// named result_listener, whose type is a pointer to class
// MatchResultListener:
//
//   MATCHER_P(EqualsLongString, str, "") {
//     if (arg == str) return true;
//
//     *result_listener << "the difference: "
///                     << DiffStrings(str, arg);
//     return false;
//   }
//
// Overloading Matchers
// ====================
//
zhanyong.wan's avatar
zhanyong.wan committed
236
237
238
239
240
// You can overload matchers with different numbers of parameters:
//
//   MATCHER_P(Blah, a, description_string1) { ... }
//   MATCHER_P2(Blah, a, b, description_string2) { ... }
//
zhanyong.wan's avatar
zhanyong.wan committed
241
242
// Caveats
// =======
zhanyong.wan's avatar
zhanyong.wan committed
243
//
zhanyong.wan's avatar
zhanyong.wan committed
244
245
246
247
248
249
250
251
// When defining a new matcher, you should also consider implementing
// MatcherInterface or using MakePolymorphicMatcher().  These
// approaches require more work than the MATCHER* macros, but also
// give you more control on the types of the value being matched and
// the matcher parameters, which may leads to better compiler error
// messages when the matcher is used wrong.  They also allow
// overloading matchers based on parameter types (as opposed to just
// based on the number of parameters).
zhanyong.wan's avatar
zhanyong.wan committed
252
//
253
254
// MATCHER*() can only be used in a namespace scope as templates cannot be
// declared inside of a local class.
zhanyong.wan's avatar
zhanyong.wan committed
255
//
zhanyong.wan's avatar
zhanyong.wan committed
256
257
// More Information
// ================
zhanyong.wan's avatar
zhanyong.wan committed
258
259
//
// To learn more about using these macros, please search for 'MATCHER'
Abseil Team's avatar
Abseil Team committed
260
// on
Gennadiy Civil's avatar
 
Gennadiy Civil committed
261
// https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md
zhanyong.wan's avatar
zhanyong.wan committed
262
263
264
265
266

#define MATCHER(name, description)\
  class name##Matcher {\
   public:\
    template <typename arg_type>\
267
268
    class gmock_Impl : public ::testing::MatcherInterface<\
        GTEST_REFERENCE_TO_CONST_(arg_type)> {\
zhanyong.wan's avatar
zhanyong.wan committed
269
     public:\
270
271
      gmock_Impl()\
           {}\
zhanyong.wan's avatar
zhanyong.wan committed
272
      virtual bool MatchAndExplain(\
273
274
          GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
          ::testing::MatchResultListener* result_listener) const;\
275
      virtual void DescribeTo(::std::ostream* gmock_os) const {\
276
277
278
279
        *gmock_os << FormatDescription(false);\
      }\
      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
        *gmock_os << FormatDescription(true);\
zhanyong.wan's avatar
zhanyong.wan committed
280
      }\
281
     private:\
282
283
      ::std::string FormatDescription(bool negation) const {\
        ::std::string gmock_description = (description);\
284
        if (!gmock_description.empty()) {\
285
          return gmock_description;\
286
        }\
287
        return ::testing::internal::FormatMatcherDescription(\
288
            negation, #name, \
289
            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
Abseil Team's avatar
Abseil Team committed
290
                ::std::tuple<>()));\
291
      }\
zhanyong.wan's avatar
zhanyong.wan committed
292
293
294
    };\
    template <typename arg_type>\
    operator ::testing::Matcher<arg_type>() const {\
295
      return ::testing::Matcher<arg_type>(\
296
          new gmock_Impl<arg_type>());\
zhanyong.wan's avatar
zhanyong.wan committed
297
298
299
    }\
    name##Matcher() {\
    }\
300
   private:\
zhanyong.wan's avatar
zhanyong.wan committed
301
302
303
304
305
  };\
  inline name##Matcher name() {\
    return name##Matcher();\
  }\
  template <typename arg_type>\
zhanyong.wan's avatar
zhanyong.wan committed
306
  bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\
307
      GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
zhanyong.wan's avatar
zhanyong.wan committed
308
309
      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
          const
zhanyong.wan's avatar
zhanyong.wan committed
310
311
312
313
314
315

#define MATCHER_P(name, p0, description)\
  template <typename p0##_type>\
  class name##MatcherP {\
   public:\
    template <typename arg_type>\
316
317
    class gmock_Impl : public ::testing::MatcherInterface<\
        GTEST_REFERENCE_TO_CONST_(arg_type)> {\
zhanyong.wan's avatar
zhanyong.wan committed
318
     public:\
319
      explicit gmock_Impl(p0##_type gmock_p0)\
Abseil Team's avatar
Abseil Team committed
320
           : p0(::std::move(gmock_p0)) {}\
zhanyong.wan's avatar
zhanyong.wan committed
321
      virtual bool MatchAndExplain(\
322
323
          GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
          ::testing::MatchResultListener* result_listener) const;\
324
      virtual void DescribeTo(::std::ostream* gmock_os) const {\
325
326
327
328
        *gmock_os << FormatDescription(false);\
      }\
      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
        *gmock_os << FormatDescription(true);\
zhanyong.wan's avatar
zhanyong.wan committed
329
      }\
330
      p0##_type const p0;\
331
     private:\
332
333
      ::std::string FormatDescription(bool negation) const {\
        ::std::string gmock_description = (description);\
334
        if (!gmock_description.empty()) {\
335
          return gmock_description;\
336
        }\
337
        return ::testing::internal::FormatMatcherDescription(\
338
            negation, #name, \
339
            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
Abseil Team's avatar
Abseil Team committed
340
                ::std::tuple<p0##_type>(p0)));\
341
      }\
zhanyong.wan's avatar
zhanyong.wan committed
342
343
344
    };\
    template <typename arg_type>\
    operator ::testing::Matcher<arg_type>() const {\
345
      return ::testing::Matcher<arg_type>(\
346
          new gmock_Impl<arg_type>(p0));\
zhanyong.wan's avatar
zhanyong.wan committed
347
    }\
Abseil Team's avatar
Abseil Team committed
348
    explicit name##MatcherP(p0##_type gmock_p0) : p0(::std::move(gmock_p0)) {\
zhanyong.wan's avatar
zhanyong.wan committed
349
    }\
350
    p0##_type const p0;\
351
   private:\
zhanyong.wan's avatar
zhanyong.wan committed
352
353
354
355
356
357
358
  };\
  template <typename p0##_type>\
  inline name##MatcherP<p0##_type> name(p0##_type p0) {\
    return name##MatcherP<p0##_type>(p0);\
  }\
  template <typename p0##_type>\
  template <typename arg_type>\
zhanyong.wan's avatar
zhanyong.wan committed
359
  bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
360
      GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
zhanyong.wan's avatar
zhanyong.wan committed
361
362
      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
          const
zhanyong.wan's avatar
zhanyong.wan committed
363
364
365
366
367
368

#define MATCHER_P2(name, p0, p1, description)\
  template <typename p0##_type, typename p1##_type>\
  class name##MatcherP2 {\
   public:\
    template <typename arg_type>\
369
370
    class gmock_Impl : public ::testing::MatcherInterface<\
        GTEST_REFERENCE_TO_CONST_(arg_type)> {\
zhanyong.wan's avatar
zhanyong.wan committed
371
     public:\
372
      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\
Abseil Team's avatar
Abseil Team committed
373
           : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)) {}\
zhanyong.wan's avatar
zhanyong.wan committed
374
      virtual bool MatchAndExplain(\
375
376
          GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
          ::testing::MatchResultListener* result_listener) const;\
377
      virtual void DescribeTo(::std::ostream* gmock_os) const {\
378
379
380
381
        *gmock_os << FormatDescription(false);\
      }\
      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
        *gmock_os << FormatDescription(true);\
zhanyong.wan's avatar
zhanyong.wan committed
382
      }\
383
384
      p0##_type const p0;\
      p1##_type const p1;\
385
     private:\
386
387
      ::std::string FormatDescription(bool negation) const {\
        ::std::string gmock_description = (description);\
388
        if (!gmock_description.empty()) {\
389
          return gmock_description;\
390
        }\
391
        return ::testing::internal::FormatMatcherDescription(\
392
            negation, #name, \
393
            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
Abseil Team's avatar
Abseil Team committed
394
                ::std::tuple<p0##_type, p1##_type>(p0, p1)));\
395
      }\
zhanyong.wan's avatar
zhanyong.wan committed
396
397
398
    };\
    template <typename arg_type>\
    operator ::testing::Matcher<arg_type>() const {\
399
      return ::testing::Matcher<arg_type>(\
400
          new gmock_Impl<arg_type>(p0, p1));\
zhanyong.wan's avatar
zhanyong.wan committed
401
    }\
402
    name##MatcherP2(p0##_type gmock_p0, \
Abseil Team's avatar
Abseil Team committed
403
404
        p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \
        p1(::std::move(gmock_p1)) {\
zhanyong.wan's avatar
zhanyong.wan committed
405
    }\
406
407
    p0##_type const p0;\
    p1##_type const p1;\
408
   private:\
zhanyong.wan's avatar
zhanyong.wan committed
409
410
411
412
413
414
415
416
  };\
  template <typename p0##_type, typename p1##_type>\
  inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \
      p1##_type p1) {\
    return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\
  }\
  template <typename p0##_type, typename p1##_type>\
  template <typename arg_type>\
zhanyong.wan's avatar
zhanyong.wan committed
417
418
  bool name##MatcherP2<p0##_type, \
      p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
419
      GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
zhanyong.wan's avatar
zhanyong.wan committed
420
421
      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
          const
zhanyong.wan's avatar
zhanyong.wan committed
422
423
424
425
426
427

#define MATCHER_P3(name, p0, p1, p2, description)\
  template <typename p0##_type, typename p1##_type, typename p2##_type>\
  class name##MatcherP3 {\
   public:\
    template <typename arg_type>\
428
429
    class gmock_Impl : public ::testing::MatcherInterface<\
        GTEST_REFERENCE_TO_CONST_(arg_type)> {\
zhanyong.wan's avatar
zhanyong.wan committed
430
     public:\
431
      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\
Abseil Team's avatar
Abseil Team committed
432
433
           : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
               p2(::std::move(gmock_p2)) {}\
zhanyong.wan's avatar
zhanyong.wan committed
434
      virtual bool MatchAndExplain(\
435
436
          GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
          ::testing::MatchResultListener* result_listener) const;\
437
      virtual void DescribeTo(::std::ostream* gmock_os) const {\
438
439
440
441
        *gmock_os << FormatDescription(false);\
      }\
      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
        *gmock_os << FormatDescription(true);\
zhanyong.wan's avatar
zhanyong.wan committed
442
      }\
443
444
445
      p0##_type const p0;\
      p1##_type const p1;\
      p2##_type const p2;\
446
     private:\
447
448
      ::std::string FormatDescription(bool negation) const {\
        ::std::string gmock_description = (description);\
449
        if (!gmock_description.empty()) {\
450
          return gmock_description;\
451
        }\
452
        return ::testing::internal::FormatMatcherDescription(\
453
            negation, #name, \
454
            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
Abseil Team's avatar
Abseil Team committed
455
                ::std::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, p2)));\
456
      }\
zhanyong.wan's avatar
zhanyong.wan committed
457
458
459
    };\
    template <typename arg_type>\
    operator ::testing::Matcher<arg_type>() const {\
460
      return ::testing::Matcher<arg_type>(\
461
          new gmock_Impl<arg_type>(p0, p1, p2));\
zhanyong.wan's avatar
zhanyong.wan committed
462
463
    }\
    name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \
Abseil Team's avatar
Abseil Team committed
464
465
        p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \
        p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)) {\
zhanyong.wan's avatar
zhanyong.wan committed
466
    }\
467
468
469
    p0##_type const p0;\
    p1##_type const p1;\
    p2##_type const p2;\
470
   private:\
zhanyong.wan's avatar
zhanyong.wan committed
471
472
473
474
475
476
477
478
  };\
  template <typename p0##_type, typename p1##_type, typename p2##_type>\
  inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
      p1##_type p1, p2##_type p2) {\
    return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
  }\
  template <typename p0##_type, typename p1##_type, typename p2##_type>\
  template <typename arg_type>\
zhanyong.wan's avatar
zhanyong.wan committed
479
480
  bool name##MatcherP3<p0##_type, p1##_type, \
      p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
481
      GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
zhanyong.wan's avatar
zhanyong.wan committed
482
483
      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
          const
zhanyong.wan's avatar
zhanyong.wan committed
484
485
486
487
488
489
490

#define MATCHER_P4(name, p0, p1, p2, p3, description)\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type>\
  class name##MatcherP4 {\
   public:\
    template <typename arg_type>\
491
492
    class gmock_Impl : public ::testing::MatcherInterface<\
        GTEST_REFERENCE_TO_CONST_(arg_type)> {\
zhanyong.wan's avatar
zhanyong.wan committed
493
494
     public:\
      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
495
          p3##_type gmock_p3)\
Abseil Team's avatar
Abseil Team committed
496
497
           : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
               p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)) {}\
zhanyong.wan's avatar
zhanyong.wan committed
498
      virtual bool MatchAndExplain(\
499
500
          GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
          ::testing::MatchResultListener* result_listener) const;\
501
      virtual void DescribeTo(::std::ostream* gmock_os) const {\
502
503
504
505
        *gmock_os << FormatDescription(false);\
      }\
      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
        *gmock_os << FormatDescription(true);\
zhanyong.wan's avatar
zhanyong.wan committed
506
      }\
507
508
509
510
      p0##_type const p0;\
      p1##_type const p1;\
      p2##_type const p2;\
      p3##_type const p3;\
511
     private:\
512
513
      ::std::string FormatDescription(bool negation) const {\
        ::std::string gmock_description = (description);\
514
        if (!gmock_description.empty()) {\
515
          return gmock_description;\
516
        }\
517
        return ::testing::internal::FormatMatcherDescription(\
518
            negation, #name, \
519
            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
Abseil Team's avatar
Abseil Team committed
520
521
                ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
                    p1, p2, p3)));\
522
      }\
zhanyong.wan's avatar
zhanyong.wan committed
523
524
525
    };\
    template <typename arg_type>\
    operator ::testing::Matcher<arg_type>() const {\
526
      return ::testing::Matcher<arg_type>(\
527
          new gmock_Impl<arg_type>(p0, p1, p2, p3));\
zhanyong.wan's avatar
zhanyong.wan committed
528
529
    }\
    name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \
Abseil Team's avatar
Abseil Team committed
530
531
532
        p2##_type gmock_p2, p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \
        p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
        p3(::std::move(gmock_p3)) {\
zhanyong.wan's avatar
zhanyong.wan committed
533
    }\
534
535
536
537
    p0##_type const p0;\
    p1##_type const p1;\
    p2##_type const p2;\
    p3##_type const p3;\
538
   private:\
zhanyong.wan's avatar
zhanyong.wan committed
539
540
541
542
543
544
545
546
547
548
549
550
  };\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type>\
  inline name##MatcherP4<p0##_type, p1##_type, p2##_type, \
      p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
      p3##_type p3) {\
    return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
        p1, p2, p3);\
  }\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type>\
  template <typename arg_type>\
zhanyong.wan's avatar
zhanyong.wan committed
551
552
  bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \
      p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
553
      GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
zhanyong.wan's avatar
zhanyong.wan committed
554
555
      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
          const
zhanyong.wan's avatar
zhanyong.wan committed
556
557
558
559
560
561
562

#define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type>\
  class name##MatcherP5 {\
   public:\
    template <typename arg_type>\
563
564
    class gmock_Impl : public ::testing::MatcherInterface<\
        GTEST_REFERENCE_TO_CONST_(arg_type)> {\
zhanyong.wan's avatar
zhanyong.wan committed
565
566
     public:\
      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
567
          p3##_type gmock_p3, p4##_type gmock_p4)\
Abseil Team's avatar
Abseil Team committed
568
569
570
           : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
               p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
               p4(::std::move(gmock_p4)) {}\
zhanyong.wan's avatar
zhanyong.wan committed
571
      virtual bool MatchAndExplain(\
572
573
          GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
          ::testing::MatchResultListener* result_listener) const;\
574
      virtual void DescribeTo(::std::ostream* gmock_os) const {\
575
576
577
578
        *gmock_os << FormatDescription(false);\
      }\
      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
        *gmock_os << FormatDescription(true);\
zhanyong.wan's avatar
zhanyong.wan committed
579
      }\
580
581
582
583
584
      p0##_type const p0;\
      p1##_type const p1;\
      p2##_type const p2;\
      p3##_type const p3;\
      p4##_type const p4;\
585
     private:\
586
587
      ::std::string FormatDescription(bool negation) const {\
        ::std::string gmock_description = (description);\
588
        if (!gmock_description.empty()) {\
589
          return gmock_description;\
590
        }\
591
        return ::testing::internal::FormatMatcherDescription(\
592
            negation, #name, \
593
            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
Abseil Team's avatar
Abseil Team committed
594
                ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
595
596
                    p4##_type>(p0, p1, p2, p3, p4)));\
      }\
zhanyong.wan's avatar
zhanyong.wan committed
597
598
599
    };\
    template <typename arg_type>\
    operator ::testing::Matcher<arg_type>() const {\
600
      return ::testing::Matcher<arg_type>(\
601
          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\
zhanyong.wan's avatar
zhanyong.wan committed
602
603
604
    }\
    name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \
        p2##_type gmock_p2, p3##_type gmock_p3, \
Abseil Team's avatar
Abseil Team committed
605
606
607
        p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \
        p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
        p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)) {\
zhanyong.wan's avatar
zhanyong.wan committed
608
    }\
609
610
611
612
613
    p0##_type const p0;\
    p1##_type const p1;\
    p2##_type const p2;\
    p3##_type const p3;\
    p4##_type const p4;\
614
   private:\
zhanyong.wan's avatar
zhanyong.wan committed
615
616
617
618
619
620
621
622
623
624
625
626
  };\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type>\
  inline name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
      p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
      p4##_type p4) {\
    return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
        p4##_type>(p0, p1, p2, p3, p4);\
  }\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type>\
  template <typename arg_type>\
zhanyong.wan's avatar
zhanyong.wan committed
627
628
  bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
      p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
629
      GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
zhanyong.wan's avatar
zhanyong.wan committed
630
631
      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
          const
zhanyong.wan's avatar
zhanyong.wan committed
632
633
634
635
636
637
638

#define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type>\
  class name##MatcherP6 {\
   public:\
    template <typename arg_type>\
639
640
    class gmock_Impl : public ::testing::MatcherInterface<\
        GTEST_REFERENCE_TO_CONST_(arg_type)> {\
zhanyong.wan's avatar
zhanyong.wan committed
641
642
     public:\
      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
643
          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\
Abseil Team's avatar
Abseil Team committed
644
645
646
           : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
               p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
               p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)) {}\
zhanyong.wan's avatar
zhanyong.wan committed
647
      virtual bool MatchAndExplain(\
648
649
          GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
          ::testing::MatchResultListener* result_listener) const;\
650
      virtual void DescribeTo(::std::ostream* gmock_os) const {\
651
652
653
654
        *gmock_os << FormatDescription(false);\
      }\
      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
        *gmock_os << FormatDescription(true);\
zhanyong.wan's avatar
zhanyong.wan committed
655
      }\
656
657
658
659
660
661
      p0##_type const p0;\
      p1##_type const p1;\
      p2##_type const p2;\
      p3##_type const p3;\
      p4##_type const p4;\
      p5##_type const p5;\
662
     private:\
663
664
      ::std::string FormatDescription(bool negation) const {\
        ::std::string gmock_description = (description);\
665
        if (!gmock_description.empty()) {\
666
          return gmock_description;\
667
        }\
668
        return ::testing::internal::FormatMatcherDescription(\
669
            negation, #name, \
670
            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
Abseil Team's avatar
Abseil Team committed
671
                ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
672
673
                    p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
      }\
zhanyong.wan's avatar
zhanyong.wan committed
674
675
676
    };\
    template <typename arg_type>\
    operator ::testing::Matcher<arg_type>() const {\
677
      return ::testing::Matcher<arg_type>(\
678
          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\
zhanyong.wan's avatar
zhanyong.wan committed
679
680
681
    }\
    name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \
        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
Abseil Team's avatar
Abseil Team committed
682
683
684
685
        p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \
        p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
        p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
        p5(::std::move(gmock_p5)) {\
zhanyong.wan's avatar
zhanyong.wan committed
686
    }\
687
688
689
690
691
692
    p0##_type const p0;\
    p1##_type const p1;\
    p2##_type const p2;\
    p3##_type const p3;\
    p4##_type const p4;\
    p5##_type const p5;\
693
   private:\
zhanyong.wan's avatar
zhanyong.wan committed
694
695
696
697
698
699
700
701
702
703
704
705
706
  };\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type>\
  inline name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
      p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
      p3##_type p3, p4##_type p4, p5##_type p5) {\
    return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
        p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
  }\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type>\
  template <typename arg_type>\
  bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
zhanyong.wan's avatar
zhanyong.wan committed
707
      p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
708
      GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
zhanyong.wan's avatar
zhanyong.wan committed
709
710
      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
          const
zhanyong.wan's avatar
zhanyong.wan committed
711
712
713
714
715
716
717
718

#define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type, \
      typename p6##_type>\
  class name##MatcherP7 {\
   public:\
    template <typename arg_type>\
719
720
    class gmock_Impl : public ::testing::MatcherInterface<\
        GTEST_REFERENCE_TO_CONST_(arg_type)> {\
zhanyong.wan's avatar
zhanyong.wan committed
721
722
723
     public:\
      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
724
          p6##_type gmock_p6)\
Abseil Team's avatar
Abseil Team committed
725
726
727
728
           : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
               p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
               p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
               p6(::std::move(gmock_p6)) {}\
zhanyong.wan's avatar
zhanyong.wan committed
729
      virtual bool MatchAndExplain(\
730
731
          GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
          ::testing::MatchResultListener* result_listener) const;\
732
      virtual void DescribeTo(::std::ostream* gmock_os) const {\
733
734
735
736
        *gmock_os << FormatDescription(false);\
      }\
      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
        *gmock_os << FormatDescription(true);\
zhanyong.wan's avatar
zhanyong.wan committed
737
      }\
738
739
740
741
742
743
744
      p0##_type const p0;\
      p1##_type const p1;\
      p2##_type const p2;\
      p3##_type const p3;\
      p4##_type const p4;\
      p5##_type const p5;\
      p6##_type const p6;\
745
     private:\
746
747
      ::std::string FormatDescription(bool negation) const {\
        ::std::string gmock_description = (description);\
748
        if (!gmock_description.empty()) {\
749
          return gmock_description;\
750
        }\
751
        return ::testing::internal::FormatMatcherDescription(\
752
            negation, #name, \
753
            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
Abseil Team's avatar
Abseil Team committed
754
                ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
755
756
757
                    p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
                    p6)));\
      }\
zhanyong.wan's avatar
zhanyong.wan committed
758
759
760
    };\
    template <typename arg_type>\
    operator ::testing::Matcher<arg_type>() const {\
761
      return ::testing::Matcher<arg_type>(\
762
          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6));\
zhanyong.wan's avatar
zhanyong.wan committed
763
764
765
    }\
    name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \
        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
Abseil Team's avatar
Abseil Team committed
766
767
768
769
        p5##_type gmock_p5, p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \
        p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
        p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
        p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)) {\
zhanyong.wan's avatar
zhanyong.wan committed
770
    }\
771
772
773
774
775
776
777
    p0##_type const p0;\
    p1##_type const p1;\
    p2##_type const p2;\
    p3##_type const p3;\
    p4##_type const p4;\
    p5##_type const p5;\
    p6##_type const p6;\
778
   private:\
zhanyong.wan's avatar
zhanyong.wan committed
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
  };\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type, \
      typename p6##_type>\
  inline name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
      p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
      p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
      p6##_type p6) {\
    return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
        p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
  }\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type, \
      typename p6##_type>\
  template <typename arg_type>\
  bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
zhanyong.wan's avatar
zhanyong.wan committed
795
      p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
796
      GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
zhanyong.wan's avatar
zhanyong.wan committed
797
798
      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
          const
zhanyong.wan's avatar
zhanyong.wan committed
799
800
801
802
803
804
805
806

#define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type, \
      typename p6##_type, typename p7##_type>\
  class name##MatcherP8 {\
   public:\
    template <typename arg_type>\
807
808
    class gmock_Impl : public ::testing::MatcherInterface<\
        GTEST_REFERENCE_TO_CONST_(arg_type)> {\
zhanyong.wan's avatar
zhanyong.wan committed
809
810
811
     public:\
      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
812
          p6##_type gmock_p6, p7##_type gmock_p7)\
Abseil Team's avatar
Abseil Team committed
813
814
815
816
           : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
               p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
               p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
               p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)) {}\
zhanyong.wan's avatar
zhanyong.wan committed
817
      virtual bool MatchAndExplain(\
818
819
          GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
          ::testing::MatchResultListener* result_listener) const;\
820
      virtual void DescribeTo(::std::ostream* gmock_os) const {\
821
822
823
824
        *gmock_os << FormatDescription(false);\
      }\
      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
        *gmock_os << FormatDescription(true);\
zhanyong.wan's avatar
zhanyong.wan committed
825
      }\
826
827
828
829
830
831
832
833
      p0##_type const p0;\
      p1##_type const p1;\
      p2##_type const p2;\
      p3##_type const p3;\
      p4##_type const p4;\
      p5##_type const p5;\
      p6##_type const p6;\
      p7##_type const p7;\
834
     private:\
835
836
      ::std::string FormatDescription(bool negation) const {\
        ::std::string gmock_description = (description);\
837
        if (!gmock_description.empty()) {\
838
          return gmock_description;\
839
        }\
840
        return ::testing::internal::FormatMatcherDescription(\
841
            negation, #name, \
842
            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
Abseil Team's avatar
Abseil Team committed
843
                ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
844
845
846
                    p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
                    p3, p4, p5, p6, p7)));\
      }\
zhanyong.wan's avatar
zhanyong.wan committed
847
848
849
    };\
    template <typename arg_type>\
    operator ::testing::Matcher<arg_type>() const {\
850
      return ::testing::Matcher<arg_type>(\
851
          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7));\
zhanyong.wan's avatar
zhanyong.wan committed
852
853
854
855
    }\
    name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \
        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
        p5##_type gmock_p5, p6##_type gmock_p6, \
Abseil Team's avatar
Abseil Team committed
856
857
858
859
860
        p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \
        p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
        p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
        p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
        p7(::std::move(gmock_p7)) {\
zhanyong.wan's avatar
zhanyong.wan committed
861
    }\
862
863
864
865
866
867
868
869
    p0##_type const p0;\
    p1##_type const p1;\
    p2##_type const p2;\
    p3##_type const p3;\
    p4##_type const p4;\
    p5##_type const p5;\
    p6##_type const p6;\
    p7##_type const p7;\
870
   private:\
zhanyong.wan's avatar
zhanyong.wan committed
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
  };\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type, \
      typename p6##_type, typename p7##_type>\
  inline name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
      p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
      p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
      p6##_type p6, p7##_type p7) {\
    return name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
        p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
        p6, p7);\
  }\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type, \
      typename p6##_type, typename p7##_type>\
  template <typename arg_type>\
  bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
zhanyong.wan's avatar
zhanyong.wan committed
888
889
      p5##_type, p6##_type, \
      p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
890
      GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
zhanyong.wan's avatar
zhanyong.wan committed
891
892
      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
          const
zhanyong.wan's avatar
zhanyong.wan committed
893
894
895
896
897
898
899
900

#define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type, \
      typename p6##_type, typename p7##_type, typename p8##_type>\
  class name##MatcherP9 {\
   public:\
    template <typename arg_type>\
901
902
    class gmock_Impl : public ::testing::MatcherInterface<\
        GTEST_REFERENCE_TO_CONST_(arg_type)> {\
zhanyong.wan's avatar
zhanyong.wan committed
903
904
905
     public:\
      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
906
          p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\
Abseil Team's avatar
Abseil Team committed
907
908
909
910
911
           : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
               p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
               p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
               p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \
               p8(::std::move(gmock_p8)) {}\
zhanyong.wan's avatar
zhanyong.wan committed
912
      virtual bool MatchAndExplain(\
913
914
          GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
          ::testing::MatchResultListener* result_listener) const;\
915
      virtual void DescribeTo(::std::ostream* gmock_os) const {\
916
917
918
919
        *gmock_os << FormatDescription(false);\
      }\
      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
        *gmock_os << FormatDescription(true);\
zhanyong.wan's avatar
zhanyong.wan committed
920
      }\
921
922
923
924
925
926
927
928
929
      p0##_type const p0;\
      p1##_type const p1;\
      p2##_type const p2;\
      p3##_type const p3;\
      p4##_type const p4;\
      p5##_type const p5;\
      p6##_type const p6;\
      p7##_type const p7;\
      p8##_type const p8;\
930
     private:\
931
932
      ::std::string FormatDescription(bool negation) const {\
        ::std::string gmock_description = (description);\
933
        if (!gmock_description.empty()) {\
934
          return gmock_description;\
935
        }\
936
        return ::testing::internal::FormatMatcherDescription(\
937
            negation, #name, \
938
            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
Abseil Team's avatar
Abseil Team committed
939
                ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
940
941
942
                    p4##_type, p5##_type, p6##_type, p7##_type, \
                    p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
      }\
zhanyong.wan's avatar
zhanyong.wan committed
943
944
945
    };\
    template <typename arg_type>\
    operator ::testing::Matcher<arg_type>() const {\
946
      return ::testing::Matcher<arg_type>(\
947
          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8));\
zhanyong.wan's avatar
zhanyong.wan committed
948
949
950
951
    }\
    name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \
        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
Abseil Team's avatar
Abseil Team committed
952
953
954
955
956
        p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \
        p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
        p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
        p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
        p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)) {\
zhanyong.wan's avatar
zhanyong.wan committed
957
    }\
958
959
960
961
962
963
964
965
966
    p0##_type const p0;\
    p1##_type const p1;\
    p2##_type const p2;\
    p3##_type const p3;\
    p4##_type const p4;\
    p5##_type const p5;\
    p6##_type const p6;\
    p7##_type const p7;\
    p8##_type const p8;\
967
   private:\
zhanyong.wan's avatar
zhanyong.wan committed
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
  };\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type, \
      typename p6##_type, typename p7##_type, typename p8##_type>\
  inline name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
      p4##_type, p5##_type, p6##_type, p7##_type, \
      p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
      p8##_type p8) {\
    return name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
        p3, p4, p5, p6, p7, p8);\
  }\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type, \
      typename p6##_type, typename p7##_type, typename p8##_type>\
  template <typename arg_type>\
  bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
zhanyong.wan's avatar
zhanyong.wan committed
986
987
      p5##_type, p6##_type, p7##_type, \
      p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
988
      GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
zhanyong.wan's avatar
zhanyong.wan committed
989
990
      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
          const
zhanyong.wan's avatar
zhanyong.wan committed
991
992
993
994
995
996
997
998
999

#define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type, \
      typename p6##_type, typename p7##_type, typename p8##_type, \
      typename p9##_type>\
  class name##MatcherP10 {\
   public:\
    template <typename arg_type>\
1000
1001
    class gmock_Impl : public ::testing::MatcherInterface<\
        GTEST_REFERENCE_TO_CONST_(arg_type)> {\
zhanyong.wan's avatar
zhanyong.wan committed
1002
1003
1004
1005
     public:\
      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
          p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
1006
          p9##_type gmock_p9)\
Abseil Team's avatar
Abseil Team committed
1007
1008
1009
1010
1011
           : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
               p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
               p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
               p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \
               p8(::std::move(gmock_p8)), p9(::std::move(gmock_p9)) {}\
zhanyong.wan's avatar
zhanyong.wan committed
1012
      virtual bool MatchAndExplain(\
1013
1014
          GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
          ::testing::MatchResultListener* result_listener) const;\
1015
      virtual void DescribeTo(::std::ostream* gmock_os) const {\
1016
1017
1018
1019
        *gmock_os << FormatDescription(false);\
      }\
      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
        *gmock_os << FormatDescription(true);\
zhanyong.wan's avatar
zhanyong.wan committed
1020
      }\
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
      p0##_type const p0;\
      p1##_type const p1;\
      p2##_type const p2;\
      p3##_type const p3;\
      p4##_type const p4;\
      p5##_type const p5;\
      p6##_type const p6;\
      p7##_type const p7;\
      p8##_type const p8;\
      p9##_type const p9;\
1031
     private:\
1032
1033
      ::std::string FormatDescription(bool negation) const {\
        ::std::string gmock_description = (description);\
1034
        if (!gmock_description.empty()) {\
1035
          return gmock_description;\
1036
        }\
1037
        return ::testing::internal::FormatMatcherDescription(\
1038
            negation, #name, \
1039
            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
Abseil Team's avatar
Abseil Team committed
1040
                ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1041
1042
1043
                    p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
                    p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
      }\
zhanyong.wan's avatar
zhanyong.wan committed
1044
1045
1046
    };\
    template <typename arg_type>\
    operator ::testing::Matcher<arg_type>() const {\
1047
      return ::testing::Matcher<arg_type>(\
1048
          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9));\
zhanyong.wan's avatar
zhanyong.wan committed
1049
1050
1051
1052
    }\
    name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \
        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
Abseil Team's avatar
Abseil Team committed
1053
1054
1055
1056
1057
1058
        p8##_type gmock_p8, p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \
        p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
        p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
        p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
        p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \
        p9(::std::move(gmock_p9)) {\
zhanyong.wan's avatar
zhanyong.wan committed
1059
    }\
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
    p0##_type const p0;\
    p1##_type const p1;\
    p2##_type const p2;\
    p3##_type const p3;\
    p4##_type const p4;\
    p5##_type const p5;\
    p6##_type const p6;\
    p7##_type const p7;\
    p8##_type const p8;\
    p9##_type const p9;\
1070
   private:\
zhanyong.wan's avatar
zhanyong.wan committed
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
  };\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type, \
      typename p6##_type, typename p7##_type, typename p8##_type, \
      typename p9##_type>\
  inline name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
      p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
      p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
      p9##_type p9) {\
    return name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
        p1, p2, p3, p4, p5, p6, p7, p8, p9);\
  }\
  template <typename p0##_type, typename p1##_type, typename p2##_type, \
      typename p3##_type, typename p4##_type, typename p5##_type, \
      typename p6##_type, typename p7##_type, typename p8##_type, \
      typename p9##_type>\
  template <typename arg_type>\
  bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
zhanyong.wan's avatar
zhanyong.wan committed
1091
1092
      p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
      p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1093
      GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
zhanyong.wan's avatar
zhanyong.wan committed
1094
1095
      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
          const
zhanyong.wan's avatar
zhanyong.wan committed
1096

1097
#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_