| 1 | // This file was GENERATED by command: |
| 2 | // pump.py gmock-generated-matchers.h.pump |
| 3 | // DO NOT EDIT BY HAND!!! |
| 4 | |
| 5 | // Copyright 2008, Google Inc. |
| 6 | // All rights reserved. |
| 7 | // |
| 8 | // Redistribution and use in source and binary forms, with or without |
| 9 | // modification, are permitted provided that the following conditions are |
| 10 | // met: |
| 11 | // |
| 12 | // * Redistributions of source code must retain the above copyright |
| 13 | // notice, this list of conditions and the following disclaimer. |
| 14 | // * Redistributions in binary form must reproduce the above |
| 15 | // copyright notice, this list of conditions and the following disclaimer |
| 16 | // in the documentation and/or other materials provided with the |
| 17 | // distribution. |
| 18 | // * Neither the name of Google Inc. nor the names of its |
| 19 | // contributors may be used to endorse or promote products derived from |
| 20 | // this software without specific prior written permission. |
| 21 | // |
| 22 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 23 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 24 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 25 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 26 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 27 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 28 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 29 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 30 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 31 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 32 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 33 | |
| 34 | // Google Mock - a framework for writing C++ mock classes. |
| 35 | // |
| 36 | // This file implements some commonly used variadic matchers. |
| 37 | |
| 38 | // GOOGLETEST_CM0002 DO NOT DELETE |
| 39 | |
| 40 | #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ |
| 41 | #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ |
| 42 | |
| 43 | #include <iterator> |
| 44 | #include <sstream> |
| 45 | #include <string> |
| 46 | #include <utility> |
| 47 | #include <vector> |
| 48 | #include "gmock/gmock-matchers.h" |
| 49 | |
| 50 | // The MATCHER* family of macros can be used in a namespace scope to |
| 51 | // define custom matchers easily. |
| 52 | // |
| 53 | // Basic Usage |
| 54 | // =========== |
| 55 | // |
| 56 | // The syntax |
| 57 | // |
| 58 | // MATCHER(name, description_string) { statements; } |
| 59 | // |
| 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'. |
| 64 | // |
| 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 |
| 71 | // description. |
| 72 | // |
| 73 | // For example: |
| 74 | // |
| 75 | // MATCHER(IsEven, "") { return (arg % 2) == 0; } |
| 76 | // |
| 77 | // allows you to write |
| 78 | // |
| 79 | // // Expects mock_foo.Bar(n) to be called where n is even. |
| 80 | // EXPECT_CALL(mock_foo, Bar(IsEven())); |
| 81 | // |
| 82 | // or, |
| 83 | // |
| 84 | // // Verifies that the value of some_expression is even. |
| 85 | // EXPECT_THAT(some_expression, IsEven()); |
| 86 | // |
| 87 | // If the above assertion fails, it will print something like: |
| 88 | // |
| 89 | // Value of: some_expression |
| 90 | // Expected: is even |
| 91 | // Actual: 7 |
| 92 | // |
| 93 | // where the description "is even" is automatically calculated from the |
| 94 | // matcher name IsEven. |
| 95 | // |
| 96 | // Argument Type |
| 97 | // ============= |
| 98 | // |
| 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. |
| 108 | // |
| 109 | // Parameterizing Matchers |
| 110 | // ======================= |
| 111 | // |
| 112 | // Sometimes you'll want to parameterize the matcher. For that you |
| 113 | // can use another macro: |
| 114 | // |
| 115 | // MATCHER_P(name, param_name, description_string) { statements; } |
| 116 | // |
| 117 | // For example: |
| 118 | // |
| 119 | // MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; } |
| 120 | // |
| 121 | // will allow you to write: |
| 122 | // |
| 123 | // EXPECT_THAT(Blah("a"), HasAbsoluteValue(n)); |
| 124 | // |
| 125 | // which may lead to this message (assuming n is 10): |
| 126 | // |
| 127 | // Value of: Blah("a") |
| 128 | // Expected: has absolute value 10 |
| 129 | // Actual: -9 |
| 130 | // |
| 131 | // Note that both the matcher description and its parameter are |
| 132 | // printed, making the message human-friendly. |
| 133 | // |
| 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'. |
| 138 | // |
| 139 | // We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to |
| 140 | // support multi-parameter matchers. |
| 141 | // |
| 142 | // Describing Parameterized Matchers |
| 143 | // ================================= |
| 144 | // |
| 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, |
| 151 | // |
| 152 | // using testing::PrintToString; |
| 153 | // |
| 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; |
| 158 | // } |
| 159 | // ... |
| 160 | // 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 | // 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, |
| 172 | // |
| 173 | // MATCHER_P2(InClosedRange, low, hi, "") { ... } |
| 174 | // ... |
| 175 | // 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 | // |
| 184 | // Types of Matcher Parameters |
| 185 | // =========================== |
| 186 | // |
| 187 | // For the purpose of typing, you can view |
| 188 | // |
| 189 | // MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... } |
| 190 | // |
| 191 | // as shorthand for |
| 192 | // |
| 193 | // template <typename p1_type, ..., typename pk_type> |
| 194 | // FooMatcherPk<p1_type, ..., pk_type> |
| 195 | // Foo(p1_type p1, ..., pk_type pk) { ... } |
| 196 | // |
| 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. |
| 206 | // |
| 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 |
| 212 | // address. |
| 213 | // |
| 214 | // Explaining Match Results |
| 215 | // ======================== |
| 216 | // |
| 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: |
| 224 | // |
| 225 | // MATCHER_P(EqualsLongString, str, "") { |
| 226 | // if (arg == str) return true; |
| 227 | // |
| 228 | // *result_listener << "the difference: " |
| 229 | /// << DiffStrings(str, arg); |
| 230 | // return false; |
| 231 | // } |
| 232 | // |
| 233 | // Overloading Matchers |
| 234 | // ==================== |
| 235 | // |
| 236 | // You can overload matchers with different numbers of parameters: |
| 237 | // |
| 238 | // MATCHER_P(Blah, a, description_string1) { ... } |
| 239 | // MATCHER_P2(Blah, a, b, description_string2) { ... } |
| 240 | // |
| 241 | // Caveats |
| 242 | // ======= |
| 243 | // |
| 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). |
| 252 | // |
| 253 | // MATCHER*() can only be used in a namespace scope as templates cannot be |
| 254 | // declared inside of a local class. |
| 255 | // |
| 256 | // More Information |
| 257 | // ================ |
| 258 | // |
| 259 | // To learn more about using these macros, please search for 'MATCHER' |
| 260 | // on |
| 261 | // https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md |
| 262 | |
| 263 | #define MATCHER(name, description)\ |
| 264 | class name##Matcher {\ |
| 265 | public:\ |
| 266 | template <typename arg_type>\ |
| 267 | class gmock_Impl : public ::testing::MatcherInterface<\ |
| 268 | GTEST_REFERENCE_TO_CONST_(arg_type)> {\ |
| 269 | public:\ |
| 270 | gmock_Impl()\ |
| 271 | {}\ |
| 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);\ |
| 277 | }\ |
| 278 | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ |
| 279 | *gmock_os << FormatDescription(true);\ |
| 280 | }\ |
| 281 | private:\ |
| 282 | ::std::string FormatDescription(bool negation) const {\ |
| 283 | ::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(\ |
| 290 | ::std::tuple<>()));\ |
| 291 | }\ |
| 292 | };\ |
| 293 | template <typename arg_type>\ |
| 294 | operator ::testing::Matcher<arg_type>() const {\ |
| 295 | return ::testing::Matcher<arg_type>(\ |
| 296 | new gmock_Impl<arg_type>());\ |
| 297 | }\ |
| 298 | name##Matcher() {\ |
| 299 | }\ |
| 300 | private:\ |
| 301 | };\ |
| 302 | inline name##Matcher name() {\ |
| 303 | return name##Matcher();\ |
| 304 | }\ |
| 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_)\ |
| 309 | const |
| 310 | |
| 311 | #define MATCHER_P(name, p0, description)\ |
| 312 | template <typename p0##_type>\ |
| 313 | class name##MatcherP {\ |
| 314 | public:\ |
| 315 | template <typename arg_type>\ |
| 316 | class gmock_Impl : public ::testing::MatcherInterface<\ |
| 317 | GTEST_REFERENCE_TO_CONST_(arg_type)> {\ |
| 318 | public:\ |
| 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);\ |
| 326 | }\ |
| 327 | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ |
| 328 | *gmock_os << FormatDescription(true);\ |
| 329 | }\ |
| 330 | p0##_type const p0;\ |
| 331 | private:\ |
| 332 | ::std::string FormatDescription(bool negation) const {\ |
| 333 | ::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(\ |
| 340 | ::std::tuple<p0##_type>(p0)));\ |
| 341 | }\ |
| 342 | };\ |
| 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));\ |
| 347 | }\ |
| 348 | explicit name##MatcherP(p0##_type gmock_p0) : p0(::std::move(gmock_p0)) {\ |
| 349 | }\ |
| 350 | p0##_type const p0;\ |
| 351 | private:\ |
| 352 | };\ |
| 353 | template <typename p0##_type>\ |
| 354 | inline name##MatcherP<p0##_type> name(p0##_type p0) {\ |
| 355 | return name##MatcherP<p0##_type>(p0);\ |
| 356 | }\ |
| 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_)\ |
| 362 | const |
| 363 | |
| 364 | #define MATCHER_P2(name, p0, p1, description)\ |
| 365 | template <typename p0##_type, typename p1##_type>\ |
| 366 | class name##MatcherP2 {\ |
| 367 | public:\ |
| 368 | template <typename arg_type>\ |
| 369 | class gmock_Impl : public ::testing::MatcherInterface<\ |
| 370 | GTEST_REFERENCE_TO_CONST_(arg_type)> {\ |
| 371 | public:\ |
| 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);\ |
| 379 | }\ |
| 380 | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ |
| 381 | *gmock_os << FormatDescription(true);\ |
| 382 | }\ |
| 383 | p0##_type const p0;\ |
| 384 | p1##_type const p1;\ |
| 385 | private:\ |
| 386 | ::std::string FormatDescription(bool negation) const {\ |
| 387 | ::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(\ |
| 394 | ::std::tuple<p0##_type, p1##_type>(p0, p1)));\ |
| 395 | }\ |
| 396 | };\ |
| 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));\ |
| 401 | }\ |
| 402 | name##MatcherP2(p0##_type gmock_p0, \ |
| 403 | p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \ |
| 404 | p1(::std::move(gmock_p1)) {\ |
| 405 | }\ |
| 406 | p0##_type const p0;\ |
| 407 | p1##_type const p1;\ |
| 408 | private:\ |
| 409 | };\ |
| 410 | template <typename p0##_type, typename p1##_type>\ |
| 411 | inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \ |
| 412 | p1##_type p1) {\ |
| 413 | return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\ |
| 414 | }\ |
| 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_)\ |
| 421 | const |
| 422 | |
| 423 | #define MATCHER_P3(name, p0, p1, p2, description)\ |
| 424 | template <typename p0##_type, typename p1##_type, typename p2##_type>\ |
| 425 | class name##MatcherP3 {\ |
| 426 | public:\ |
| 427 | template <typename arg_type>\ |
| 428 | class gmock_Impl : public ::testing::MatcherInterface<\ |
| 429 | GTEST_REFERENCE_TO_CONST_(arg_type)> {\ |
| 430 | public:\ |
| 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);\ |
| 439 | }\ |
| 440 | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ |
| 441 | *gmock_os << FormatDescription(true);\ |
| 442 | }\ |
| 443 | p0##_type const p0;\ |
| 444 | p1##_type const p1;\ |
| 445 | p2##_type const p2;\ |
| 446 | private:\ |
| 447 | ::std::string FormatDescription(bool negation) const {\ |
| 448 | ::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(\ |
| 455 | ::std::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, p2)));\ |
| 456 | }\ |
| 457 | };\ |
| 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));\ |
| 462 | }\ |
| 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)) {\ |
| 466 | }\ |
| 467 | p0##_type const p0;\ |
| 468 | p1##_type const p1;\ |
| 469 | p2##_type const p2;\ |
| 470 | private:\ |
| 471 | };\ |
| 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);\ |
| 476 | }\ |
| 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_)\ |
| 483 | const |
| 484 | |
| 485 | #define MATCHER_P4(name, p0, p1, p2, p3, description)\ |
| 486 | template <typename p0##_type, typename p1##_type, typename p2##_type, \ |
| 487 | typename p3##_type>\ |
| 488 | class name##MatcherP4 {\ |
| 489 | public:\ |
| 490 | template <typename arg_type>\ |
| 491 | class gmock_Impl : public ::testing::MatcherInterface<\ |
| 492 | GTEST_REFERENCE_TO_CONST_(arg_type)> {\ |
| 493 | public:\ |
| 494 | gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ |
| 495 | p3##_type gmock_p3)\ |
| 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);\ |
| 503 | }\ |
| 504 | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ |
| 505 | *gmock_os << FormatDescription(true);\ |
| 506 | }\ |
| 507 | p0##_type const p0;\ |
| 508 | p1##_type const p1;\ |
| 509 | p2##_type const p2;\ |
| 510 | p3##_type const p3;\ |
| 511 | private:\ |
| 512 | ::std::string FormatDescription(bool negation) const {\ |
| 513 | ::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(\ |
| 520 | ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \ |
| 521 | p1, p2, p3)));\ |
| 522 | }\ |
| 523 | };\ |
| 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));\ |
| 528 | }\ |
| 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)) {\ |
| 533 | }\ |
| 534 | p0##_type const p0;\ |
| 535 | p1##_type const p1;\ |
| 536 | p2##_type const p2;\ |
| 537 | p3##_type const p3;\ |
| 538 | private:\ |
| 539 | };\ |
| 540 | template <typename p0##_type, typename p1##_type, typename p2##_type, \ |
| 541 | typename p3##_type>\ |
| 542 | inline name##MatcherP4<p0##_type, p1##_type, p2##_type, \ |
| 543 | p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \ |
| 544 | p3##_type p3) {\ |
| 545 | return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \ |
| 546 | p1, p2, p3);\ |
| 547 | }\ |
| 548 | template <typename p0##_type, typename p1##_type, typename p2##_type, \ |
| 549 | typename p3##_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_)\ |
| 555 | const |
| 556 | |
| 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 {\ |
| 561 | public:\ |
| 562 | template <typename arg_type>\ |
| 563 | class gmock_Impl : public ::testing::MatcherInterface<\ |
| 564 | GTEST_REFERENCE_TO_CONST_(arg_type)> {\ |
| 565 | public:\ |
| 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);\ |
| 576 | }\ |
| 577 | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ |
| 578 | *gmock_os << FormatDescription(true);\ |
| 579 | }\ |
| 580 | p0##_type const p0;\ |
| 581 | p1##_type const p1;\ |
| 582 | p2##_type const p2;\ |
| 583 | p3##_type const p3;\ |
| 584 | p4##_type const p4;\ |
| 585 | private:\ |
| 586 | ::std::string FormatDescription(bool negation) const {\ |
| 587 | ::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(\ |
| 594 | ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ |
| 595 | p4##_type>(p0, p1, p2, p3, p4)));\ |
| 596 | }\ |
| 597 | };\ |
| 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));\ |
| 602 | }\ |
| 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)) {\ |
| 608 | }\ |
| 609 | p0##_type const p0;\ |
| 610 | p1##_type const p1;\ |
| 611 | p2##_type const p2;\ |
| 612 | p3##_type const p3;\ |
| 613 | p4##_type const p4;\ |
| 614 | private:\ |
| 615 | };\ |
| 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, \ |
| 620 | p4##_type p4) {\ |
| 621 | return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \ |
| 622 | p4##_type>(p0, p1, p2, p3, p4);\ |
| 623 | }\ |
| 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_)\ |
| 631 | const |
| 632 | |
| 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 {\ |
| 637 | public:\ |
| 638 | template <typename arg_type>\ |
| 639 | class gmock_Impl : public ::testing::MatcherInterface<\ |
| 640 | GTEST_REFERENCE_TO_CONST_(arg_type)> {\ |
| 641 | public:\ |
| 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);\ |
| 652 | }\ |
| 653 | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ |
| 654 | *gmock_os << FormatDescription(true);\ |
| 655 | }\ |
| 656 | p0##_type const p0;\ |
| 657 | p1##_type const p1;\ |
| 658 | p2##_type const p2;\ |
| 659 | p3##_type const p3;\ |
| 660 | p4##_type const p4;\ |
| 661 | p5##_type const p5;\ |
| 662 | private:\ |
| 663 | ::std::string FormatDescription(bool negation) const {\ |
| 664 | ::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(\ |
| 671 | ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ |
| 672 | p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\ |
| 673 | }\ |
| 674 | };\ |
| 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));\ |
| 679 | }\ |
| 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)) {\ |
| 686 | }\ |
| 687 | p0##_type const p0;\ |
| 688 | p1##_type const p1;\ |
| 689 | p2##_type const p2;\ |
| 690 | p3##_type const p3;\ |
| 691 | p4##_type const p4;\ |
| 692 | p5##_type const p5;\ |
| 693 | private:\ |
| 694 | };\ |
| 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);\ |
| 702 | }\ |
| 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_)\ |
| 710 | const |
| 711 | |
| 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, \ |
| 715 | typename p6##_type>\ |
| 716 | class name##MatcherP7 {\ |
| 717 | public:\ |
| 718 | template <typename arg_type>\ |
| 719 | class gmock_Impl : public ::testing::MatcherInterface<\ |
| 720 | GTEST_REFERENCE_TO_CONST_(arg_type)> {\ |
| 721 | public:\ |
| 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, \ |
| 724 | p6##_type gmock_p6)\ |
| 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);\ |
| 734 | }\ |
| 735 | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ |
| 736 | *gmock_os << FormatDescription(true);\ |
| 737 | }\ |
| 738 | p0##_type const p0;\ |
| 739 | p1##_type const p1;\ |
| 740 | p2##_type const p2;\ |
| 741 | p3##_type const p3;\ |
| 742 | p4##_type const p4;\ |
| 743 | p5##_type const p5;\ |
| 744 | p6##_type const p6;\ |
| 745 | private:\ |
| 746 | ::std::string FormatDescription(bool negation) const {\ |
| 747 | ::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(\ |
| 754 | ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ |
| 755 | p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \ |
| 756 | p6)));\ |
| 757 | }\ |
| 758 | };\ |
| 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));\ |
| 763 | }\ |
| 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)) {\ |
| 770 | }\ |
| 771 | p0##_type const p0;\ |
| 772 | p1##_type const p1;\ |
| 773 | p2##_type const p2;\ |
| 774 | p3##_type const p3;\ |
| 775 | p4##_type const p4;\ |
| 776 | p5##_type const p5;\ |
| 777 | p6##_type const p6;\ |
| 778 | private:\ |
| 779 | };\ |
| 780 | template <typename p0##_type, typename p1##_type, typename p2##_type, \ |
| 781 | typename p3##_type, typename p4##_type, typename p5##_type, \ |
| 782 | typename p6##_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, \ |
| 786 | p6##_type p6) {\ |
| 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);\ |
| 789 | }\ |
| 790 | template <typename p0##_type, typename p1##_type, typename p2##_type, \ |
| 791 | typename p3##_type, typename p4##_type, typename p5##_type, \ |
| 792 | typename p6##_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_)\ |
| 798 | const |
| 799 | |
| 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 {\ |
| 805 | public:\ |
| 806 | template <typename arg_type>\ |
| 807 | class gmock_Impl : public ::testing::MatcherInterface<\ |
| 808 | GTEST_REFERENCE_TO_CONST_(arg_type)> {\ |
| 809 | public:\ |
| 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);\ |
| 822 | }\ |
| 823 | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ |
| 824 | *gmock_os << FormatDescription(true);\ |
| 825 | }\ |
| 826 | p0##_type const p0;\ |
| 827 | p1##_type const p1;\ |
| 828 | p2##_type const p2;\ |
| 829 | p3##_type const p3;\ |
| 830 | p4##_type const p4;\ |
| 831 | p5##_type const p5;\ |
| 832 | p6##_type const p6;\ |
| 833 | p7##_type const p7;\ |
| 834 | private:\ |
| 835 | ::std::string FormatDescription(bool negation) const {\ |
| 836 | ::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(\ |
| 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)));\ |
| 846 | }\ |
| 847 | };\ |
| 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));\ |
| 852 | }\ |
| 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)) {\ |
| 861 | }\ |
| 862 | p0##_type const p0;\ |
| 863 | p1##_type const p1;\ |
| 864 | p2##_type const p2;\ |
| 865 | p3##_type const p3;\ |
| 866 | p4##_type const p4;\ |
| 867 | p5##_type const p5;\ |
| 868 | p6##_type const p6;\ |
| 869 | p7##_type const p7;\ |
| 870 | private:\ |
| 871 | };\ |
| 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, \ |
| 881 | p6, p7);\ |
| 882 | }\ |
| 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_)\ |
| 892 | const |
| 893 | |
| 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 {\ |
| 899 | public:\ |
| 900 | template <typename arg_type>\ |
| 901 | class gmock_Impl : public ::testing::MatcherInterface<\ |
| 902 | GTEST_REFERENCE_TO_CONST_(arg_type)> {\ |
| 903 | public:\ |
| 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);\ |
| 917 | }\ |
| 918 | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ |
| 919 | *gmock_os << FormatDescription(true);\ |
| 920 | }\ |
| 921 | p0##_type const p0;\ |
| 922 | p1##_type const p1;\ |
| 923 | p2##_type const p2;\ |
| 924 | p3##_type const p3;\ |
| 925 | p4##_type const p4;\ |
| 926 | p5##_type const p5;\ |
| 927 | p6##_type const p6;\ |
| 928 | p7##_type const p7;\ |
| 929 | p8##_type const p8;\ |
| 930 | private:\ |
| 931 | ::std::string FormatDescription(bool negation) const {\ |
| 932 | ::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(\ |
| 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)));\ |
| 942 | }\ |
| 943 | };\ |
| 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));\ |
| 948 | }\ |
| 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)) {\ |
| 957 | }\ |
| 958 | p0##_type const p0;\ |
| 959 | p1##_type const p1;\ |
| 960 | p2##_type const p2;\ |
| 961 | p3##_type const p3;\ |
| 962 | p4##_type const p4;\ |
| 963 | p5##_type const p5;\ |
| 964 | p6##_type const p6;\ |
| 965 | p7##_type const p7;\ |
| 966 | p8##_type const p8;\ |
| 967 | private:\ |
| 968 | };\ |
| 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, \ |
| 976 | p8##_type p8) {\ |
| 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);\ |
| 980 | }\ |
| 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_)\ |
| 990 | const |
| 991 | |
| 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, \ |
| 996 | typename p9##_type>\ |
| 997 | class name##MatcherP10 {\ |
| 998 | public:\ |
| 999 | template <typename arg_type>\ |
| 1000 | class gmock_Impl : public ::testing::MatcherInterface<\ |
| 1001 | GTEST_REFERENCE_TO_CONST_(arg_type)> {\ |
| 1002 | public:\ |
| 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);\ |
| 1017 | }\ |
| 1018 | virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\ |
| 1019 | *gmock_os << FormatDescription(true);\ |
| 1020 | }\ |
| 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;\ |
| 1031 | private:\ |
| 1032 | ::std::string FormatDescription(bool negation) const {\ |
| 1033 | ::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(\ |
| 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)));\ |
| 1043 | }\ |
| 1044 | };\ |
| 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));\ |
| 1049 | }\ |
| 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)) {\ |
| 1059 | }\ |
| 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;\ |
| 1070 | private:\ |
| 1071 | };\ |
| 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, \ |
| 1080 | p9##_type p9) {\ |
| 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);\ |
| 1084 | }\ |
| 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_)\ |
| 1095 | const |
| 1096 | |
| 1097 | #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_ |
| 1098 | |