1 // This file was GENERATED by command:
2 // pump.py gmock-generated-matchers.h.pump
3 // DO NOT EDIT BY HAND!!!
5 // Copyright 2008, Google Inc.
6 // All rights reserved.
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions are
12 // * Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 // * Redistributions in binary form must reproduce the above
15 // copyright notice, this list of conditions and the following disclaimer
16 // in the documentation and/or other materials provided with the
18 // * Neither the name of Google Inc. nor the names of its
19 // contributors may be used to endorse or promote products derived from
20 // this software without specific prior written permission.
22 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 // Google Mock - a framework for writing C++ mock classes.
36 // This file implements some commonly used variadic matchers.
38 // GOOGLETEST_CM0002 DO NOT DELETE
40 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
41 #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
48 #include "gmock/gmock-matchers.h"
50 // The MATCHER* family of macros can be used in a namespace scope to
51 // define custom matchers easily.
58 // MATCHER(name, description_string) { statements; }
60 // defines a matcher with the given name that executes the statements,
61 // which must return a bool to indicate if the match succeeds. Inside
62 // the statements, you can refer to the value being matched by 'arg',
63 // and refer to its type by 'arg_type'.
65 // The description string documents what the matcher does, and is used
66 // to generate the failure message when the match fails. Since a
67 // MATCHER() is usually defined in a header file shared by multiple
68 // C++ source files, we require the description to be a C-string
69 // literal to avoid possible side effects. It can be empty, in which
70 // case we'll use the sequence of words in the matcher name as the
75 // MATCHER(IsEven, "") { return (arg % 2) == 0; }
77 // allows you to write
79 // // Expects mock_foo.Bar(n) to be called where n is even.
80 // EXPECT_CALL(mock_foo, Bar(IsEven()));
84 // // Verifies that the value of some_expression is even.
85 // EXPECT_THAT(some_expression, IsEven());
87 // If the above assertion fails, it will print something like:
89 // Value of: some_expression
93 // where the description "is even" is automatically calculated from the
94 // matcher name IsEven.
99 // Note that the type of the value being matched (arg_type) is
100 // determined by the context in which you use the matcher and is
101 // supplied to you by the compiler, so you don't need to worry about
102 // declaring it (nor can you). This allows the matcher to be
103 // polymorphic. For example, IsEven() can be used to match any type
104 // where the value of "(arg % 2) == 0" can be implicitly converted to
105 // a bool. In the "Bar(IsEven())" example above, if method Bar()
106 // takes an int, 'arg_type' will be int; if it takes an unsigned long,
107 // 'arg_type' will be unsigned long; and so on.
109 // Parameterizing Matchers
110 // =======================
112 // Sometimes you'll want to parameterize the matcher. For that you
113 // can use another macro:
115 // MATCHER_P(name, param_name, description_string) { statements; }
119 // MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
121 // will allow you to write:
123 // EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
125 // which may lead to this message (assuming n is 10):
127 // Value of: Blah("a")
128 // Expected: has absolute value 10
131 // Note that both the matcher description and its parameter are
132 // printed, making the message human-friendly.
134 // In the matcher definition body, you can write 'foo_type' to
135 // reference the type of a parameter named 'foo'. For example, in the
136 // body of MATCHER_P(HasAbsoluteValue, value) above, you can write
137 // 'value_type' to refer to the type of 'value'.
139 // We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to
140 // support multi-parameter matchers.
142 // Describing Parameterized Matchers
143 // =================================
145 // The last argument to MATCHER*() is a string-typed expression. The
146 // expression can reference all of the matcher's parameters and a
147 // special bool-typed variable named 'negation'. When 'negation' is
148 // false, the expression should evaluate to the matcher's description;
149 // otherwise it should evaluate to the description of the negation of
150 // the matcher. For example,
152 // using testing::PrintToString;
154 // MATCHER_P2(InClosedRange, low, hi,
155 // std::string(negation ? "is not" : "is") + " in range [" +
156 // PrintToString(low) + ", " + PrintToString(hi) + "]") {
157 // return low <= arg && arg <= hi;
160 // EXPECT_THAT(3, InClosedRange(4, 6));
161 // EXPECT_THAT(3, Not(InClosedRange(2, 4)));
163 // would generate two failures that contain the text:
165 // Expected: is in range [4, 6]
167 // Expected: is not in range [2, 4]
169 // If you specify "" as the description, the failure message will
170 // contain the sequence of words in the matcher name followed by the
171 // parameter values printed as a tuple. For example,
173 // MATCHER_P2(InClosedRange, low, hi, "") { ... }
175 // EXPECT_THAT(3, InClosedRange(4, 6));
176 // EXPECT_THAT(3, Not(InClosedRange(2, 4)));
178 // would generate two failures that contain the text:
180 // Expected: in closed range (4, 6)
182 // Expected: not (in closed range (2, 4))
184 // Types of Matcher Parameters
185 // ===========================
187 // For the purpose of typing, you can view
189 // MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
193 // template <typename p1_type, ..., typename pk_type>
194 // FooMatcherPk<p1_type, ..., pk_type>
195 // Foo(p1_type p1, ..., pk_type pk) { ... }
197 // When you write Foo(v1, ..., vk), the compiler infers the types of
198 // the parameters v1, ..., and vk for you. If you are not happy with
199 // the result of the type inference, you can specify the types by
200 // explicitly instantiating the template, as in Foo<long, bool>(5,
201 // false). As said earlier, you don't get to (or need to) specify
202 // 'arg_type' as that's determined by the context in which the matcher
203 // is used. You can assign the result of expression Foo(p1, ..., pk)
204 // to a variable of type FooMatcherPk<p1_type, ..., pk_type>. This
205 // can be useful when composing matchers.
207 // While you can instantiate a matcher template with reference types,
208 // passing the parameters by pointer usually makes your code more
209 // readable. If, however, you still want to pass a parameter by
210 // reference, be aware that in the failure message generated by the
211 // matcher you will see the value of the referenced object but not its
214 // Explaining Match Results
215 // ========================
217 // Sometimes the matcher description alone isn't enough to explain why
218 // the match has failed or succeeded. For example, when expecting a
219 // long string, it can be very helpful to also print the diff between
220 // the expected string and the actual one. To achieve that, you can
221 // optionally stream additional information to a special variable
222 // named result_listener, whose type is a pointer to class
223 // MatchResultListener:
225 // MATCHER_P(EqualsLongString, str, "") {
226 // if (arg == str) return true;
228 // *result_listener << "the difference: "
229 /// << DiffStrings(str, arg);
233 // Overloading Matchers
234 // ====================
236 // You can overload matchers with different numbers of parameters:
238 // MATCHER_P(Blah, a, description_string1) { ... }
239 // MATCHER_P2(Blah, a, b, description_string2) { ... }
244 // When defining a new matcher, you should also consider implementing
245 // MatcherInterface or using MakePolymorphicMatcher(). These
246 // approaches require more work than the MATCHER* macros, but also
247 // give you more control on the types of the value being matched and
248 // the matcher parameters, which may leads to better compiler error
249 // messages when the matcher is used wrong. They also allow
250 // overloading matchers based on parameter types (as opposed to just
251 // based on the number of parameters).
253 // MATCHER*() can only be used in a namespace scope as templates cannot be
254 // declared inside of a local class.
259 // To learn more about using these macros, please search for 'MATCHER'
261 // https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md
263 #define MATCHER(name, description)\
264 class name##Matcher {\
266 template <typename arg_type>\
267 class gmock_Impl : public ::testing::MatcherInterface<\
268 GTEST_REFERENCE_TO_CONST_(arg_type)> {\
272 virtual bool MatchAndExplain(\
273 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
274 ::testing::MatchResultListener* result_listener) const;\
275 virtual void DescribeTo(::std::ostream* gmock_os) const {\
276 *gmock_os << FormatDescription(false);\
278 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
279 *gmock_os << FormatDescription(true);\
282 ::std::string FormatDescription(bool negation) const {\
283 ::std::string gmock_description = (description);\
284 if (!gmock_description.empty()) {\
285 return gmock_description;\
287 return ::testing::internal::FormatMatcherDescription(\
289 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
293 template <typename arg_type>\
294 operator ::testing::Matcher<arg_type>() const {\
295 return ::testing::Matcher<arg_type>(\
296 new gmock_Impl<arg_type>());\
302 inline name##Matcher name() {\
303 return name##Matcher();\
305 template <typename arg_type>\
306 bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\
307 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
308 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
311 #define MATCHER_P(name, p0, description)\
312 template <typename p0##_type>\
313 class name##MatcherP {\
315 template <typename arg_type>\
316 class gmock_Impl : public ::testing::MatcherInterface<\
317 GTEST_REFERENCE_TO_CONST_(arg_type)> {\
319 explicit gmock_Impl(p0##_type gmock_p0)\
320 : p0(::std::move(gmock_p0)) {}\
321 virtual bool MatchAndExplain(\
322 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
323 ::testing::MatchResultListener* result_listener) const;\
324 virtual void DescribeTo(::std::ostream* gmock_os) const {\
325 *gmock_os << FormatDescription(false);\
327 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
328 *gmock_os << FormatDescription(true);\
332 ::std::string FormatDescription(bool negation) const {\
333 ::std::string gmock_description = (description);\
334 if (!gmock_description.empty()) {\
335 return gmock_description;\
337 return ::testing::internal::FormatMatcherDescription(\
339 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
340 ::std::tuple<p0##_type>(p0)));\
343 template <typename arg_type>\
344 operator ::testing::Matcher<arg_type>() const {\
345 return ::testing::Matcher<arg_type>(\
346 new gmock_Impl<arg_type>(p0));\
348 explicit name##MatcherP(p0##_type gmock_p0) : p0(::std::move(gmock_p0)) {\
353 template <typename p0##_type>\
354 inline name##MatcherP<p0##_type> name(p0##_type p0) {\
355 return name##MatcherP<p0##_type>(p0);\
357 template <typename p0##_type>\
358 template <typename arg_type>\
359 bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
360 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
361 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
364 #define MATCHER_P2(name, p0, p1, description)\
365 template <typename p0##_type, typename p1##_type>\
366 class name##MatcherP2 {\
368 template <typename arg_type>\
369 class gmock_Impl : public ::testing::MatcherInterface<\
370 GTEST_REFERENCE_TO_CONST_(arg_type)> {\
372 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\
373 : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)) {}\
374 virtual bool MatchAndExplain(\
375 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
376 ::testing::MatchResultListener* result_listener) const;\
377 virtual void DescribeTo(::std::ostream* gmock_os) const {\
378 *gmock_os << FormatDescription(false);\
380 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
381 *gmock_os << FormatDescription(true);\
386 ::std::string FormatDescription(bool negation) const {\
387 ::std::string gmock_description = (description);\
388 if (!gmock_description.empty()) {\
389 return gmock_description;\
391 return ::testing::internal::FormatMatcherDescription(\
393 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
394 ::std::tuple<p0##_type, p1##_type>(p0, p1)));\
397 template <typename arg_type>\
398 operator ::testing::Matcher<arg_type>() const {\
399 return ::testing::Matcher<arg_type>(\
400 new gmock_Impl<arg_type>(p0, p1));\
402 name##MatcherP2(p0##_type gmock_p0, \
403 p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \
404 p1(::std::move(gmock_p1)) {\
410 template <typename p0##_type, typename p1##_type>\
411 inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \
413 return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\
415 template <typename p0##_type, typename p1##_type>\
416 template <typename arg_type>\
417 bool name##MatcherP2<p0##_type, \
418 p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
419 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
420 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
423 #define MATCHER_P3(name, p0, p1, p2, description)\
424 template <typename p0##_type, typename p1##_type, typename p2##_type>\
425 class name##MatcherP3 {\
427 template <typename arg_type>\
428 class gmock_Impl : public ::testing::MatcherInterface<\
429 GTEST_REFERENCE_TO_CONST_(arg_type)> {\
431 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\
432 : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
433 p2(::std::move(gmock_p2)) {}\
434 virtual bool MatchAndExplain(\
435 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
436 ::testing::MatchResultListener* result_listener) const;\
437 virtual void DescribeTo(::std::ostream* gmock_os) const {\
438 *gmock_os << FormatDescription(false);\
440 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
441 *gmock_os << FormatDescription(true);\
447 ::std::string FormatDescription(bool negation) const {\
448 ::std::string gmock_description = (description);\
449 if (!gmock_description.empty()) {\
450 return gmock_description;\
452 return ::testing::internal::FormatMatcherDescription(\
454 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
455 ::std::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, p2)));\
458 template <typename arg_type>\
459 operator ::testing::Matcher<arg_type>() const {\
460 return ::testing::Matcher<arg_type>(\
461 new gmock_Impl<arg_type>(p0, p1, p2));\
463 name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \
464 p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \
465 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)) {\
472 template <typename p0##_type, typename p1##_type, typename p2##_type>\
473 inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
474 p1##_type p1, p2##_type p2) {\
475 return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
477 template <typename p0##_type, typename p1##_type, typename p2##_type>\
478 template <typename arg_type>\
479 bool name##MatcherP3<p0##_type, p1##_type, \
480 p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
481 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
482 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
485 #define MATCHER_P4(name, p0, p1, p2, p3, description)\
486 template <typename p0##_type, typename p1##_type, typename p2##_type, \
488 class name##MatcherP4 {\
490 template <typename arg_type>\
491 class gmock_Impl : public ::testing::MatcherInterface<\
492 GTEST_REFERENCE_TO_CONST_(arg_type)> {\
494 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
496 : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
497 p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)) {}\
498 virtual bool MatchAndExplain(\
499 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
500 ::testing::MatchResultListener* result_listener) const;\
501 virtual void DescribeTo(::std::ostream* gmock_os) const {\
502 *gmock_os << FormatDescription(false);\
504 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
505 *gmock_os << FormatDescription(true);\
512 ::std::string FormatDescription(bool negation) const {\
513 ::std::string gmock_description = (description);\
514 if (!gmock_description.empty()) {\
515 return gmock_description;\
517 return ::testing::internal::FormatMatcherDescription(\
519 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
520 ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
524 template <typename arg_type>\
525 operator ::testing::Matcher<arg_type>() const {\
526 return ::testing::Matcher<arg_type>(\
527 new gmock_Impl<arg_type>(p0, p1, p2, p3));\
529 name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \
530 p2##_type gmock_p2, p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \
531 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
532 p3(::std::move(gmock_p3)) {\
540 template <typename p0##_type, typename p1##_type, typename p2##_type, \
542 inline name##MatcherP4<p0##_type, p1##_type, p2##_type, \
543 p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
545 return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
548 template <typename p0##_type, typename p1##_type, typename p2##_type, \
550 template <typename arg_type>\
551 bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \
552 p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
553 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
554 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
557 #define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\
558 template <typename p0##_type, typename p1##_type, typename p2##_type, \
559 typename p3##_type, typename p4##_type>\
560 class name##MatcherP5 {\
562 template <typename arg_type>\
563 class gmock_Impl : public ::testing::MatcherInterface<\
564 GTEST_REFERENCE_TO_CONST_(arg_type)> {\
566 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
567 p3##_type gmock_p3, p4##_type gmock_p4)\
568 : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
569 p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
570 p4(::std::move(gmock_p4)) {}\
571 virtual bool MatchAndExplain(\
572 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
573 ::testing::MatchResultListener* result_listener) const;\
574 virtual void DescribeTo(::std::ostream* gmock_os) const {\
575 *gmock_os << FormatDescription(false);\
577 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
578 *gmock_os << FormatDescription(true);\
586 ::std::string FormatDescription(bool negation) const {\
587 ::std::string gmock_description = (description);\
588 if (!gmock_description.empty()) {\
589 return gmock_description;\
591 return ::testing::internal::FormatMatcherDescription(\
593 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
594 ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
595 p4##_type>(p0, p1, p2, p3, p4)));\
598 template <typename arg_type>\
599 operator ::testing::Matcher<arg_type>() const {\
600 return ::testing::Matcher<arg_type>(\
601 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\
603 name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \
604 p2##_type gmock_p2, p3##_type gmock_p3, \
605 p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \
606 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
607 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)) {\
616 template <typename p0##_type, typename p1##_type, typename p2##_type, \
617 typename p3##_type, typename p4##_type>\
618 inline name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
619 p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
621 return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
622 p4##_type>(p0, p1, p2, p3, p4);\
624 template <typename p0##_type, typename p1##_type, typename p2##_type, \
625 typename p3##_type, typename p4##_type>\
626 template <typename arg_type>\
627 bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
628 p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
629 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
630 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
633 #define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\
634 template <typename p0##_type, typename p1##_type, typename p2##_type, \
635 typename p3##_type, typename p4##_type, typename p5##_type>\
636 class name##MatcherP6 {\
638 template <typename arg_type>\
639 class gmock_Impl : public ::testing::MatcherInterface<\
640 GTEST_REFERENCE_TO_CONST_(arg_type)> {\
642 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)\
644 : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
645 p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
646 p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)) {}\
647 virtual bool MatchAndExplain(\
648 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
649 ::testing::MatchResultListener* result_listener) const;\
650 virtual void DescribeTo(::std::ostream* gmock_os) const {\
651 *gmock_os << FormatDescription(false);\
653 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
654 *gmock_os << FormatDescription(true);\
663 ::std::string FormatDescription(bool negation) const {\
664 ::std::string gmock_description = (description);\
665 if (!gmock_description.empty()) {\
666 return gmock_description;\
668 return ::testing::internal::FormatMatcherDescription(\
670 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
671 ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
672 p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
675 template <typename arg_type>\
676 operator ::testing::Matcher<arg_type>() const {\
677 return ::testing::Matcher<arg_type>(\
678 new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\
680 name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \
681 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
682 p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \
683 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
684 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
685 p5(::std::move(gmock_p5)) {\
695 template <typename p0##_type, typename p1##_type, typename p2##_type, \
696 typename p3##_type, typename p4##_type, typename p5##_type>\
697 inline name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
698 p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
699 p3##_type p3, p4##_type p4, p5##_type p5) {\
700 return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
701 p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
703 template <typename p0##_type, typename p1##_type, typename p2##_type, \
704 typename p3##_type, typename p4##_type, typename p5##_type>\
705 template <typename arg_type>\
706 bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
707 p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
708 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
709 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
712 #define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\
713 template <typename p0##_type, typename p1##_type, typename p2##_type, \
714 typename p3##_type, typename p4##_type, typename p5##_type, \
716 class name##MatcherP7 {\
718 template <typename arg_type>\
719 class gmock_Impl : public ::testing::MatcherInterface<\
720 GTEST_REFERENCE_TO_CONST_(arg_type)> {\
722 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
723 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
725 : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
726 p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
727 p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
728 p6(::std::move(gmock_p6)) {}\
729 virtual bool MatchAndExplain(\
730 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
731 ::testing::MatchResultListener* result_listener) const;\
732 virtual void DescribeTo(::std::ostream* gmock_os) const {\
733 *gmock_os << FormatDescription(false);\
735 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
736 *gmock_os << FormatDescription(true);\
746 ::std::string FormatDescription(bool negation) const {\
747 ::std::string gmock_description = (description);\
748 if (!gmock_description.empty()) {\
749 return gmock_description;\
751 return ::testing::internal::FormatMatcherDescription(\
753 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
754 ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
755 p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
759 template <typename arg_type>\
760 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));\
764 name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \
765 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
766 p5##_type gmock_p5, p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \
767 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
768 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
769 p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)) {\
780 template <typename p0##_type, typename p1##_type, typename p2##_type, \
781 typename p3##_type, typename p4##_type, typename p5##_type, \
783 inline name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
784 p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
785 p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
787 return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
788 p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
790 template <typename p0##_type, typename p1##_type, typename p2##_type, \
791 typename p3##_type, typename p4##_type, typename p5##_type, \
793 template <typename arg_type>\
794 bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
795 p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
796 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
797 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
800 #define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\
801 template <typename p0##_type, typename p1##_type, typename p2##_type, \
802 typename p3##_type, typename p4##_type, typename p5##_type, \
803 typename p6##_type, typename p7##_type>\
804 class name##MatcherP8 {\
806 template <typename arg_type>\
807 class gmock_Impl : public ::testing::MatcherInterface<\
808 GTEST_REFERENCE_TO_CONST_(arg_type)> {\
810 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
811 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
812 p6##_type gmock_p6, p7##_type gmock_p7)\
813 : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
814 p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
815 p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
816 p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)) {}\
817 virtual bool MatchAndExplain(\
818 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
819 ::testing::MatchResultListener* result_listener) const;\
820 virtual void DescribeTo(::std::ostream* gmock_os) const {\
821 *gmock_os << FormatDescription(false);\
823 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
824 *gmock_os << FormatDescription(true);\
835 ::std::string FormatDescription(bool negation) const {\
836 ::std::string gmock_description = (description);\
837 if (!gmock_description.empty()) {\
838 return gmock_description;\
840 return ::testing::internal::FormatMatcherDescription(\
842 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
843 ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
844 p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
845 p3, p4, p5, p6, p7)));\
848 template <typename arg_type>\
849 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));\
853 name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \
854 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
855 p5##_type gmock_p5, p6##_type gmock_p6, \
856 p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \
857 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
858 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
859 p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
860 p7(::std::move(gmock_p7)) {\
872 template <typename p0##_type, typename p1##_type, typename p2##_type, \
873 typename p3##_type, typename p4##_type, typename p5##_type, \
874 typename p6##_type, typename p7##_type>\
875 inline name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
876 p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
877 p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
878 p6##_type p6, p7##_type p7) {\
879 return name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
880 p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
883 template <typename p0##_type, typename p1##_type, typename p2##_type, \
884 typename p3##_type, typename p4##_type, typename p5##_type, \
885 typename p6##_type, typename p7##_type>\
886 template <typename arg_type>\
887 bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
888 p5##_type, p6##_type, \
889 p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
890 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
891 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
894 #define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\
895 template <typename p0##_type, typename p1##_type, typename p2##_type, \
896 typename p3##_type, typename p4##_type, typename p5##_type, \
897 typename p6##_type, typename p7##_type, typename p8##_type>\
898 class name##MatcherP9 {\
900 template <typename arg_type>\
901 class gmock_Impl : public ::testing::MatcherInterface<\
902 GTEST_REFERENCE_TO_CONST_(arg_type)> {\
904 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
905 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)\
907 : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
908 p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
909 p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
910 p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \
911 p8(::std::move(gmock_p8)) {}\
912 virtual bool MatchAndExplain(\
913 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
914 ::testing::MatchResultListener* result_listener) const;\
915 virtual void DescribeTo(::std::ostream* gmock_os) const {\
916 *gmock_os << FormatDescription(false);\
918 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
919 *gmock_os << FormatDescription(true);\
931 ::std::string FormatDescription(bool negation) const {\
932 ::std::string gmock_description = (description);\
933 if (!gmock_description.empty()) {\
934 return gmock_description;\
936 return ::testing::internal::FormatMatcherDescription(\
938 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
939 ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
940 p4##_type, p5##_type, p6##_type, p7##_type, \
941 p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
944 template <typename arg_type>\
945 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));\
949 name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \
950 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
951 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
952 p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \
953 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
954 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
955 p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
956 p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)) {\
969 template <typename p0##_type, typename p1##_type, typename p2##_type, \
970 typename p3##_type, typename p4##_type, typename p5##_type, \
971 typename p6##_type, typename p7##_type, typename p8##_type>\
972 inline name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
973 p4##_type, p5##_type, p6##_type, p7##_type, \
974 p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
975 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
977 return name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
978 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
979 p3, p4, p5, p6, p7, p8);\
981 template <typename p0##_type, typename p1##_type, typename p2##_type, \
982 typename p3##_type, typename p4##_type, typename p5##_type, \
983 typename p6##_type, typename p7##_type, typename p8##_type>\
984 template <typename arg_type>\
985 bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
986 p5##_type, p6##_type, p7##_type, \
987 p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
988 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
989 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
992 #define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)\
993 template <typename p0##_type, typename p1##_type, typename p2##_type, \
994 typename p3##_type, typename p4##_type, typename p5##_type, \
995 typename p6##_type, typename p7##_type, typename p8##_type, \
997 class name##MatcherP10 {\
999 template <typename arg_type>\
1000 class gmock_Impl : public ::testing::MatcherInterface<\
1001 GTEST_REFERENCE_TO_CONST_(arg_type)> {\
1003 gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1004 p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1005 p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
1006 p9##_type gmock_p9)\
1007 : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
1008 p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
1009 p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
1010 p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \
1011 p8(::std::move(gmock_p8)), p9(::std::move(gmock_p9)) {}\
1012 virtual bool MatchAndExplain(\
1013 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
1014 ::testing::MatchResultListener* result_listener) const;\
1015 virtual void DescribeTo(::std::ostream* gmock_os) const {\
1016 *gmock_os << FormatDescription(false);\
1018 virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
1019 *gmock_os << FormatDescription(true);\
1021 p0##_type const p0;\
1022 p1##_type const p1;\
1023 p2##_type const p2;\
1024 p3##_type const p3;\
1025 p4##_type const p4;\
1026 p5##_type const p5;\
1027 p6##_type const p6;\
1028 p7##_type const p7;\
1029 p8##_type const p8;\
1030 p9##_type const p9;\
1032 ::std::string FormatDescription(bool negation) const {\
1033 ::std::string gmock_description = (description);\
1034 if (!gmock_description.empty()) {\
1035 return gmock_description;\
1037 return ::testing::internal::FormatMatcherDescription(\
1039 ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
1040 ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
1041 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
1042 p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
1045 template <typename arg_type>\
1046 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));\
1050 name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \
1051 p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1052 p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
1053 p8##_type gmock_p8, p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \
1054 p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
1055 p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
1056 p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
1057 p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \
1058 p9(::std::move(gmock_p9)) {\
1060 p0##_type const p0;\
1061 p1##_type const p1;\
1062 p2##_type const p2;\
1063 p3##_type const p3;\
1064 p4##_type const p4;\
1065 p5##_type const p5;\
1066 p6##_type const p6;\
1067 p7##_type const p7;\
1068 p8##_type const p8;\
1069 p9##_type const p9;\
1072 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1073 typename p3##_type, typename p4##_type, typename p5##_type, \
1074 typename p6##_type, typename p7##_type, typename p8##_type, \
1075 typename p9##_type>\
1076 inline name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
1077 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
1078 p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1079 p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
1081 return name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
1082 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
1083 p1, p2, p3, p4, p5, p6, p7, p8, p9);\
1085 template <typename p0##_type, typename p1##_type, typename p2##_type, \
1086 typename p3##_type, typename p4##_type, typename p5##_type, \
1087 typename p6##_type, typename p7##_type, typename p8##_type, \
1088 typename p9##_type>\
1089 template <typename arg_type>\
1090 bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
1091 p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
1092 p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
1093 GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
1094 ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
1097 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_