gmock-generated-matchers.h 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097
  1. // This file was GENERATED by command:
  2. // pump.py gmock-generated-matchers.h.pump
  3. // DO NOT EDIT BY HAND!!!
  4. // Copyright 2008, Google Inc.
  5. // All rights reserved.
  6. //
  7. // Redistribution and use in source and binary forms, with or without
  8. // modification, are permitted provided that the following conditions are
  9. // met:
  10. //
  11. // * Redistributions of source code must retain the above copyright
  12. // notice, this list of conditions and the following disclaimer.
  13. // * Redistributions in binary form must reproduce the above
  14. // copyright notice, this list of conditions and the following disclaimer
  15. // in the documentation and/or other materials provided with the
  16. // distribution.
  17. // * Neither the name of Google Inc. nor the names of its
  18. // contributors may be used to endorse or promote products derived from
  19. // this software without specific prior written permission.
  20. //
  21. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. // Google Mock - a framework for writing C++ mock classes.
  33. //
  34. // This file implements some commonly used variadic matchers.
  35. // GOOGLETEST_CM0002 DO NOT DELETE
  36. #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
  37. #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
  38. #include <iterator>
  39. #include <sstream>
  40. #include <string>
  41. #include <utility>
  42. #include <vector>
  43. #include "gmock/gmock-matchers.h"
  44. // The MATCHER* family of macros can be used in a namespace scope to
  45. // define custom matchers easily.
  46. //
  47. // Basic Usage
  48. // ===========
  49. //
  50. // The syntax
  51. //
  52. // MATCHER(name, description_string) { statements; }
  53. //
  54. // defines a matcher with the given name that executes the statements,
  55. // which must return a bool to indicate if the match succeeds. Inside
  56. // the statements, you can refer to the value being matched by 'arg',
  57. // and refer to its type by 'arg_type'.
  58. //
  59. // The description string documents what the matcher does, and is used
  60. // to generate the failure message when the match fails. Since a
  61. // MATCHER() is usually defined in a header file shared by multiple
  62. // C++ source files, we require the description to be a C-string
  63. // literal to avoid possible side effects. It can be empty, in which
  64. // case we'll use the sequence of words in the matcher name as the
  65. // description.
  66. //
  67. // For example:
  68. //
  69. // MATCHER(IsEven, "") { return (arg % 2) == 0; }
  70. //
  71. // allows you to write
  72. //
  73. // // Expects mock_foo.Bar(n) to be called where n is even.
  74. // EXPECT_CALL(mock_foo, Bar(IsEven()));
  75. //
  76. // or,
  77. //
  78. // // Verifies that the value of some_expression is even.
  79. // EXPECT_THAT(some_expression, IsEven());
  80. //
  81. // If the above assertion fails, it will print something like:
  82. //
  83. // Value of: some_expression
  84. // Expected: is even
  85. // Actual: 7
  86. //
  87. // where the description "is even" is automatically calculated from the
  88. // matcher name IsEven.
  89. //
  90. // Argument Type
  91. // =============
  92. //
  93. // Note that the type of the value being matched (arg_type) is
  94. // determined by the context in which you use the matcher and is
  95. // supplied to you by the compiler, so you don't need to worry about
  96. // declaring it (nor can you). This allows the matcher to be
  97. // polymorphic. For example, IsEven() can be used to match any type
  98. // where the value of "(arg % 2) == 0" can be implicitly converted to
  99. // a bool. In the "Bar(IsEven())" example above, if method Bar()
  100. // takes an int, 'arg_type' will be int; if it takes an unsigned long,
  101. // 'arg_type' will be unsigned long; and so on.
  102. //
  103. // Parameterizing Matchers
  104. // =======================
  105. //
  106. // Sometimes you'll want to parameterize the matcher. For that you
  107. // can use another macro:
  108. //
  109. // MATCHER_P(name, param_name, description_string) { statements; }
  110. //
  111. // For example:
  112. //
  113. // MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
  114. //
  115. // will allow you to write:
  116. //
  117. // EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
  118. //
  119. // which may lead to this message (assuming n is 10):
  120. //
  121. // Value of: Blah("a")
  122. // Expected: has absolute value 10
  123. // Actual: -9
  124. //
  125. // Note that both the matcher description and its parameter are
  126. // printed, making the message human-friendly.
  127. //
  128. // In the matcher definition body, you can write 'foo_type' to
  129. // reference the type of a parameter named 'foo'. For example, in the
  130. // body of MATCHER_P(HasAbsoluteValue, value) above, you can write
  131. // 'value_type' to refer to the type of 'value'.
  132. //
  133. // We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to
  134. // support multi-parameter matchers.
  135. //
  136. // Describing Parameterized Matchers
  137. // =================================
  138. //
  139. // The last argument to MATCHER*() is a string-typed expression. The
  140. // expression can reference all of the matcher's parameters and a
  141. // special bool-typed variable named 'negation'. When 'negation' is
  142. // false, the expression should evaluate to the matcher's description;
  143. // otherwise it should evaluate to the description of the negation of
  144. // the matcher. For example,
  145. //
  146. // using testing::PrintToString;
  147. //
  148. // MATCHER_P2(InClosedRange, low, hi,
  149. // std::string(negation ? "is not" : "is") + " in range [" +
  150. // PrintToString(low) + ", " + PrintToString(hi) + "]") {
  151. // return low <= arg && arg <= hi;
  152. // }
  153. // ...
  154. // EXPECT_THAT(3, InClosedRange(4, 6));
  155. // EXPECT_THAT(3, Not(InClosedRange(2, 4)));
  156. //
  157. // would generate two failures that contain the text:
  158. //
  159. // Expected: is in range [4, 6]
  160. // ...
  161. // Expected: is not in range [2, 4]
  162. //
  163. // If you specify "" as the description, the failure message will
  164. // contain the sequence of words in the matcher name followed by the
  165. // parameter values printed as a tuple. For example,
  166. //
  167. // MATCHER_P2(InClosedRange, low, hi, "") { ... }
  168. // ...
  169. // EXPECT_THAT(3, InClosedRange(4, 6));
  170. // EXPECT_THAT(3, Not(InClosedRange(2, 4)));
  171. //
  172. // would generate two failures that contain the text:
  173. //
  174. // Expected: in closed range (4, 6)
  175. // ...
  176. // Expected: not (in closed range (2, 4))
  177. //
  178. // Types of Matcher Parameters
  179. // ===========================
  180. //
  181. // For the purpose of typing, you can view
  182. //
  183. // MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
  184. //
  185. // as shorthand for
  186. //
  187. // template <typename p1_type, ..., typename pk_type>
  188. // FooMatcherPk<p1_type, ..., pk_type>
  189. // Foo(p1_type p1, ..., pk_type pk) { ... }
  190. //
  191. // When you write Foo(v1, ..., vk), the compiler infers the types of
  192. // the parameters v1, ..., and vk for you. If you are not happy with
  193. // the result of the type inference, you can specify the types by
  194. // explicitly instantiating the template, as in Foo<long, bool>(5,
  195. // false). As said earlier, you don't get to (or need to) specify
  196. // 'arg_type' as that's determined by the context in which the matcher
  197. // is used. You can assign the result of expression Foo(p1, ..., pk)
  198. // to a variable of type FooMatcherPk<p1_type, ..., pk_type>. This
  199. // can be useful when composing matchers.
  200. //
  201. // While you can instantiate a matcher template with reference types,
  202. // passing the parameters by pointer usually makes your code more
  203. // readable. If, however, you still want to pass a parameter by
  204. // reference, be aware that in the failure message generated by the
  205. // matcher you will see the value of the referenced object but not its
  206. // address.
  207. //
  208. // Explaining Match Results
  209. // ========================
  210. //
  211. // Sometimes the matcher description alone isn't enough to explain why
  212. // the match has failed or succeeded. For example, when expecting a
  213. // long string, it can be very helpful to also print the diff between
  214. // the expected string and the actual one. To achieve that, you can
  215. // optionally stream additional information to a special variable
  216. // named result_listener, whose type is a pointer to class
  217. // MatchResultListener:
  218. //
  219. // MATCHER_P(EqualsLongString, str, "") {
  220. // if (arg == str) return true;
  221. //
  222. // *result_listener << "the difference: "
  223. /// << DiffStrings(str, arg);
  224. // return false;
  225. // }
  226. //
  227. // Overloading Matchers
  228. // ====================
  229. //
  230. // You can overload matchers with different numbers of parameters:
  231. //
  232. // MATCHER_P(Blah, a, description_string1) { ... }
  233. // MATCHER_P2(Blah, a, b, description_string2) { ... }
  234. //
  235. // Caveats
  236. // =======
  237. //
  238. // When defining a new matcher, you should also consider implementing
  239. // MatcherInterface or using MakePolymorphicMatcher(). These
  240. // approaches require more work than the MATCHER* macros, but also
  241. // give you more control on the types of the value being matched and
  242. // the matcher parameters, which may leads to better compiler error
  243. // messages when the matcher is used wrong. They also allow
  244. // overloading matchers based on parameter types (as opposed to just
  245. // based on the number of parameters).
  246. //
  247. // MATCHER*() can only be used in a namespace scope as templates cannot be
  248. // declared inside of a local class.
  249. //
  250. // More Information
  251. // ================
  252. //
  253. // To learn more about using these macros, please search for 'MATCHER'
  254. // on
  255. // https://github.com/google/googletest/blob/master/googlemock/docs/cook_book.md
  256. #define MATCHER(name, description)\
  257. class name##Matcher {\
  258. public:\
  259. template <typename arg_type>\
  260. class gmock_Impl : public ::testing::MatcherInterface<\
  261. GTEST_REFERENCE_TO_CONST_(arg_type)> {\
  262. public:\
  263. gmock_Impl()\
  264. {}\
  265. virtual bool MatchAndExplain(\
  266. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  267. ::testing::MatchResultListener* result_listener) const;\
  268. virtual void DescribeTo(::std::ostream* gmock_os) const {\
  269. *gmock_os << FormatDescription(false);\
  270. }\
  271. virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
  272. *gmock_os << FormatDescription(true);\
  273. }\
  274. private:\
  275. ::std::string FormatDescription(bool negation) const {\
  276. ::std::string gmock_description = (description);\
  277. if (!gmock_description.empty()) {\
  278. return gmock_description;\
  279. }\
  280. return ::testing::internal::FormatMatcherDescription(\
  281. negation, #name, \
  282. ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
  283. ::std::tuple<>()));\
  284. }\
  285. };\
  286. template <typename arg_type>\
  287. operator ::testing::Matcher<arg_type>() const {\
  288. return ::testing::Matcher<arg_type>(\
  289. new gmock_Impl<arg_type>());\
  290. }\
  291. name##Matcher() {\
  292. }\
  293. private:\
  294. };\
  295. inline name##Matcher name() {\
  296. return name##Matcher();\
  297. }\
  298. template <typename arg_type>\
  299. bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\
  300. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  301. ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
  302. const
  303. #define MATCHER_P(name, p0, description)\
  304. template <typename p0##_type>\
  305. class name##MatcherP {\
  306. public:\
  307. template <typename arg_type>\
  308. class gmock_Impl : public ::testing::MatcherInterface<\
  309. GTEST_REFERENCE_TO_CONST_(arg_type)> {\
  310. public:\
  311. explicit gmock_Impl(p0##_type gmock_p0)\
  312. : p0(::std::move(gmock_p0)) {}\
  313. virtual bool MatchAndExplain(\
  314. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  315. ::testing::MatchResultListener* result_listener) const;\
  316. virtual void DescribeTo(::std::ostream* gmock_os) const {\
  317. *gmock_os << FormatDescription(false);\
  318. }\
  319. virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
  320. *gmock_os << FormatDescription(true);\
  321. }\
  322. p0##_type const p0;\
  323. private:\
  324. ::std::string FormatDescription(bool negation) const {\
  325. ::std::string gmock_description = (description);\
  326. if (!gmock_description.empty()) {\
  327. return gmock_description;\
  328. }\
  329. return ::testing::internal::FormatMatcherDescription(\
  330. negation, #name, \
  331. ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
  332. ::std::tuple<p0##_type>(p0)));\
  333. }\
  334. };\
  335. template <typename arg_type>\
  336. operator ::testing::Matcher<arg_type>() const {\
  337. return ::testing::Matcher<arg_type>(\
  338. new gmock_Impl<arg_type>(p0));\
  339. }\
  340. explicit name##MatcherP(p0##_type gmock_p0) : p0(::std::move(gmock_p0)) {\
  341. }\
  342. p0##_type const p0;\
  343. private:\
  344. };\
  345. template <typename p0##_type>\
  346. inline name##MatcherP<p0##_type> name(p0##_type p0) {\
  347. return name##MatcherP<p0##_type>(p0);\
  348. }\
  349. template <typename p0##_type>\
  350. template <typename arg_type>\
  351. bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
  352. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  353. ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
  354. const
  355. #define MATCHER_P2(name, p0, p1, description)\
  356. template <typename p0##_type, typename p1##_type>\
  357. class name##MatcherP2 {\
  358. public:\
  359. template <typename arg_type>\
  360. class gmock_Impl : public ::testing::MatcherInterface<\
  361. GTEST_REFERENCE_TO_CONST_(arg_type)> {\
  362. public:\
  363. gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\
  364. : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)) {}\
  365. virtual bool MatchAndExplain(\
  366. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  367. ::testing::MatchResultListener* result_listener) const;\
  368. virtual void DescribeTo(::std::ostream* gmock_os) const {\
  369. *gmock_os << FormatDescription(false);\
  370. }\
  371. virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
  372. *gmock_os << FormatDescription(true);\
  373. }\
  374. p0##_type const p0;\
  375. p1##_type const p1;\
  376. private:\
  377. ::std::string FormatDescription(bool negation) const {\
  378. ::std::string gmock_description = (description);\
  379. if (!gmock_description.empty()) {\
  380. return gmock_description;\
  381. }\
  382. return ::testing::internal::FormatMatcherDescription(\
  383. negation, #name, \
  384. ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
  385. ::std::tuple<p0##_type, p1##_type>(p0, p1)));\
  386. }\
  387. };\
  388. template <typename arg_type>\
  389. operator ::testing::Matcher<arg_type>() const {\
  390. return ::testing::Matcher<arg_type>(\
  391. new gmock_Impl<arg_type>(p0, p1));\
  392. }\
  393. name##MatcherP2(p0##_type gmock_p0, \
  394. p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \
  395. p1(::std::move(gmock_p1)) {\
  396. }\
  397. p0##_type const p0;\
  398. p1##_type const p1;\
  399. private:\
  400. };\
  401. template <typename p0##_type, typename p1##_type>\
  402. inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \
  403. p1##_type p1) {\
  404. return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\
  405. }\
  406. template <typename p0##_type, typename p1##_type>\
  407. template <typename arg_type>\
  408. bool name##MatcherP2<p0##_type, \
  409. p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
  410. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  411. ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
  412. const
  413. #define MATCHER_P3(name, p0, p1, p2, description)\
  414. template <typename p0##_type, typename p1##_type, typename p2##_type>\
  415. class name##MatcherP3 {\
  416. public:\
  417. template <typename arg_type>\
  418. class gmock_Impl : public ::testing::MatcherInterface<\
  419. GTEST_REFERENCE_TO_CONST_(arg_type)> {\
  420. public:\
  421. gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\
  422. : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
  423. p2(::std::move(gmock_p2)) {}\
  424. virtual bool MatchAndExplain(\
  425. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  426. ::testing::MatchResultListener* result_listener) const;\
  427. virtual void DescribeTo(::std::ostream* gmock_os) const {\
  428. *gmock_os << FormatDescription(false);\
  429. }\
  430. virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
  431. *gmock_os << FormatDescription(true);\
  432. }\
  433. p0##_type const p0;\
  434. p1##_type const p1;\
  435. p2##_type const p2;\
  436. private:\
  437. ::std::string FormatDescription(bool negation) const {\
  438. ::std::string gmock_description = (description);\
  439. if (!gmock_description.empty()) {\
  440. return gmock_description;\
  441. }\
  442. return ::testing::internal::FormatMatcherDescription(\
  443. negation, #name, \
  444. ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
  445. ::std::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, p2)));\
  446. }\
  447. };\
  448. template <typename arg_type>\
  449. operator ::testing::Matcher<arg_type>() const {\
  450. return ::testing::Matcher<arg_type>(\
  451. new gmock_Impl<arg_type>(p0, p1, p2));\
  452. }\
  453. name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \
  454. p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \
  455. p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)) {\
  456. }\
  457. p0##_type const p0;\
  458. p1##_type const p1;\
  459. p2##_type const p2;\
  460. private:\
  461. };\
  462. template <typename p0##_type, typename p1##_type, typename p2##_type>\
  463. inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
  464. p1##_type p1, p2##_type p2) {\
  465. return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
  466. }\
  467. template <typename p0##_type, typename p1##_type, typename p2##_type>\
  468. template <typename arg_type>\
  469. bool name##MatcherP3<p0##_type, p1##_type, \
  470. p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
  471. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  472. ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
  473. const
  474. #define MATCHER_P4(name, p0, p1, p2, p3, description)\
  475. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  476. typename p3##_type>\
  477. class name##MatcherP4 {\
  478. public:\
  479. template <typename arg_type>\
  480. class gmock_Impl : public ::testing::MatcherInterface<\
  481. GTEST_REFERENCE_TO_CONST_(arg_type)> {\
  482. public:\
  483. gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
  484. p3##_type gmock_p3)\
  485. : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
  486. p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)) {}\
  487. virtual bool MatchAndExplain(\
  488. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  489. ::testing::MatchResultListener* result_listener) const;\
  490. virtual void DescribeTo(::std::ostream* gmock_os) const {\
  491. *gmock_os << FormatDescription(false);\
  492. }\
  493. virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
  494. *gmock_os << FormatDescription(true);\
  495. }\
  496. p0##_type const p0;\
  497. p1##_type const p1;\
  498. p2##_type const p2;\
  499. p3##_type const p3;\
  500. private:\
  501. ::std::string FormatDescription(bool negation) const {\
  502. ::std::string gmock_description = (description);\
  503. if (!gmock_description.empty()) {\
  504. return gmock_description;\
  505. }\
  506. return ::testing::internal::FormatMatcherDescription(\
  507. negation, #name, \
  508. ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
  509. ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
  510. p1, p2, p3)));\
  511. }\
  512. };\
  513. template <typename arg_type>\
  514. operator ::testing::Matcher<arg_type>() const {\
  515. return ::testing::Matcher<arg_type>(\
  516. new gmock_Impl<arg_type>(p0, p1, p2, p3));\
  517. }\
  518. name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \
  519. p2##_type gmock_p2, p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \
  520. p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
  521. p3(::std::move(gmock_p3)) {\
  522. }\
  523. p0##_type const p0;\
  524. p1##_type const p1;\
  525. p2##_type const p2;\
  526. p3##_type const p3;\
  527. private:\
  528. };\
  529. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  530. typename p3##_type>\
  531. inline name##MatcherP4<p0##_type, p1##_type, p2##_type, \
  532. p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
  533. p3##_type p3) {\
  534. return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
  535. p1, p2, p3);\
  536. }\
  537. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  538. typename p3##_type>\
  539. template <typename arg_type>\
  540. bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \
  541. p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
  542. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  543. ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
  544. const
  545. #define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\
  546. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  547. typename p3##_type, typename p4##_type>\
  548. class name##MatcherP5 {\
  549. public:\
  550. template <typename arg_type>\
  551. class gmock_Impl : public ::testing::MatcherInterface<\
  552. GTEST_REFERENCE_TO_CONST_(arg_type)> {\
  553. public:\
  554. gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
  555. p3##_type gmock_p3, p4##_type gmock_p4)\
  556. : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
  557. p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
  558. p4(::std::move(gmock_p4)) {}\
  559. virtual bool MatchAndExplain(\
  560. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  561. ::testing::MatchResultListener* result_listener) const;\
  562. virtual void DescribeTo(::std::ostream* gmock_os) const {\
  563. *gmock_os << FormatDescription(false);\
  564. }\
  565. virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
  566. *gmock_os << FormatDescription(true);\
  567. }\
  568. p0##_type const p0;\
  569. p1##_type const p1;\
  570. p2##_type const p2;\
  571. p3##_type const p3;\
  572. p4##_type const p4;\
  573. private:\
  574. ::std::string FormatDescription(bool negation) const {\
  575. ::std::string gmock_description = (description);\
  576. if (!gmock_description.empty()) {\
  577. return gmock_description;\
  578. }\
  579. return ::testing::internal::FormatMatcherDescription(\
  580. negation, #name, \
  581. ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
  582. ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
  583. p4##_type>(p0, p1, p2, p3, p4)));\
  584. }\
  585. };\
  586. template <typename arg_type>\
  587. operator ::testing::Matcher<arg_type>() const {\
  588. return ::testing::Matcher<arg_type>(\
  589. new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\
  590. }\
  591. name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \
  592. p2##_type gmock_p2, p3##_type gmock_p3, \
  593. p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \
  594. p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
  595. p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)) {\
  596. }\
  597. p0##_type const p0;\
  598. p1##_type const p1;\
  599. p2##_type const p2;\
  600. p3##_type const p3;\
  601. p4##_type const p4;\
  602. private:\
  603. };\
  604. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  605. typename p3##_type, typename p4##_type>\
  606. inline name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
  607. p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
  608. p4##_type p4) {\
  609. return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
  610. p4##_type>(p0, p1, p2, p3, p4);\
  611. }\
  612. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  613. typename p3##_type, typename p4##_type>\
  614. template <typename arg_type>\
  615. bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
  616. p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
  617. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  618. ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
  619. const
  620. #define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\
  621. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  622. typename p3##_type, typename p4##_type, typename p5##_type>\
  623. class name##MatcherP6 {\
  624. public:\
  625. template <typename arg_type>\
  626. class gmock_Impl : public ::testing::MatcherInterface<\
  627. GTEST_REFERENCE_TO_CONST_(arg_type)> {\
  628. public:\
  629. gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
  630. p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\
  631. : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
  632. p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
  633. p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)) {}\
  634. virtual bool MatchAndExplain(\
  635. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  636. ::testing::MatchResultListener* result_listener) const;\
  637. virtual void DescribeTo(::std::ostream* gmock_os) const {\
  638. *gmock_os << FormatDescription(false);\
  639. }\
  640. virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
  641. *gmock_os << FormatDescription(true);\
  642. }\
  643. p0##_type const p0;\
  644. p1##_type const p1;\
  645. p2##_type const p2;\
  646. p3##_type const p3;\
  647. p4##_type const p4;\
  648. p5##_type const p5;\
  649. private:\
  650. ::std::string FormatDescription(bool negation) const {\
  651. ::std::string gmock_description = (description);\
  652. if (!gmock_description.empty()) {\
  653. return gmock_description;\
  654. }\
  655. return ::testing::internal::FormatMatcherDescription(\
  656. negation, #name, \
  657. ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
  658. ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
  659. p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
  660. }\
  661. };\
  662. template <typename arg_type>\
  663. operator ::testing::Matcher<arg_type>() const {\
  664. return ::testing::Matcher<arg_type>(\
  665. new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\
  666. }\
  667. name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \
  668. p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
  669. p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \
  670. p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
  671. p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
  672. p5(::std::move(gmock_p5)) {\
  673. }\
  674. p0##_type const p0;\
  675. p1##_type const p1;\
  676. p2##_type const p2;\
  677. p3##_type const p3;\
  678. p4##_type const p4;\
  679. p5##_type const p5;\
  680. private:\
  681. };\
  682. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  683. typename p3##_type, typename p4##_type, typename p5##_type>\
  684. inline name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
  685. p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
  686. p3##_type p3, p4##_type p4, p5##_type p5) {\
  687. return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
  688. p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
  689. }\
  690. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  691. typename p3##_type, typename p4##_type, typename p5##_type>\
  692. template <typename arg_type>\
  693. bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
  694. p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
  695. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  696. ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
  697. const
  698. #define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\
  699. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  700. typename p3##_type, typename p4##_type, typename p5##_type, \
  701. typename p6##_type>\
  702. class name##MatcherP7 {\
  703. public:\
  704. template <typename arg_type>\
  705. class gmock_Impl : public ::testing::MatcherInterface<\
  706. GTEST_REFERENCE_TO_CONST_(arg_type)> {\
  707. public:\
  708. gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
  709. p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
  710. p6##_type gmock_p6)\
  711. : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
  712. p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
  713. p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
  714. p6(::std::move(gmock_p6)) {}\
  715. virtual bool MatchAndExplain(\
  716. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  717. ::testing::MatchResultListener* result_listener) const;\
  718. virtual void DescribeTo(::std::ostream* gmock_os) const {\
  719. *gmock_os << FormatDescription(false);\
  720. }\
  721. virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
  722. *gmock_os << FormatDescription(true);\
  723. }\
  724. p0##_type const p0;\
  725. p1##_type const p1;\
  726. p2##_type const p2;\
  727. p3##_type const p3;\
  728. p4##_type const p4;\
  729. p5##_type const p5;\
  730. p6##_type const p6;\
  731. private:\
  732. ::std::string FormatDescription(bool negation) const {\
  733. ::std::string gmock_description = (description);\
  734. if (!gmock_description.empty()) {\
  735. return gmock_description;\
  736. }\
  737. return ::testing::internal::FormatMatcherDescription(\
  738. negation, #name, \
  739. ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
  740. ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
  741. p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
  742. p6)));\
  743. }\
  744. };\
  745. template <typename arg_type>\
  746. operator ::testing::Matcher<arg_type>() const {\
  747. return ::testing::Matcher<arg_type>(\
  748. new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6));\
  749. }\
  750. name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \
  751. p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
  752. p5##_type gmock_p5, p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \
  753. p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
  754. p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
  755. p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)) {\
  756. }\
  757. p0##_type const p0;\
  758. p1##_type const p1;\
  759. p2##_type const p2;\
  760. p3##_type const p3;\
  761. p4##_type const p4;\
  762. p5##_type const p5;\
  763. p6##_type const p6;\
  764. private:\
  765. };\
  766. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  767. typename p3##_type, typename p4##_type, typename p5##_type, \
  768. typename p6##_type>\
  769. inline name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
  770. p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
  771. p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
  772. p6##_type p6) {\
  773. return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
  774. p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
  775. }\
  776. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  777. typename p3##_type, typename p4##_type, typename p5##_type, \
  778. typename p6##_type>\
  779. template <typename arg_type>\
  780. bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
  781. p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
  782. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  783. ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
  784. const
  785. #define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\
  786. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  787. typename p3##_type, typename p4##_type, typename p5##_type, \
  788. typename p6##_type, typename p7##_type>\
  789. class name##MatcherP8 {\
  790. public:\
  791. template <typename arg_type>\
  792. class gmock_Impl : public ::testing::MatcherInterface<\
  793. GTEST_REFERENCE_TO_CONST_(arg_type)> {\
  794. public:\
  795. gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
  796. p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
  797. p6##_type gmock_p6, p7##_type gmock_p7)\
  798. : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
  799. p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
  800. p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
  801. p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)) {}\
  802. virtual bool MatchAndExplain(\
  803. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  804. ::testing::MatchResultListener* result_listener) const;\
  805. virtual void DescribeTo(::std::ostream* gmock_os) const {\
  806. *gmock_os << FormatDescription(false);\
  807. }\
  808. virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
  809. *gmock_os << FormatDescription(true);\
  810. }\
  811. p0##_type const p0;\
  812. p1##_type const p1;\
  813. p2##_type const p2;\
  814. p3##_type const p3;\
  815. p4##_type const p4;\
  816. p5##_type const p5;\
  817. p6##_type const p6;\
  818. p7##_type const p7;\
  819. private:\
  820. ::std::string FormatDescription(bool negation) const {\
  821. ::std::string gmock_description = (description);\
  822. if (!gmock_description.empty()) {\
  823. return gmock_description;\
  824. }\
  825. return ::testing::internal::FormatMatcherDescription(\
  826. negation, #name, \
  827. ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
  828. ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
  829. p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
  830. p3, p4, p5, p6, p7)));\
  831. }\
  832. };\
  833. template <typename arg_type>\
  834. operator ::testing::Matcher<arg_type>() const {\
  835. return ::testing::Matcher<arg_type>(\
  836. new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7));\
  837. }\
  838. name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \
  839. p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
  840. p5##_type gmock_p5, p6##_type gmock_p6, \
  841. p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \
  842. p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
  843. p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
  844. p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
  845. p7(::std::move(gmock_p7)) {\
  846. }\
  847. p0##_type const p0;\
  848. p1##_type const p1;\
  849. p2##_type const p2;\
  850. p3##_type const p3;\
  851. p4##_type const p4;\
  852. p5##_type const p5;\
  853. p6##_type const p6;\
  854. p7##_type const p7;\
  855. private:\
  856. };\
  857. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  858. typename p3##_type, typename p4##_type, typename p5##_type, \
  859. typename p6##_type, typename p7##_type>\
  860. inline name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
  861. p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
  862. p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
  863. p6##_type p6, p7##_type p7) {\
  864. return name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
  865. p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
  866. p6, p7);\
  867. }\
  868. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  869. typename p3##_type, typename p4##_type, typename p5##_type, \
  870. typename p6##_type, typename p7##_type>\
  871. template <typename arg_type>\
  872. bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
  873. p5##_type, p6##_type, \
  874. p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
  875. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  876. ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
  877. const
  878. #define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\
  879. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  880. typename p3##_type, typename p4##_type, typename p5##_type, \
  881. typename p6##_type, typename p7##_type, typename p8##_type>\
  882. class name##MatcherP9 {\
  883. public:\
  884. template <typename arg_type>\
  885. class gmock_Impl : public ::testing::MatcherInterface<\
  886. GTEST_REFERENCE_TO_CONST_(arg_type)> {\
  887. public:\
  888. gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
  889. p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
  890. p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\
  891. : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
  892. p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
  893. p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
  894. p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \
  895. p8(::std::move(gmock_p8)) {}\
  896. virtual bool MatchAndExplain(\
  897. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  898. ::testing::MatchResultListener* result_listener) const;\
  899. virtual void DescribeTo(::std::ostream* gmock_os) const {\
  900. *gmock_os << FormatDescription(false);\
  901. }\
  902. virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
  903. *gmock_os << FormatDescription(true);\
  904. }\
  905. p0##_type const p0;\
  906. p1##_type const p1;\
  907. p2##_type const p2;\
  908. p3##_type const p3;\
  909. p4##_type const p4;\
  910. p5##_type const p5;\
  911. p6##_type const p6;\
  912. p7##_type const p7;\
  913. p8##_type const p8;\
  914. private:\
  915. ::std::string FormatDescription(bool negation) const {\
  916. ::std::string gmock_description = (description);\
  917. if (!gmock_description.empty()) {\
  918. return gmock_description;\
  919. }\
  920. return ::testing::internal::FormatMatcherDescription(\
  921. negation, #name, \
  922. ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
  923. ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
  924. p4##_type, p5##_type, p6##_type, p7##_type, \
  925. p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
  926. }\
  927. };\
  928. template <typename arg_type>\
  929. operator ::testing::Matcher<arg_type>() const {\
  930. return ::testing::Matcher<arg_type>(\
  931. new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8));\
  932. }\
  933. name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \
  934. p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
  935. p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
  936. p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \
  937. p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
  938. p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
  939. p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
  940. p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)) {\
  941. }\
  942. p0##_type const p0;\
  943. p1##_type const p1;\
  944. p2##_type const p2;\
  945. p3##_type const p3;\
  946. p4##_type const p4;\
  947. p5##_type const p5;\
  948. p6##_type const p6;\
  949. p7##_type const p7;\
  950. p8##_type const p8;\
  951. private:\
  952. };\
  953. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  954. typename p3##_type, typename p4##_type, typename p5##_type, \
  955. typename p6##_type, typename p7##_type, typename p8##_type>\
  956. inline name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
  957. p4##_type, p5##_type, p6##_type, p7##_type, \
  958. p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
  959. p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
  960. p8##_type p8) {\
  961. return name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
  962. p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
  963. p3, p4, p5, p6, p7, p8);\
  964. }\
  965. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  966. typename p3##_type, typename p4##_type, typename p5##_type, \
  967. typename p6##_type, typename p7##_type, typename p8##_type>\
  968. template <typename arg_type>\
  969. bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
  970. p5##_type, p6##_type, p7##_type, \
  971. p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
  972. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  973. ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
  974. const
  975. #define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)\
  976. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  977. typename p3##_type, typename p4##_type, typename p5##_type, \
  978. typename p6##_type, typename p7##_type, typename p8##_type, \
  979. typename p9##_type>\
  980. class name##MatcherP10 {\
  981. public:\
  982. template <typename arg_type>\
  983. class gmock_Impl : public ::testing::MatcherInterface<\
  984. GTEST_REFERENCE_TO_CONST_(arg_type)> {\
  985. public:\
  986. gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
  987. p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
  988. p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
  989. p9##_type gmock_p9)\
  990. : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \
  991. p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \
  992. p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \
  993. p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \
  994. p8(::std::move(gmock_p8)), p9(::std::move(gmock_p9)) {}\
  995. virtual bool MatchAndExplain(\
  996. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  997. ::testing::MatchResultListener* result_listener) const;\
  998. virtual void DescribeTo(::std::ostream* gmock_os) const {\
  999. *gmock_os << FormatDescription(false);\
  1000. }\
  1001. virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
  1002. *gmock_os << FormatDescription(true);\
  1003. }\
  1004. p0##_type const p0;\
  1005. p1##_type const p1;\
  1006. p2##_type const p2;\
  1007. p3##_type const p3;\
  1008. p4##_type const p4;\
  1009. p5##_type const p5;\
  1010. p6##_type const p6;\
  1011. p7##_type const p7;\
  1012. p8##_type const p8;\
  1013. p9##_type const p9;\
  1014. private:\
  1015. ::std::string FormatDescription(bool negation) const {\
  1016. ::std::string gmock_description = (description);\
  1017. if (!gmock_description.empty()) {\
  1018. return gmock_description;\
  1019. }\
  1020. return ::testing::internal::FormatMatcherDescription(\
  1021. negation, #name, \
  1022. ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
  1023. ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
  1024. p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
  1025. p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
  1026. }\
  1027. };\
  1028. template <typename arg_type>\
  1029. operator ::testing::Matcher<arg_type>() const {\
  1030. return ::testing::Matcher<arg_type>(\
  1031. new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9));\
  1032. }\
  1033. name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \
  1034. p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
  1035. p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
  1036. p8##_type gmock_p8, p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \
  1037. p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
  1038. p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
  1039. p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
  1040. p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \
  1041. p9(::std::move(gmock_p9)) {\
  1042. }\
  1043. p0##_type const p0;\
  1044. p1##_type const p1;\
  1045. p2##_type const p2;\
  1046. p3##_type const p3;\
  1047. p4##_type const p4;\
  1048. p5##_type const p5;\
  1049. p6##_type const p6;\
  1050. p7##_type const p7;\
  1051. p8##_type const p8;\
  1052. p9##_type const p9;\
  1053. private:\
  1054. };\
  1055. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  1056. typename p3##_type, typename p4##_type, typename p5##_type, \
  1057. typename p6##_type, typename p7##_type, typename p8##_type, \
  1058. typename p9##_type>\
  1059. inline name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
  1060. p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
  1061. p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
  1062. p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
  1063. p9##_type p9) {\
  1064. return name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
  1065. p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
  1066. p1, p2, p3, p4, p5, p6, p7, p8, p9);\
  1067. }\
  1068. template <typename p0##_type, typename p1##_type, typename p2##_type, \
  1069. typename p3##_type, typename p4##_type, typename p5##_type, \
  1070. typename p6##_type, typename p7##_type, typename p8##_type, \
  1071. typename p9##_type>\
  1072. template <typename arg_type>\
  1073. bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
  1074. p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
  1075. p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
  1076. GTEST_REFERENCE_TO_CONST_(arg_type) arg,\
  1077. ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
  1078. const
  1079. #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_