rj_schema 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (614) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rj_schema/rapidjson/CHANGELOG.md +158 -0
  3. data/ext/rj_schema/rapidjson/CMakeLists.txt +226 -0
  4. data/ext/rj_schema/rapidjson/CMakeModules/FindGTestSrc.cmake +30 -0
  5. data/ext/rj_schema/rapidjson/RapidJSON.pc.in +7 -0
  6. data/ext/rj_schema/rapidjson/RapidJSONConfig.cmake.in +25 -0
  7. data/ext/rj_schema/rapidjson/RapidJSONConfigVersion.cmake.in +10 -0
  8. data/ext/rj_schema/rapidjson/appveyor.yml +54 -0
  9. data/ext/rj_schema/rapidjson/bin/data/abcde.txt +1 -0
  10. data/ext/rj_schema/rapidjson/bin/data/glossary.json +22 -0
  11. data/ext/rj_schema/rapidjson/bin/data/menu.json +27 -0
  12. data/ext/rj_schema/rapidjson/bin/data/readme.txt +1 -0
  13. data/ext/rj_schema/rapidjson/bin/data/sample.json +3315 -0
  14. data/ext/rj_schema/rapidjson/bin/data/webapp.json +88 -0
  15. data/ext/rj_schema/rapidjson/bin/data/widget.json +26 -0
  16. data/ext/rj_schema/rapidjson/bin/draft-04/schema +150 -0
  17. data/ext/rj_schema/rapidjson/bin/encodings/utf16be.json +0 -0
  18. data/ext/rj_schema/rapidjson/bin/encodings/utf16bebom.json +0 -0
  19. data/ext/rj_schema/rapidjson/bin/encodings/utf16le.json +0 -0
  20. data/ext/rj_schema/rapidjson/bin/encodings/utf16lebom.json +0 -0
  21. data/ext/rj_schema/rapidjson/bin/encodings/utf32be.json +0 -0
  22. data/ext/rj_schema/rapidjson/bin/encodings/utf32bebom.json +0 -0
  23. data/ext/rj_schema/rapidjson/bin/encodings/utf32le.json +0 -0
  24. data/ext/rj_schema/rapidjson/bin/encodings/utf32lebom.json +0 -0
  25. data/ext/rj_schema/rapidjson/bin/encodings/utf8.json +7 -0
  26. data/ext/rj_schema/rapidjson/bin/encodings/utf8bom.json +7 -0
  27. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail1.json +1 -0
  28. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail10.json +1 -0
  29. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail11.json +1 -0
  30. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail12.json +1 -0
  31. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail13.json +1 -0
  32. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail14.json +1 -0
  33. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail15.json +1 -0
  34. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail16.json +1 -0
  35. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail17.json +1 -0
  36. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail18.json +1 -0
  37. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail19.json +1 -0
  38. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail2.json +1 -0
  39. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail20.json +1 -0
  40. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail21.json +1 -0
  41. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail22.json +1 -0
  42. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail23.json +1 -0
  43. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail24.json +1 -0
  44. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail25.json +1 -0
  45. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail26.json +1 -0
  46. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail27.json +2 -0
  47. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail28.json +2 -0
  48. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail29.json +1 -0
  49. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail3.json +1 -0
  50. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail30.json +1 -0
  51. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail31.json +1 -0
  52. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail32.json +1 -0
  53. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail33.json +1 -0
  54. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail4.json +1 -0
  55. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail5.json +1 -0
  56. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail6.json +1 -0
  57. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail7.json +1 -0
  58. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail8.json +1 -0
  59. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail9.json +1 -0
  60. data/ext/rj_schema/rapidjson/bin/jsonchecker/pass1.json +58 -0
  61. data/ext/rj_schema/rapidjson/bin/jsonchecker/pass2.json +1 -0
  62. data/ext/rj_schema/rapidjson/bin/jsonchecker/pass3.json +6 -0
  63. data/ext/rj_schema/rapidjson/bin/jsonchecker/readme.txt +3 -0
  64. data/ext/rj_schema/rapidjson/bin/jsonschema/LICENSE +19 -0
  65. data/ext/rj_schema/rapidjson/bin/jsonschema/README.md +148 -0
  66. data/ext/rj_schema/rapidjson/bin/jsonschema/bin/jsonschema_suite +283 -0
  67. data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json +3 -0
  68. data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/integer.json +3 -0
  69. data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/subSchemas.json +8 -0
  70. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json +82 -0
  71. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json +88 -0
  72. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/default.json +49 -0
  73. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/dependencies.json +108 -0
  74. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/disallow.json +80 -0
  75. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json +60 -0
  76. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/enum.json +71 -0
  77. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/extends.json +94 -0
  78. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/items.json +46 -0
  79. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxItems.json +28 -0
  80. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxLength.json +33 -0
  81. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maximum.json +42 -0
  82. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minItems.json +28 -0
  83. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minLength.json +33 -0
  84. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minimum.json +42 -0
  85. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json +107 -0
  86. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/format.json +222 -0
  87. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json +18 -0
  88. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json +15 -0
  89. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/pattern.json +34 -0
  90. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json +110 -0
  91. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/properties.json +92 -0
  92. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/ref.json +159 -0
  93. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/refRemote.json +74 -0
  94. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/required.json +53 -0
  95. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/type.json +474 -0
  96. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json +79 -0
  97. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json +82 -0
  98. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json +88 -0
  99. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/allOf.json +112 -0
  100. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/anyOf.json +68 -0
  101. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/default.json +49 -0
  102. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/definitions.json +32 -0
  103. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/dependencies.json +113 -0
  104. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/enum.json +72 -0
  105. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/items.json +46 -0
  106. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxItems.json +28 -0
  107. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxLength.json +33 -0
  108. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json +28 -0
  109. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maximum.json +42 -0
  110. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minItems.json +28 -0
  111. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minLength.json +33 -0
  112. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minProperties.json +28 -0
  113. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minimum.json +42 -0
  114. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json +60 -0
  115. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/not.json +96 -0
  116. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/oneOf.json +68 -0
  117. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json +107 -0
  118. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/format.json +148 -0
  119. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json +15 -0
  120. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/pattern.json +34 -0
  121. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json +110 -0
  122. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/properties.json +92 -0
  123. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/ref.json +159 -0
  124. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/refRemote.json +74 -0
  125. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/required.json +39 -0
  126. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/type.json +330 -0
  127. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json +79 -0
  128. data/ext/rj_schema/rapidjson/bin/jsonschema/tox.ini +8 -0
  129. data/ext/rj_schema/rapidjson/bin/types/booleans.json +102 -0
  130. data/ext/rj_schema/rapidjson/bin/types/floats.json +102 -0
  131. data/ext/rj_schema/rapidjson/bin/types/guids.json +102 -0
  132. data/ext/rj_schema/rapidjson/bin/types/integers.json +102 -0
  133. data/ext/rj_schema/rapidjson/bin/types/mixed.json +592 -0
  134. data/ext/rj_schema/rapidjson/bin/types/nulls.json +102 -0
  135. data/ext/rj_schema/rapidjson/bin/types/paragraphs.json +102 -0
  136. data/ext/rj_schema/rapidjson/bin/types/readme.txt +1 -0
  137. data/ext/rj_schema/rapidjson/contrib/natvis/LICENSE +45 -0
  138. data/ext/rj_schema/rapidjson/contrib/natvis/README.md +7 -0
  139. data/ext/rj_schema/rapidjson/contrib/natvis/rapidjson.natvis +38 -0
  140. data/ext/rj_schema/rapidjson/doc/CMakeLists.txt +27 -0
  141. data/ext/rj_schema/rapidjson/doc/Doxyfile.in +2369 -0
  142. data/ext/rj_schema/rapidjson/doc/Doxyfile.zh-cn.in +2369 -0
  143. data/ext/rj_schema/rapidjson/doc/diagram/architecture.dot +50 -0
  144. data/ext/rj_schema/rapidjson/doc/diagram/architecture.png +0 -0
  145. data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.dot +65 -0
  146. data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.png +0 -0
  147. data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.dot +62 -0
  148. data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.png +0 -0
  149. data/ext/rj_schema/rapidjson/doc/diagram/makefile +8 -0
  150. data/ext/rj_schema/rapidjson/doc/diagram/move1.dot +47 -0
  151. data/ext/rj_schema/rapidjson/doc/diagram/move1.png +0 -0
  152. data/ext/rj_schema/rapidjson/doc/diagram/move2.dot +62 -0
  153. data/ext/rj_schema/rapidjson/doc/diagram/move2.png +0 -0
  154. data/ext/rj_schema/rapidjson/doc/diagram/move3.dot +60 -0
  155. data/ext/rj_schema/rapidjson/doc/diagram/move3.png +0 -0
  156. data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.dot +56 -0
  157. data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.png +0 -0
  158. data/ext/rj_schema/rapidjson/doc/diagram/simpledom.dot +54 -0
  159. data/ext/rj_schema/rapidjson/doc/diagram/simpledom.png +0 -0
  160. data/ext/rj_schema/rapidjson/doc/diagram/tutorial.dot +58 -0
  161. data/ext/rj_schema/rapidjson/doc/diagram/tutorial.png +0 -0
  162. data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.dot +73 -0
  163. data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.png +0 -0
  164. data/ext/rj_schema/rapidjson/doc/dom.md +281 -0
  165. data/ext/rj_schema/rapidjson/doc/dom.zh-cn.md +285 -0
  166. data/ext/rj_schema/rapidjson/doc/encoding.md +146 -0
  167. data/ext/rj_schema/rapidjson/doc/encoding.zh-cn.md +152 -0
  168. data/ext/rj_schema/rapidjson/doc/faq.md +289 -0
  169. data/ext/rj_schema/rapidjson/doc/faq.zh-cn.md +290 -0
  170. data/ext/rj_schema/rapidjson/doc/features.md +104 -0
  171. data/ext/rj_schema/rapidjson/doc/features.zh-cn.md +103 -0
  172. data/ext/rj_schema/rapidjson/doc/internals.md +368 -0
  173. data/ext/rj_schema/rapidjson/doc/internals.zh-cn.md +363 -0
  174. data/ext/rj_schema/rapidjson/doc/logo/rapidjson.png +0 -0
  175. data/ext/rj_schema/rapidjson/doc/logo/rapidjson.svg +119 -0
  176. data/ext/rj_schema/rapidjson/doc/misc/DoxygenLayout.xml +194 -0
  177. data/ext/rj_schema/rapidjson/doc/misc/doxygenextra.css +274 -0
  178. data/ext/rj_schema/rapidjson/doc/misc/footer.html +11 -0
  179. data/ext/rj_schema/rapidjson/doc/misc/header.html +24 -0
  180. data/ext/rj_schema/rapidjson/doc/npm.md +31 -0
  181. data/ext/rj_schema/rapidjson/doc/performance.md +26 -0
  182. data/ext/rj_schema/rapidjson/doc/performance.zh-cn.md +26 -0
  183. data/ext/rj_schema/rapidjson/doc/pointer.md +234 -0
  184. data/ext/rj_schema/rapidjson/doc/pointer.zh-cn.md +234 -0
  185. data/ext/rj_schema/rapidjson/doc/sax.md +509 -0
  186. data/ext/rj_schema/rapidjson/doc/sax.zh-cn.md +487 -0
  187. data/ext/rj_schema/rapidjson/doc/schema.md +505 -0
  188. data/ext/rj_schema/rapidjson/doc/schema.zh-cn.md +237 -0
  189. data/ext/rj_schema/rapidjson/doc/stream.md +429 -0
  190. data/ext/rj_schema/rapidjson/doc/stream.zh-cn.md +429 -0
  191. data/ext/rj_schema/rapidjson/doc/tutorial.md +536 -0
  192. data/ext/rj_schema/rapidjson/doc/tutorial.zh-cn.md +535 -0
  193. data/ext/rj_schema/rapidjson/docker/debian/Dockerfile +8 -0
  194. data/ext/rj_schema/rapidjson/example/CMakeLists.txt +46 -0
  195. data/ext/rj_schema/rapidjson/example/archiver/archiver.cpp +292 -0
  196. data/ext/rj_schema/rapidjson/example/archiver/archiver.h +145 -0
  197. data/ext/rj_schema/rapidjson/example/archiver/archivertest.cpp +287 -0
  198. data/ext/rj_schema/rapidjson/example/capitalize/capitalize.cpp +67 -0
  199. data/ext/rj_schema/rapidjson/example/condense/condense.cpp +32 -0
  200. data/ext/rj_schema/rapidjson/example/filterkey/filterkey.cpp +135 -0
  201. data/ext/rj_schema/rapidjson/example/filterkeydom/filterkeydom.cpp +170 -0
  202. data/ext/rj_schema/rapidjson/example/jsonx/jsonx.cpp +207 -0
  203. data/ext/rj_schema/rapidjson/example/lookaheadparser/lookaheadparser.cpp +350 -0
  204. data/ext/rj_schema/rapidjson/example/messagereader/messagereader.cpp +105 -0
  205. data/ext/rj_schema/rapidjson/example/parsebyparts/parsebyparts.cpp +176 -0
  206. data/ext/rj_schema/rapidjson/example/pretty/pretty.cpp +30 -0
  207. data/ext/rj_schema/rapidjson/example/prettyauto/prettyauto.cpp +56 -0
  208. data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +78 -0
  209. data/ext/rj_schema/rapidjson/example/serialize/serialize.cpp +173 -0
  210. data/ext/rj_schema/rapidjson/example/simpledom/simpledom.cpp +29 -0
  211. data/ext/rj_schema/rapidjson/example/simplepullreader/simplepullreader.cpp +53 -0
  212. data/ext/rj_schema/rapidjson/example/simplereader/simplereader.cpp +42 -0
  213. data/ext/rj_schema/rapidjson/example/simplewriter/simplewriter.cpp +36 -0
  214. data/ext/rj_schema/rapidjson/example/sortkeys/sortkeys.cpp +62 -0
  215. data/ext/rj_schema/rapidjson/example/tutorial/tutorial.cpp +151 -0
  216. data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +284 -0
  217. data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +78 -0
  218. data/ext/rj_schema/rapidjson/include/rapidjson/document.h +2732 -0
  219. data/ext/rj_schema/rapidjson/include/rapidjson/encodedstream.h +299 -0
  220. data/ext/rj_schema/rapidjson/include/rapidjson/encodings.h +716 -0
  221. data/ext/rj_schema/rapidjson/include/rapidjson/error/en.h +74 -0
  222. data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +161 -0
  223. data/ext/rj_schema/rapidjson/include/rapidjson/filereadstream.h +99 -0
  224. data/ext/rj_schema/rapidjson/include/rapidjson/filewritestream.h +104 -0
  225. data/ext/rj_schema/rapidjson/include/rapidjson/fwd.h +151 -0
  226. data/ext/rj_schema/rapidjson/include/rapidjson/internal/biginteger.h +290 -0
  227. data/ext/rj_schema/rapidjson/include/rapidjson/internal/clzll.h +71 -0
  228. data/ext/rj_schema/rapidjson/include/rapidjson/internal/diyfp.h +257 -0
  229. data/ext/rj_schema/rapidjson/include/rapidjson/internal/dtoa.h +245 -0
  230. data/ext/rj_schema/rapidjson/include/rapidjson/internal/ieee754.h +78 -0
  231. data/ext/rj_schema/rapidjson/include/rapidjson/internal/itoa.h +308 -0
  232. data/ext/rj_schema/rapidjson/include/rapidjson/internal/meta.h +186 -0
  233. data/ext/rj_schema/rapidjson/include/rapidjson/internal/pow10.h +55 -0
  234. data/ext/rj_schema/rapidjson/include/rapidjson/internal/regex.h +739 -0
  235. data/ext/rj_schema/rapidjson/include/rapidjson/internal/stack.h +232 -0
  236. data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +69 -0
  237. data/ext/rj_schema/rapidjson/include/rapidjson/internal/strtod.h +290 -0
  238. data/ext/rj_schema/rapidjson/include/rapidjson/internal/swap.h +46 -0
  239. data/ext/rj_schema/rapidjson/include/rapidjson/istreamwrapper.h +128 -0
  240. data/ext/rj_schema/rapidjson/include/rapidjson/memorybuffer.h +70 -0
  241. data/ext/rj_schema/rapidjson/include/rapidjson/memorystream.h +71 -0
  242. data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/inttypes.h +316 -0
  243. data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/stdint.h +300 -0
  244. data/ext/rj_schema/rapidjson/include/rapidjson/ostreamwrapper.h +81 -0
  245. data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +1415 -0
  246. data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +277 -0
  247. data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +676 -0
  248. data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +2236 -0
  249. data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +2496 -0
  250. data/ext/rj_schema/rapidjson/include/rapidjson/stream.h +223 -0
  251. data/ext/rj_schema/rapidjson/include/rapidjson/stringbuffer.h +121 -0
  252. data/ext/rj_schema/rapidjson/include/rapidjson/writer.h +710 -0
  253. data/ext/rj_schema/rapidjson/include_dirs.js +2 -0
  254. data/ext/rj_schema/rapidjson/library.json +15 -0
  255. data/ext/rj_schema/rapidjson/license.txt +57 -0
  256. data/ext/rj_schema/rapidjson/package.json +24 -0
  257. data/ext/rj_schema/rapidjson/rapidjson.autopkg +77 -0
  258. data/ext/rj_schema/rapidjson/readme.md +210 -0
  259. data/ext/rj_schema/rapidjson/readme.zh-cn.md +152 -0
  260. data/ext/rj_schema/rapidjson/test/CMakeLists.txt +20 -0
  261. data/ext/rj_schema/rapidjson/test/perftest/CMakeLists.txt +28 -0
  262. data/ext/rj_schema/rapidjson/test/perftest/misctest.cpp +974 -0
  263. data/ext/rj_schema/rapidjson/test/perftest/perftest.cpp +24 -0
  264. data/ext/rj_schema/rapidjson/test/perftest/perftest.h +185 -0
  265. data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +166 -0
  266. data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +546 -0
  267. data/ext/rj_schema/rapidjson/test/perftest/schematest.cpp +223 -0
  268. data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +92 -0
  269. data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +100 -0
  270. data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +138 -0
  271. data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +115 -0
  272. data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +672 -0
  273. data/ext/rj_schema/rapidjson/test/unittest/dtoatest.cpp +98 -0
  274. data/ext/rj_schema/rapidjson/test/unittest/encodedstreamtest.cpp +313 -0
  275. data/ext/rj_schema/rapidjson/test/unittest/encodingstest.cpp +451 -0
  276. data/ext/rj_schema/rapidjson/test/unittest/filestreamtest.cpp +155 -0
  277. data/ext/rj_schema/rapidjson/test/unittest/fwdtest.cpp +230 -0
  278. data/ext/rj_schema/rapidjson/test/unittest/istreamwrappertest.cpp +181 -0
  279. data/ext/rj_schema/rapidjson/test/unittest/itoatest.cpp +160 -0
  280. data/ext/rj_schema/rapidjson/test/unittest/jsoncheckertest.cpp +143 -0
  281. data/ext/rj_schema/rapidjson/test/unittest/namespacetest.cpp +70 -0
  282. data/ext/rj_schema/rapidjson/test/unittest/ostreamwrappertest.cpp +92 -0
  283. data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +1638 -0
  284. data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +373 -0
  285. data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +2225 -0
  286. data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +639 -0
  287. data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +2072 -0
  288. data/ext/rj_schema/rapidjson/test/unittest/simdtest.cpp +219 -0
  289. data/ext/rj_schema/rapidjson/test/unittest/strfunctest.cpp +30 -0
  290. data/ext/rj_schema/rapidjson/test/unittest/stringbuffertest.cpp +192 -0
  291. data/ext/rj_schema/rapidjson/test/unittest/strtodtest.cpp +132 -0
  292. data/ext/rj_schema/rapidjson/test/unittest/unittest.cpp +51 -0
  293. data/ext/rj_schema/rapidjson/test/unittest/unittest.h +143 -0
  294. data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +1851 -0
  295. data/ext/rj_schema/rapidjson/test/unittest/writertest.cpp +598 -0
  296. data/ext/rj_schema/rapidjson/test/valgrind.supp +17 -0
  297. data/ext/rj_schema/rapidjson/thirdparty/gtest/BUILD.bazel +175 -0
  298. data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +33 -0
  299. data/ext/rj_schema/rapidjson/thirdparty/gtest/CONTRIBUTING.md +160 -0
  300. data/ext/rj_schema/rapidjson/thirdparty/gtest/LICENSE +28 -0
  301. data/ext/rj_schema/rapidjson/thirdparty/gtest/Makefile.am +14 -0
  302. data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +122 -0
  303. data/ext/rj_schema/rapidjson/thirdparty/gtest/WORKSPACE +8 -0
  304. data/ext/rj_schema/rapidjson/thirdparty/gtest/appveyor.yml +104 -0
  305. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-autotools.sh +44 -0
  306. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-bazel.sh +36 -0
  307. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-linux.sh +41 -0
  308. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-osx.sh +40 -0
  309. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/get-nprocessors.sh +48 -0
  310. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-linux.sh +49 -0
  311. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-osx.sh +39 -0
  312. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/log-config.sh +51 -0
  313. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/travis.sh +44 -0
  314. data/ext/rj_schema/rapidjson/thirdparty/gtest/configure.ac +16 -0
  315. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +126 -0
  316. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +242 -0
  317. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +40 -0
  318. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/LICENSE +28 -0
  319. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/Makefile.am +224 -0
  320. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +344 -0
  321. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock.pc.in +9 -0
  322. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock_main.pc.in +9 -0
  323. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +146 -0
  324. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +564 -0
  325. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +3660 -0
  326. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +280 -0
  327. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +15 -0
  328. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +447 -0
  329. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +627 -0
  330. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +19 -0
  331. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +1262 -0
  332. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +147 -0
  333. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +2571 -0
  334. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +833 -0
  335. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +1379 -0
  336. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +347 -0
  337. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +2258 -0
  338. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +675 -0
  339. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +458 -0
  340. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +178 -0
  341. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +5255 -0
  342. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +246 -0
  343. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +91 -0
  344. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +1918 -0
  345. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +95 -0
  346. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +8 -0
  347. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +10 -0
  348. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +38 -0
  349. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +46 -0
  350. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +286 -0
  351. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +136 -0
  352. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +574 -0
  353. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +87 -0
  354. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/make/Makefile +101 -0
  355. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +32 -0
  356. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +191 -0
  357. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +15 -0
  358. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +187 -0
  359. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +201 -0
  360. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +46 -0
  361. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +145 -0
  362. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +19 -0
  363. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +151 -0
  364. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +176 -0
  365. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +46 -0
  366. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +145 -0
  367. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +19 -0
  368. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +151 -0
  369. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +176 -0
  370. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +240 -0
  371. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +203 -0
  372. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +34 -0
  373. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +115 -0
  374. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
  375. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +1733 -0
  376. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +227 -0
  377. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +448 -0
  378. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +59 -0
  379. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +287 -0
  380. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +41 -0
  381. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +31 -0
  382. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +303 -0
  383. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +640 -0
  384. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +1387 -0
  385. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +78 -0
  386. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +47 -0
  387. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +156 -0
  388. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +204 -0
  389. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +573 -0
  390. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +883 -0
  391. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +205 -0
  392. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +54 -0
  393. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/BUILD.bazel +123 -0
  394. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +1575 -0
  395. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +428 -0
  396. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +1230 -0
  397. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +647 -0
  398. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +129 -0
  399. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +1341 -0
  400. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +718 -0
  401. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +6767 -0
  402. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +710 -0
  403. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +511 -0
  404. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +43 -0
  405. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +2771 -0
  406. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +51 -0
  407. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +81 -0
  408. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +108 -0
  409. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +100 -0
  410. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +40 -0
  411. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +40 -0
  412. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +691 -0
  413. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +183 -0
  414. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +310 -0
  415. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +317 -0
  416. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +323 -0
  417. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +262 -0
  418. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +110 -0
  419. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CHANGES +157 -0
  420. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +312 -0
  421. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +37 -0
  422. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/LICENSE +28 -0
  423. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +339 -0
  424. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +341 -0
  425. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest.pc.in +9 -0
  426. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest_main.pc.in +10 -0
  427. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +280 -0
  428. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +138 -0
  429. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +54 -0
  430. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +38 -0
  431. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +40 -0
  432. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +82 -0
  433. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +88 -0
  434. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +68 -0
  435. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +146 -0
  436. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +177 -0
  437. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +93 -0
  438. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/advanced.md +2416 -0
  439. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/faq.md +1092 -0
  440. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/primer.md +536 -0
  441. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/samples.md +14 -0
  442. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +342 -0
  443. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +249 -0
  444. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +1438 -0
  445. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +501 -0
  446. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +1082 -0
  447. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +231 -0
  448. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +179 -0
  449. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +264 -0
  450. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +2332 -0
  451. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +357 -0
  452. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +61 -0
  453. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +70 -0
  454. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
  455. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +45 -0
  456. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +275 -0
  457. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +205 -0
  458. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +1277 -0
  459. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
  460. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +5139 -0
  461. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +279 -0
  462. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +723 -0
  463. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +100 -0
  464. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +2687 -0
  465. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +167 -0
  466. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
  467. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
  468. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +3347 -0
  469. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +313 -0
  470. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +363 -0
  471. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +74 -0
  472. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/make/Makefile +82 -0
  473. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.sln +55 -0
  474. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj +149 -0
  475. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj.filters +18 -0
  476. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.sln +55 -0
  477. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj +149 -0
  478. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj.filters +18 -0
  479. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj +154 -0
  480. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj.filters +18 -0
  481. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj +162 -0
  482. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj.filters +18 -0
  483. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj +199 -0
  484. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj.filters +26 -0
  485. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj +191 -0
  486. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj.filters +26 -0
  487. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj +188 -0
  488. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj.filters +18 -0
  489. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj +180 -0
  490. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj.filters +18 -0
  491. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +127 -0
  492. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +68 -0
  493. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +43 -0
  494. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +140 -0
  495. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +154 -0
  496. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +56 -0
  497. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +85 -0
  498. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +110 -0
  499. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +172 -0
  500. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +152 -0
  501. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +46 -0
  502. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +53 -0
  503. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +49 -0
  504. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +199 -0
  505. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +225 -0
  506. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +118 -0
  507. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +174 -0
  508. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +157 -0
  509. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/common.py +83 -0
  510. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +253 -0
  511. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +730 -0
  512. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +274 -0
  513. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +855 -0
  514. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +158 -0
  515. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/test/Makefile +59 -0
  516. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1387 -0
  517. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +78 -0
  518. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +48 -0
  519. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +1536 -0
  520. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +385 -0
  521. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +1175 -0
  522. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +1277 -0
  523. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +458 -0
  524. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +102 -0
  525. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +119 -0
  526. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +5846 -0
  527. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +38 -0
  528. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/BUILD.bazel +396 -0
  529. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +93 -0
  530. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +1424 -0
  531. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +652 -0
  532. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +154 -0
  533. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +311 -0
  534. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +159 -0
  535. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +213 -0
  536. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +61 -0
  537. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +1110 -0
  538. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +53 -0
  539. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +1303 -0
  540. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +1737 -0
  541. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +208 -0
  542. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +320 -0
  543. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +45 -0
  544. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +380 -0
  545. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +66 -0
  546. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +341 -0
  547. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +47 -0
  548. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_assert_by_exception_test.cc +119 -0
  549. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +210 -0
  550. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +87 -0
  551. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +235 -0
  552. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +311 -0
  553. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +129 -0
  554. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +63 -0
  555. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +119 -0
  556. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +124 -0
  557. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +189 -0
  558. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +638 -0
  559. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +138 -0
  560. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +172 -0
  561. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +46 -0
  562. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_outfiles_test.py +162 -0
  563. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_output_unittest.py +611 -0
  564. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_test_utils.py +60 -0
  565. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +207 -0
  566. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +157 -0
  567. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +45 -0
  568. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +56 -0
  569. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +344 -0
  570. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +1067 -0
  571. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +781 -0
  572. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
  573. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +127 -0
  574. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +57 -0
  575. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +236 -0
  576. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +325 -0
  577. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +103 -0
  578. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +57 -0
  579. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +250 -0
  580. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +318 -0
  581. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test.py +65 -0
  582. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test_.cc +44 -0
  583. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +92 -0
  584. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +171 -0
  585. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +72 -0
  586. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +69 -0
  587. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +43 -0
  588. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +7797 -0
  589. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +48 -0
  590. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +48 -0
  591. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +140 -0
  592. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +378 -0
  593. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +179 -0
  594. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +196 -0
  595. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +36 -0
  596. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +55 -0
  597. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +30 -0
  598. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +17 -0
  599. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +41 -0
  600. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +32 -0
  601. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +18 -0
  602. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +8 -0
  603. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +30 -0
  604. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +28 -0
  605. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +457 -0
  606. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +62 -0
  607. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +63 -0
  608. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +59 -0
  609. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +68 -0
  610. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +65 -0
  611. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +100 -0
  612. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +1182 -0
  613. data/ext/rj_schema/rapidjson/travis-doxygen.sh +128 -0
  614. metadata +613 -1
@@ -0,0 +1,147 @@
1
+ // Copyright 2007, Google Inc.
2
+ // All rights reserved.
3
+ //
4
+ // Redistribution and use in source and binary forms, with or without
5
+ // modification, are permitted provided that the following conditions are
6
+ // met:
7
+ //
8
+ // * Redistributions of source code must retain the above copyright
9
+ // notice, this list of conditions and the following disclaimer.
10
+ // * Redistributions in binary form must reproduce the above
11
+ // copyright notice, this list of conditions and the following disclaimer
12
+ // in the documentation and/or other materials provided with the
13
+ // distribution.
14
+ // * Neither the name of Google Inc. nor the names of its
15
+ // contributors may be used to endorse or promote products derived from
16
+ // this software without specific prior written permission.
17
+ //
18
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+ //
30
+ // Author: wan@google.com (Zhanyong Wan)
31
+
32
+ // Google Mock - a framework for writing C++ mock classes.
33
+ //
34
+ // This file implements some commonly used cardinalities. More
35
+ // cardinalities can be defined by the user implementing the
36
+ // CardinalityInterface interface if necessary.
37
+
38
+ #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
39
+ #define GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
40
+
41
+ #include <limits.h>
42
+ #include <ostream> // NOLINT
43
+ #include "gmock/internal/gmock-port.h"
44
+ #include "gtest/gtest.h"
45
+
46
+ namespace testing {
47
+
48
+ // To implement a cardinality Foo, define:
49
+ // 1. a class FooCardinality that implements the
50
+ // CardinalityInterface interface, and
51
+ // 2. a factory function that creates a Cardinality object from a
52
+ // const FooCardinality*.
53
+ //
54
+ // The two-level delegation design follows that of Matcher, providing
55
+ // consistency for extension developers. It also eases ownership
56
+ // management as Cardinality objects can now be copied like plain values.
57
+
58
+ // The implementation of a cardinality.
59
+ class CardinalityInterface {
60
+ public:
61
+ virtual ~CardinalityInterface() {}
62
+
63
+ // Conservative estimate on the lower/upper bound of the number of
64
+ // calls allowed.
65
+ virtual int ConservativeLowerBound() const { return 0; }
66
+ virtual int ConservativeUpperBound() const { return INT_MAX; }
67
+
68
+ // Returns true iff call_count calls will satisfy this cardinality.
69
+ virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
70
+
71
+ // Returns true iff call_count calls will saturate this cardinality.
72
+ virtual bool IsSaturatedByCallCount(int call_count) const = 0;
73
+
74
+ // Describes self to an ostream.
75
+ virtual void DescribeTo(::std::ostream* os) const = 0;
76
+ };
77
+
78
+ // A Cardinality is a copyable and IMMUTABLE (except by assignment)
79
+ // object that specifies how many times a mock function is expected to
80
+ // be called. The implementation of Cardinality is just a linked_ptr
81
+ // to const CardinalityInterface, so copying is fairly cheap.
82
+ // Don't inherit from Cardinality!
83
+ class GTEST_API_ Cardinality {
84
+ public:
85
+ // Constructs a null cardinality. Needed for storing Cardinality
86
+ // objects in STL containers.
87
+ Cardinality() {}
88
+
89
+ // Constructs a Cardinality from its implementation.
90
+ explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {}
91
+
92
+ // Conservative estimate on the lower/upper bound of the number of
93
+ // calls allowed.
94
+ int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); }
95
+ int ConservativeUpperBound() const { return impl_->ConservativeUpperBound(); }
96
+
97
+ // Returns true iff call_count calls will satisfy this cardinality.
98
+ bool IsSatisfiedByCallCount(int call_count) const {
99
+ return impl_->IsSatisfiedByCallCount(call_count);
100
+ }
101
+
102
+ // Returns true iff call_count calls will saturate this cardinality.
103
+ bool IsSaturatedByCallCount(int call_count) const {
104
+ return impl_->IsSaturatedByCallCount(call_count);
105
+ }
106
+
107
+ // Returns true iff call_count calls will over-saturate this
108
+ // cardinality, i.e. exceed the maximum number of allowed calls.
109
+ bool IsOverSaturatedByCallCount(int call_count) const {
110
+ return impl_->IsSaturatedByCallCount(call_count) &&
111
+ !impl_->IsSatisfiedByCallCount(call_count);
112
+ }
113
+
114
+ // Describes self to an ostream
115
+ void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }
116
+
117
+ // Describes the given actual call count to an ostream.
118
+ static void DescribeActualCallCountTo(int actual_call_count,
119
+ ::std::ostream* os);
120
+
121
+ private:
122
+ internal::linked_ptr<const CardinalityInterface> impl_;
123
+ };
124
+
125
+ // Creates a cardinality that allows at least n calls.
126
+ GTEST_API_ Cardinality AtLeast(int n);
127
+
128
+ // Creates a cardinality that allows at most n calls.
129
+ GTEST_API_ Cardinality AtMost(int n);
130
+
131
+ // Creates a cardinality that allows any number of calls.
132
+ GTEST_API_ Cardinality AnyNumber();
133
+
134
+ // Creates a cardinality that allows between min and max calls.
135
+ GTEST_API_ Cardinality Between(int min, int max);
136
+
137
+ // Creates a cardinality that allows exactly n calls.
138
+ GTEST_API_ Cardinality Exactly(int n);
139
+
140
+ // Creates a cardinality from its implementation.
141
+ inline Cardinality MakeCardinality(const CardinalityInterface* c) {
142
+ return Cardinality(c);
143
+ }
144
+
145
+ } // namespace testing
146
+
147
+ #endif // GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
@@ -0,0 +1,2571 @@
1
+ // This file was GENERATED by command:
2
+ // pump.py gmock-generated-actions.h.pump
3
+ // DO NOT EDIT BY HAND!!!
4
+
5
+ // Copyright 2007, 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
+ // Author: wan@google.com (Zhanyong Wan)
35
+
36
+ // Google Mock - a framework for writing C++ mock classes.
37
+ //
38
+ // This file implements some commonly used variadic actions.
39
+
40
+ #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
41
+ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
42
+
43
+ #include "gmock/gmock-actions.h"
44
+ #include "gmock/internal/gmock-port.h"
45
+
46
+ namespace testing {
47
+ namespace internal {
48
+
49
+ // InvokeHelper<F> knows how to unpack an N-tuple and invoke an N-ary
50
+ // function, method, or callback with the unpacked values, where F is
51
+ // a function type that takes N arguments.
52
+ template <typename Result, typename ArgumentTuple>
53
+ class InvokeHelper;
54
+
55
+ template <typename R>
56
+ class InvokeHelper<R, ::testing::tuple<> > {
57
+ public:
58
+ template <typename Function>
59
+ static R Invoke(Function function, const ::testing::tuple<>&) {
60
+ return function();
61
+ }
62
+
63
+ template <class Class, typename MethodPtr>
64
+ static R InvokeMethod(Class* obj_ptr,
65
+ MethodPtr method_ptr,
66
+ const ::testing::tuple<>&) {
67
+ return (obj_ptr->*method_ptr)();
68
+ }
69
+
70
+ template <typename CallbackType>
71
+ static R InvokeCallback(CallbackType* callback,
72
+ const ::testing::tuple<>&) {
73
+ return callback->Run();
74
+ }
75
+ };
76
+
77
+ template <typename R, typename A1>
78
+ class InvokeHelper<R, ::testing::tuple<A1> > {
79
+ public:
80
+ template <typename Function>
81
+ static R Invoke(Function function, const ::testing::tuple<A1>& args) {
82
+ return function(get<0>(args));
83
+ }
84
+
85
+ template <class Class, typename MethodPtr>
86
+ static R InvokeMethod(Class* obj_ptr,
87
+ MethodPtr method_ptr,
88
+ const ::testing::tuple<A1>& args) {
89
+ return (obj_ptr->*method_ptr)(get<0>(args));
90
+ }
91
+
92
+ template <typename CallbackType>
93
+ static R InvokeCallback(CallbackType* callback,
94
+ const ::testing::tuple<A1>& args) {
95
+ return callback->Run(get<0>(args));
96
+ }
97
+ };
98
+
99
+ template <typename R, typename A1, typename A2>
100
+ class InvokeHelper<R, ::testing::tuple<A1, A2> > {
101
+ public:
102
+ template <typename Function>
103
+ static R Invoke(Function function, const ::testing::tuple<A1, A2>& args) {
104
+ return function(get<0>(args), get<1>(args));
105
+ }
106
+
107
+ template <class Class, typename MethodPtr>
108
+ static R InvokeMethod(Class* obj_ptr,
109
+ MethodPtr method_ptr,
110
+ const ::testing::tuple<A1, A2>& args) {
111
+ return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args));
112
+ }
113
+
114
+ template <typename CallbackType>
115
+ static R InvokeCallback(CallbackType* callback,
116
+ const ::testing::tuple<A1, A2>& args) {
117
+ return callback->Run(get<0>(args), get<1>(args));
118
+ }
119
+ };
120
+
121
+ template <typename R, typename A1, typename A2, typename A3>
122
+ class InvokeHelper<R, ::testing::tuple<A1, A2, A3> > {
123
+ public:
124
+ template <typename Function>
125
+ static R Invoke(Function function, const ::testing::tuple<A1, A2, A3>& args) {
126
+ return function(get<0>(args), get<1>(args), get<2>(args));
127
+ }
128
+
129
+ template <class Class, typename MethodPtr>
130
+ static R InvokeMethod(Class* obj_ptr,
131
+ MethodPtr method_ptr,
132
+ const ::testing::tuple<A1, A2, A3>& args) {
133
+ return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
134
+ get<2>(args));
135
+ }
136
+
137
+ template <typename CallbackType>
138
+ static R InvokeCallback(CallbackType* callback,
139
+ const ::testing::tuple<A1, A2, A3>& args) {
140
+ return callback->Run(get<0>(args), get<1>(args), get<2>(args));
141
+ }
142
+ };
143
+
144
+ template <typename R, typename A1, typename A2, typename A3, typename A4>
145
+ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4> > {
146
+ public:
147
+ template <typename Function>
148
+ static R Invoke(Function function, const ::testing::tuple<A1, A2, A3,
149
+ A4>& args) {
150
+ return function(get<0>(args), get<1>(args), get<2>(args),
151
+ get<3>(args));
152
+ }
153
+
154
+ template <class Class, typename MethodPtr>
155
+ static R InvokeMethod(Class* obj_ptr,
156
+ MethodPtr method_ptr,
157
+ const ::testing::tuple<A1, A2, A3, A4>& args) {
158
+ return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
159
+ get<2>(args), get<3>(args));
160
+ }
161
+
162
+ template <typename CallbackType>
163
+ static R InvokeCallback(CallbackType* callback,
164
+ const ::testing::tuple<A1, A2, A3, A4>& args) {
165
+ return callback->Run(get<0>(args), get<1>(args), get<2>(args),
166
+ get<3>(args));
167
+ }
168
+ };
169
+
170
+ template <typename R, typename A1, typename A2, typename A3, typename A4,
171
+ typename A5>
172
+ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5> > {
173
+ public:
174
+ template <typename Function>
175
+ static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4,
176
+ A5>& args) {
177
+ return function(get<0>(args), get<1>(args), get<2>(args),
178
+ get<3>(args), get<4>(args));
179
+ }
180
+
181
+ template <class Class, typename MethodPtr>
182
+ static R InvokeMethod(Class* obj_ptr,
183
+ MethodPtr method_ptr,
184
+ const ::testing::tuple<A1, A2, A3, A4, A5>& args) {
185
+ return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
186
+ get<2>(args), get<3>(args), get<4>(args));
187
+ }
188
+
189
+ template <typename CallbackType>
190
+ static R InvokeCallback(CallbackType* callback,
191
+ const ::testing::tuple<A1, A2, A3, A4, A5>& args) {
192
+ return callback->Run(get<0>(args), get<1>(args), get<2>(args),
193
+ get<3>(args), get<4>(args));
194
+ }
195
+ };
196
+
197
+ template <typename R, typename A1, typename A2, typename A3, typename A4,
198
+ typename A5, typename A6>
199
+ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
200
+ public:
201
+ template <typename Function>
202
+ static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
203
+ A6>& args) {
204
+ return function(get<0>(args), get<1>(args), get<2>(args),
205
+ get<3>(args), get<4>(args), get<5>(args));
206
+ }
207
+
208
+ template <class Class, typename MethodPtr>
209
+ static R InvokeMethod(Class* obj_ptr,
210
+ MethodPtr method_ptr,
211
+ const ::testing::tuple<A1, A2, A3, A4, A5, A6>& args) {
212
+ return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
213
+ get<2>(args), get<3>(args), get<4>(args), get<5>(args));
214
+ }
215
+
216
+ // There is no InvokeCallback() for 6-tuples, as google3 callbacks
217
+ // support 5 arguments at most.
218
+ };
219
+
220
+ template <typename R, typename A1, typename A2, typename A3, typename A4,
221
+ typename A5, typename A6, typename A7>
222
+ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
223
+ public:
224
+ template <typename Function>
225
+ static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
226
+ A6, A7>& args) {
227
+ return function(get<0>(args), get<1>(args), get<2>(args),
228
+ get<3>(args), get<4>(args), get<5>(args), get<6>(args));
229
+ }
230
+
231
+ template <class Class, typename MethodPtr>
232
+ static R InvokeMethod(Class* obj_ptr,
233
+ MethodPtr method_ptr,
234
+ const ::testing::tuple<A1, A2, A3, A4, A5, A6,
235
+ A7>& args) {
236
+ return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
237
+ get<2>(args), get<3>(args), get<4>(args), get<5>(args),
238
+ get<6>(args));
239
+ }
240
+
241
+ // There is no InvokeCallback() for 7-tuples, as google3 callbacks
242
+ // support 5 arguments at most.
243
+ };
244
+
245
+ template <typename R, typename A1, typename A2, typename A3, typename A4,
246
+ typename A5, typename A6, typename A7, typename A8>
247
+ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
248
+ public:
249
+ template <typename Function>
250
+ static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
251
+ A6, A7, A8>& args) {
252
+ return function(get<0>(args), get<1>(args), get<2>(args),
253
+ get<3>(args), get<4>(args), get<5>(args), get<6>(args),
254
+ get<7>(args));
255
+ }
256
+
257
+ template <class Class, typename MethodPtr>
258
+ static R InvokeMethod(Class* obj_ptr,
259
+ MethodPtr method_ptr,
260
+ const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7,
261
+ A8>& args) {
262
+ return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
263
+ get<2>(args), get<3>(args), get<4>(args), get<5>(args),
264
+ get<6>(args), get<7>(args));
265
+ }
266
+
267
+ // There is no InvokeCallback() for 8-tuples, as google3 callbacks
268
+ // support 5 arguments at most.
269
+ };
270
+
271
+ template <typename R, typename A1, typename A2, typename A3, typename A4,
272
+ typename A5, typename A6, typename A7, typename A8, typename A9>
273
+ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
274
+ public:
275
+ template <typename Function>
276
+ static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
277
+ A6, A7, A8, A9>& args) {
278
+ return function(get<0>(args), get<1>(args), get<2>(args),
279
+ get<3>(args), get<4>(args), get<5>(args), get<6>(args),
280
+ get<7>(args), get<8>(args));
281
+ }
282
+
283
+ template <class Class, typename MethodPtr>
284
+ static R InvokeMethod(Class* obj_ptr,
285
+ MethodPtr method_ptr,
286
+ const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
287
+ A9>& args) {
288
+ return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
289
+ get<2>(args), get<3>(args), get<4>(args), get<5>(args),
290
+ get<6>(args), get<7>(args), get<8>(args));
291
+ }
292
+
293
+ // There is no InvokeCallback() for 9-tuples, as google3 callbacks
294
+ // support 5 arguments at most.
295
+ };
296
+
297
+ template <typename R, typename A1, typename A2, typename A3, typename A4,
298
+ typename A5, typename A6, typename A7, typename A8, typename A9,
299
+ typename A10>
300
+ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
301
+ A10> > {
302
+ public:
303
+ template <typename Function>
304
+ static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
305
+ A6, A7, A8, A9, A10>& args) {
306
+ return function(get<0>(args), get<1>(args), get<2>(args),
307
+ get<3>(args), get<4>(args), get<5>(args), get<6>(args),
308
+ get<7>(args), get<8>(args), get<9>(args));
309
+ }
310
+
311
+ template <class Class, typename MethodPtr>
312
+ static R InvokeMethod(Class* obj_ptr,
313
+ MethodPtr method_ptr,
314
+ const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
315
+ A9, A10>& args) {
316
+ return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
317
+ get<2>(args), get<3>(args), get<4>(args), get<5>(args),
318
+ get<6>(args), get<7>(args), get<8>(args), get<9>(args));
319
+ }
320
+
321
+ // There is no InvokeCallback() for 10-tuples, as google3 callbacks
322
+ // support 5 arguments at most.
323
+ };
324
+
325
+ // Implements the Invoke(callback) action.
326
+ template <typename CallbackType>
327
+ class InvokeCallbackAction {
328
+ public:
329
+ // The c'tor takes ownership of the callback.
330
+ explicit InvokeCallbackAction(CallbackType* callback)
331
+ : callback_(callback) {
332
+ callback->CheckIsRepeatable(); // Makes sure the callback is permanent.
333
+ }
334
+
335
+ // This type conversion operator template allows Invoke(callback) to
336
+ // be used wherever the callback's type is compatible with that of
337
+ // the mock function, i.e. if the mock function's arguments can be
338
+ // implicitly converted to the callback's arguments and the
339
+ // callback's result can be implicitly converted to the mock
340
+ // function's result.
341
+ template <typename Result, typename ArgumentTuple>
342
+ Result Perform(const ArgumentTuple& args) const {
343
+ return InvokeHelper<Result, ArgumentTuple>::InvokeCallback(
344
+ callback_.get(), args);
345
+ }
346
+ private:
347
+ const linked_ptr<CallbackType> callback_;
348
+ };
349
+
350
+ // An INTERNAL macro for extracting the type of a tuple field. It's
351
+ // subject to change without notice - DO NOT USE IN USER CODE!
352
+ #define GMOCK_FIELD_(Tuple, N) \
353
+ typename ::testing::tuple_element<N, Tuple>::type
354
+
355
+ // SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::type is the
356
+ // type of an n-ary function whose i-th (1-based) argument type is the
357
+ // k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
358
+ // type, and whose return type is Result. For example,
359
+ // SelectArgs<int, ::testing::tuple<bool, char, double, long>, 0, 3>::type
360
+ // is int(bool, long).
361
+ //
362
+ // SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
363
+ // returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
364
+ // For example,
365
+ // SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select(
366
+ // ::testing::make_tuple(true, 'a', 2.5))
367
+ // returns tuple (2.5, true).
368
+ //
369
+ // The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
370
+ // in the range [0, 10]. Duplicates are allowed and they don't have
371
+ // to be in an ascending or descending order.
372
+
373
+ template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
374
+ int k4, int k5, int k6, int k7, int k8, int k9, int k10>
375
+ class SelectArgs {
376
+ public:
377
+ typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
378
+ GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
379
+ GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
380
+ GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
381
+ GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9),
382
+ GMOCK_FIELD_(ArgumentTuple, k10));
383
+ typedef typename Function<type>::ArgumentTuple SelectedArgs;
384
+ static SelectedArgs Select(const ArgumentTuple& args) {
385
+ return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
386
+ get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
387
+ get<k8>(args), get<k9>(args), get<k10>(args));
388
+ }
389
+ };
390
+
391
+ template <typename Result, typename ArgumentTuple>
392
+ class SelectArgs<Result, ArgumentTuple,
393
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
394
+ public:
395
+ typedef Result type();
396
+ typedef typename Function<type>::ArgumentTuple SelectedArgs;
397
+ static SelectedArgs Select(const ArgumentTuple& /* args */) {
398
+ return SelectedArgs();
399
+ }
400
+ };
401
+
402
+ template <typename Result, typename ArgumentTuple, int k1>
403
+ class SelectArgs<Result, ArgumentTuple,
404
+ k1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
405
+ public:
406
+ typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1));
407
+ typedef typename Function<type>::ArgumentTuple SelectedArgs;
408
+ static SelectedArgs Select(const ArgumentTuple& args) {
409
+ return SelectedArgs(get<k1>(args));
410
+ }
411
+ };
412
+
413
+ template <typename Result, typename ArgumentTuple, int k1, int k2>
414
+ class SelectArgs<Result, ArgumentTuple,
415
+ k1, k2, -1, -1, -1, -1, -1, -1, -1, -1> {
416
+ public:
417
+ typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
418
+ GMOCK_FIELD_(ArgumentTuple, k2));
419
+ typedef typename Function<type>::ArgumentTuple SelectedArgs;
420
+ static SelectedArgs Select(const ArgumentTuple& args) {
421
+ return SelectedArgs(get<k1>(args), get<k2>(args));
422
+ }
423
+ };
424
+
425
+ template <typename Result, typename ArgumentTuple, int k1, int k2, int k3>
426
+ class SelectArgs<Result, ArgumentTuple,
427
+ k1, k2, k3, -1, -1, -1, -1, -1, -1, -1> {
428
+ public:
429
+ typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
430
+ GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3));
431
+ typedef typename Function<type>::ArgumentTuple SelectedArgs;
432
+ static SelectedArgs Select(const ArgumentTuple& args) {
433
+ return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args));
434
+ }
435
+ };
436
+
437
+ template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
438
+ int k4>
439
+ class SelectArgs<Result, ArgumentTuple,
440
+ k1, k2, k3, k4, -1, -1, -1, -1, -1, -1> {
441
+ public:
442
+ typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
443
+ GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
444
+ GMOCK_FIELD_(ArgumentTuple, k4));
445
+ typedef typename Function<type>::ArgumentTuple SelectedArgs;
446
+ static SelectedArgs Select(const ArgumentTuple& args) {
447
+ return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
448
+ get<k4>(args));
449
+ }
450
+ };
451
+
452
+ template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
453
+ int k4, int k5>
454
+ class SelectArgs<Result, ArgumentTuple,
455
+ k1, k2, k3, k4, k5, -1, -1, -1, -1, -1> {
456
+ public:
457
+ typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
458
+ GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
459
+ GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5));
460
+ typedef typename Function<type>::ArgumentTuple SelectedArgs;
461
+ static SelectedArgs Select(const ArgumentTuple& args) {
462
+ return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
463
+ get<k4>(args), get<k5>(args));
464
+ }
465
+ };
466
+
467
+ template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
468
+ int k4, int k5, int k6>
469
+ class SelectArgs<Result, ArgumentTuple,
470
+ k1, k2, k3, k4, k5, k6, -1, -1, -1, -1> {
471
+ public:
472
+ typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
473
+ GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
474
+ GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
475
+ GMOCK_FIELD_(ArgumentTuple, k6));
476
+ typedef typename Function<type>::ArgumentTuple SelectedArgs;
477
+ static SelectedArgs Select(const ArgumentTuple& args) {
478
+ return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
479
+ get<k4>(args), get<k5>(args), get<k6>(args));
480
+ }
481
+ };
482
+
483
+ template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
484
+ int k4, int k5, int k6, int k7>
485
+ class SelectArgs<Result, ArgumentTuple,
486
+ k1, k2, k3, k4, k5, k6, k7, -1, -1, -1> {
487
+ public:
488
+ typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
489
+ GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
490
+ GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
491
+ GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7));
492
+ typedef typename Function<type>::ArgumentTuple SelectedArgs;
493
+ static SelectedArgs Select(const ArgumentTuple& args) {
494
+ return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
495
+ get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args));
496
+ }
497
+ };
498
+
499
+ template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
500
+ int k4, int k5, int k6, int k7, int k8>
501
+ class SelectArgs<Result, ArgumentTuple,
502
+ k1, k2, k3, k4, k5, k6, k7, k8, -1, -1> {
503
+ public:
504
+ typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
505
+ GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
506
+ GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
507
+ GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
508
+ GMOCK_FIELD_(ArgumentTuple, k8));
509
+ typedef typename Function<type>::ArgumentTuple SelectedArgs;
510
+ static SelectedArgs Select(const ArgumentTuple& args) {
511
+ return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
512
+ get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
513
+ get<k8>(args));
514
+ }
515
+ };
516
+
517
+ template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
518
+ int k4, int k5, int k6, int k7, int k8, int k9>
519
+ class SelectArgs<Result, ArgumentTuple,
520
+ k1, k2, k3, k4, k5, k6, k7, k8, k9, -1> {
521
+ public:
522
+ typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
523
+ GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
524
+ GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
525
+ GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
526
+ GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9));
527
+ typedef typename Function<type>::ArgumentTuple SelectedArgs;
528
+ static SelectedArgs Select(const ArgumentTuple& args) {
529
+ return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
530
+ get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
531
+ get<k8>(args), get<k9>(args));
532
+ }
533
+ };
534
+
535
+ #undef GMOCK_FIELD_
536
+
537
+ // Implements the WithArgs action.
538
+ template <typename InnerAction, int k1 = -1, int k2 = -1, int k3 = -1,
539
+ int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
540
+ int k9 = -1, int k10 = -1>
541
+ class WithArgsAction {
542
+ public:
543
+ explicit WithArgsAction(const InnerAction& action) : action_(action) {}
544
+
545
+ template <typename F>
546
+ operator Action<F>() const { return MakeAction(new Impl<F>(action_)); }
547
+
548
+ private:
549
+ template <typename F>
550
+ class Impl : public ActionInterface<F> {
551
+ public:
552
+ typedef typename Function<F>::Result Result;
553
+ typedef typename Function<F>::ArgumentTuple ArgumentTuple;
554
+
555
+ explicit Impl(const InnerAction& action) : action_(action) {}
556
+
557
+ virtual Result Perform(const ArgumentTuple& args) {
558
+ return action_.Perform(SelectArgs<Result, ArgumentTuple, k1, k2, k3, k4,
559
+ k5, k6, k7, k8, k9, k10>::Select(args));
560
+ }
561
+
562
+ private:
563
+ typedef typename SelectArgs<Result, ArgumentTuple,
564
+ k1, k2, k3, k4, k5, k6, k7, k8, k9, k10>::type InnerFunctionType;
565
+
566
+ Action<InnerFunctionType> action_;
567
+ };
568
+
569
+ const InnerAction action_;
570
+
571
+ GTEST_DISALLOW_ASSIGN_(WithArgsAction);
572
+ };
573
+
574
+ // A macro from the ACTION* family (defined later in this file)
575
+ // defines an action that can be used in a mock function. Typically,
576
+ // these actions only care about a subset of the arguments of the mock
577
+ // function. For example, if such an action only uses the second
578
+ // argument, it can be used in any mock function that takes >= 2
579
+ // arguments where the type of the second argument is compatible.
580
+ //
581
+ // Therefore, the action implementation must be prepared to take more
582
+ // arguments than it needs. The ExcessiveArg type is used to
583
+ // represent those excessive arguments. In order to keep the compiler
584
+ // error messages tractable, we define it in the testing namespace
585
+ // instead of testing::internal. However, this is an INTERNAL TYPE
586
+ // and subject to change without notice, so a user MUST NOT USE THIS
587
+ // TYPE DIRECTLY.
588
+ struct ExcessiveArg {};
589
+
590
+ // A helper class needed for implementing the ACTION* macros.
591
+ template <typename Result, class Impl>
592
+ class ActionHelper {
593
+ public:
594
+ static Result Perform(Impl* impl, const ::testing::tuple<>& args) {
595
+ return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),
596
+ ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
597
+ ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
598
+ ExcessiveArg());
599
+ }
600
+
601
+ template <typename A0>
602
+ static Result Perform(Impl* impl, const ::testing::tuple<A0>& args) {
603
+ return impl->template gmock_PerformImpl<A0>(args, get<0>(args),
604
+ ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
605
+ ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
606
+ ExcessiveArg());
607
+ }
608
+
609
+ template <typename A0, typename A1>
610
+ static Result Perform(Impl* impl, const ::testing::tuple<A0, A1>& args) {
611
+ return impl->template gmock_PerformImpl<A0, A1>(args, get<0>(args),
612
+ get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
613
+ ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
614
+ ExcessiveArg());
615
+ }
616
+
617
+ template <typename A0, typename A1, typename A2>
618
+ static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2>& args) {
619
+ return impl->template gmock_PerformImpl<A0, A1, A2>(args, get<0>(args),
620
+ get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(),
621
+ ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
622
+ ExcessiveArg());
623
+ }
624
+
625
+ template <typename A0, typename A1, typename A2, typename A3>
626
+ static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2,
627
+ A3>& args) {
628
+ return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, get<0>(args),
629
+ get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(),
630
+ ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
631
+ ExcessiveArg());
632
+ }
633
+
634
+ template <typename A0, typename A1, typename A2, typename A3, typename A4>
635
+ static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3,
636
+ A4>& args) {
637
+ return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(args,
638
+ get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
639
+ ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
640
+ ExcessiveArg());
641
+ }
642
+
643
+ template <typename A0, typename A1, typename A2, typename A3, typename A4,
644
+ typename A5>
645
+ static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
646
+ A5>& args) {
647
+ return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(args,
648
+ get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
649
+ get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
650
+ ExcessiveArg());
651
+ }
652
+
653
+ template <typename A0, typename A1, typename A2, typename A3, typename A4,
654
+ typename A5, typename A6>
655
+ static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
656
+ A5, A6>& args) {
657
+ return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(args,
658
+ get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
659
+ get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(),
660
+ ExcessiveArg());
661
+ }
662
+
663
+ template <typename A0, typename A1, typename A2, typename A3, typename A4,
664
+ typename A5, typename A6, typename A7>
665
+ static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
666
+ A5, A6, A7>& args) {
667
+ return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6,
668
+ A7>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
669
+ get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(),
670
+ ExcessiveArg());
671
+ }
672
+
673
+ template <typename A0, typename A1, typename A2, typename A3, typename A4,
674
+ typename A5, typename A6, typename A7, typename A8>
675
+ static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
676
+ A5, A6, A7, A8>& args) {
677
+ return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7,
678
+ A8>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
679
+ get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
680
+ ExcessiveArg());
681
+ }
682
+
683
+ template <typename A0, typename A1, typename A2, typename A3, typename A4,
684
+ typename A5, typename A6, typename A7, typename A8, typename A9>
685
+ static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
686
+ A5, A6, A7, A8, A9>& args) {
687
+ return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8,
688
+ A9>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
689
+ get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
690
+ get<9>(args));
691
+ }
692
+ };
693
+
694
+ } // namespace internal
695
+
696
+ // Various overloads for Invoke().
697
+
698
+ // WithArgs<N1, N2, ..., Nk>(an_action) creates an action that passes
699
+ // the selected arguments of the mock function to an_action and
700
+ // performs it. It serves as an adaptor between actions with
701
+ // different argument lists. C++ doesn't support default arguments for
702
+ // function templates, so we have to overload it.
703
+ template <int k1, typename InnerAction>
704
+ inline internal::WithArgsAction<InnerAction, k1>
705
+ WithArgs(const InnerAction& action) {
706
+ return internal::WithArgsAction<InnerAction, k1>(action);
707
+ }
708
+
709
+ template <int k1, int k2, typename InnerAction>
710
+ inline internal::WithArgsAction<InnerAction, k1, k2>
711
+ WithArgs(const InnerAction& action) {
712
+ return internal::WithArgsAction<InnerAction, k1, k2>(action);
713
+ }
714
+
715
+ template <int k1, int k2, int k3, typename InnerAction>
716
+ inline internal::WithArgsAction<InnerAction, k1, k2, k3>
717
+ WithArgs(const InnerAction& action) {
718
+ return internal::WithArgsAction<InnerAction, k1, k2, k3>(action);
719
+ }
720
+
721
+ template <int k1, int k2, int k3, int k4, typename InnerAction>
722
+ inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4>
723
+ WithArgs(const InnerAction& action) {
724
+ return internal::WithArgsAction<InnerAction, k1, k2, k3, k4>(action);
725
+ }
726
+
727
+ template <int k1, int k2, int k3, int k4, int k5, typename InnerAction>
728
+ inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>
729
+ WithArgs(const InnerAction& action) {
730
+ return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>(action);
731
+ }
732
+
733
+ template <int k1, int k2, int k3, int k4, int k5, int k6, typename InnerAction>
734
+ inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>
735
+ WithArgs(const InnerAction& action) {
736
+ return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>(action);
737
+ }
738
+
739
+ template <int k1, int k2, int k3, int k4, int k5, int k6, int k7,
740
+ typename InnerAction>
741
+ inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7>
742
+ WithArgs(const InnerAction& action) {
743
+ return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6,
744
+ k7>(action);
745
+ }
746
+
747
+ template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
748
+ typename InnerAction>
749
+ inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8>
750
+ WithArgs(const InnerAction& action) {
751
+ return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7,
752
+ k8>(action);
753
+ }
754
+
755
+ template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
756
+ int k9, typename InnerAction>
757
+ inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8, k9>
758
+ WithArgs(const InnerAction& action) {
759
+ return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
760
+ k9>(action);
761
+ }
762
+
763
+ template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
764
+ int k9, int k10, typename InnerAction>
765
+ inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
766
+ k9, k10>
767
+ WithArgs(const InnerAction& action) {
768
+ return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
769
+ k9, k10>(action);
770
+ }
771
+
772
+ // Creates an action that does actions a1, a2, ..., sequentially in
773
+ // each invocation.
774
+ template <typename Action1, typename Action2>
775
+ inline internal::DoBothAction<Action1, Action2>
776
+ DoAll(Action1 a1, Action2 a2) {
777
+ return internal::DoBothAction<Action1, Action2>(a1, a2);
778
+ }
779
+
780
+ template <typename Action1, typename Action2, typename Action3>
781
+ inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
782
+ Action3> >
783
+ DoAll(Action1 a1, Action2 a2, Action3 a3) {
784
+ return DoAll(a1, DoAll(a2, a3));
785
+ }
786
+
787
+ template <typename Action1, typename Action2, typename Action3,
788
+ typename Action4>
789
+ inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
790
+ internal::DoBothAction<Action3, Action4> > >
791
+ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4) {
792
+ return DoAll(a1, DoAll(a2, a3, a4));
793
+ }
794
+
795
+ template <typename Action1, typename Action2, typename Action3,
796
+ typename Action4, typename Action5>
797
+ inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
798
+ internal::DoBothAction<Action3, internal::DoBothAction<Action4,
799
+ Action5> > > >
800
+ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5) {
801
+ return DoAll(a1, DoAll(a2, a3, a4, a5));
802
+ }
803
+
804
+ template <typename Action1, typename Action2, typename Action3,
805
+ typename Action4, typename Action5, typename Action6>
806
+ inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
807
+ internal::DoBothAction<Action3, internal::DoBothAction<Action4,
808
+ internal::DoBothAction<Action5, Action6> > > > >
809
+ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6) {
810
+ return DoAll(a1, DoAll(a2, a3, a4, a5, a6));
811
+ }
812
+
813
+ template <typename Action1, typename Action2, typename Action3,
814
+ typename Action4, typename Action5, typename Action6, typename Action7>
815
+ inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
816
+ internal::DoBothAction<Action3, internal::DoBothAction<Action4,
817
+ internal::DoBothAction<Action5, internal::DoBothAction<Action6,
818
+ Action7> > > > > >
819
+ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
820
+ Action7 a7) {
821
+ return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7));
822
+ }
823
+
824
+ template <typename Action1, typename Action2, typename Action3,
825
+ typename Action4, typename Action5, typename Action6, typename Action7,
826
+ typename Action8>
827
+ inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
828
+ internal::DoBothAction<Action3, internal::DoBothAction<Action4,
829
+ internal::DoBothAction<Action5, internal::DoBothAction<Action6,
830
+ internal::DoBothAction<Action7, Action8> > > > > > >
831
+ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
832
+ Action7 a7, Action8 a8) {
833
+ return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8));
834
+ }
835
+
836
+ template <typename Action1, typename Action2, typename Action3,
837
+ typename Action4, typename Action5, typename Action6, typename Action7,
838
+ typename Action8, typename Action9>
839
+ inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
840
+ internal::DoBothAction<Action3, internal::DoBothAction<Action4,
841
+ internal::DoBothAction<Action5, internal::DoBothAction<Action6,
842
+ internal::DoBothAction<Action7, internal::DoBothAction<Action8,
843
+ Action9> > > > > > > >
844
+ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
845
+ Action7 a7, Action8 a8, Action9 a9) {
846
+ return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9));
847
+ }
848
+
849
+ template <typename Action1, typename Action2, typename Action3,
850
+ typename Action4, typename Action5, typename Action6, typename Action7,
851
+ typename Action8, typename Action9, typename Action10>
852
+ inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
853
+ internal::DoBothAction<Action3, internal::DoBothAction<Action4,
854
+ internal::DoBothAction<Action5, internal::DoBothAction<Action6,
855
+ internal::DoBothAction<Action7, internal::DoBothAction<Action8,
856
+ internal::DoBothAction<Action9, Action10> > > > > > > > >
857
+ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
858
+ Action7 a7, Action8 a8, Action9 a9, Action10 a10) {
859
+ return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9, a10));
860
+ }
861
+
862
+ } // namespace testing
863
+
864
+ // The ACTION* family of macros can be used in a namespace scope to
865
+ // define custom actions easily. The syntax:
866
+ //
867
+ // ACTION(name) { statements; }
868
+ //
869
+ // will define an action with the given name that executes the
870
+ // statements. The value returned by the statements will be used as
871
+ // the return value of the action. Inside the statements, you can
872
+ // refer to the K-th (0-based) argument of the mock function by
873
+ // 'argK', and refer to its type by 'argK_type'. For example:
874
+ //
875
+ // ACTION(IncrementArg1) {
876
+ // arg1_type temp = arg1;
877
+ // return ++(*temp);
878
+ // }
879
+ //
880
+ // allows you to write
881
+ //
882
+ // ...WillOnce(IncrementArg1());
883
+ //
884
+ // You can also refer to the entire argument tuple and its type by
885
+ // 'args' and 'args_type', and refer to the mock function type and its
886
+ // return type by 'function_type' and 'return_type'.
887
+ //
888
+ // Note that you don't need to specify the types of the mock function
889
+ // arguments. However rest assured that your code is still type-safe:
890
+ // you'll get a compiler error if *arg1 doesn't support the ++
891
+ // operator, or if the type of ++(*arg1) isn't compatible with the
892
+ // mock function's return type, for example.
893
+ //
894
+ // Sometimes you'll want to parameterize the action. For that you can use
895
+ // another macro:
896
+ //
897
+ // ACTION_P(name, param_name) { statements; }
898
+ //
899
+ // For example:
900
+ //
901
+ // ACTION_P(Add, n) { return arg0 + n; }
902
+ //
903
+ // will allow you to write:
904
+ //
905
+ // ...WillOnce(Add(5));
906
+ //
907
+ // Note that you don't need to provide the type of the parameter
908
+ // either. If you need to reference the type of a parameter named
909
+ // 'foo', you can write 'foo_type'. For example, in the body of
910
+ // ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
911
+ // of 'n'.
912
+ //
913
+ // We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support
914
+ // multi-parameter actions.
915
+ //
916
+ // For the purpose of typing, you can view
917
+ //
918
+ // ACTION_Pk(Foo, p1, ..., pk) { ... }
919
+ //
920
+ // as shorthand for
921
+ //
922
+ // template <typename p1_type, ..., typename pk_type>
923
+ // FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }
924
+ //
925
+ // In particular, you can provide the template type arguments
926
+ // explicitly when invoking Foo(), as in Foo<long, bool>(5, false);
927
+ // although usually you can rely on the compiler to infer the types
928
+ // for you automatically. You can assign the result of expression
929
+ // Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,
930
+ // pk_type>. This can be useful when composing actions.
931
+ //
932
+ // You can also overload actions with different numbers of parameters:
933
+ //
934
+ // ACTION_P(Plus, a) { ... }
935
+ // ACTION_P2(Plus, a, b) { ... }
936
+ //
937
+ // While it's tempting to always use the ACTION* macros when defining
938
+ // a new action, you should also consider implementing ActionInterface
939
+ // or using MakePolymorphicAction() instead, especially if you need to
940
+ // use the action a lot. While these approaches require more work,
941
+ // they give you more control on the types of the mock function
942
+ // arguments and the action parameters, which in general leads to
943
+ // better compiler error messages that pay off in the long run. They
944
+ // also allow overloading actions based on parameter types (as opposed
945
+ // to just based on the number of parameters).
946
+ //
947
+ // CAVEAT:
948
+ //
949
+ // ACTION*() can only be used in a namespace scope. The reason is
950
+ // that C++ doesn't yet allow function-local types to be used to
951
+ // instantiate templates. The up-coming C++0x standard will fix this.
952
+ // Once that's done, we'll consider supporting using ACTION*() inside
953
+ // a function.
954
+ //
955
+ // MORE INFORMATION:
956
+ //
957
+ // To learn more about using these macros, please search for 'ACTION'
958
+ // on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md
959
+
960
+ // An internal macro needed for implementing ACTION*().
961
+ #define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
962
+ const args_type& args GTEST_ATTRIBUTE_UNUSED_, \
963
+ arg0_type arg0 GTEST_ATTRIBUTE_UNUSED_, \
964
+ arg1_type arg1 GTEST_ATTRIBUTE_UNUSED_, \
965
+ arg2_type arg2 GTEST_ATTRIBUTE_UNUSED_, \
966
+ arg3_type arg3 GTEST_ATTRIBUTE_UNUSED_, \
967
+ arg4_type arg4 GTEST_ATTRIBUTE_UNUSED_, \
968
+ arg5_type arg5 GTEST_ATTRIBUTE_UNUSED_, \
969
+ arg6_type arg6 GTEST_ATTRIBUTE_UNUSED_, \
970
+ arg7_type arg7 GTEST_ATTRIBUTE_UNUSED_, \
971
+ arg8_type arg8 GTEST_ATTRIBUTE_UNUSED_, \
972
+ arg9_type arg9 GTEST_ATTRIBUTE_UNUSED_
973
+
974
+ // Sometimes you want to give an action explicit template parameters
975
+ // that cannot be inferred from its value parameters. ACTION() and
976
+ // ACTION_P*() don't support that. ACTION_TEMPLATE() remedies that
977
+ // and can be viewed as an extension to ACTION() and ACTION_P*().
978
+ //
979
+ // The syntax:
980
+ //
981
+ // ACTION_TEMPLATE(ActionName,
982
+ // HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
983
+ // AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
984
+ //
985
+ // defines an action template that takes m explicit template
986
+ // parameters and n value parameters. name_i is the name of the i-th
987
+ // template parameter, and kind_i specifies whether it's a typename,
988
+ // an integral constant, or a template. p_i is the name of the i-th
989
+ // value parameter.
990
+ //
991
+ // Example:
992
+ //
993
+ // // DuplicateArg<k, T>(output) converts the k-th argument of the mock
994
+ // // function to type T and copies it to *output.
995
+ // ACTION_TEMPLATE(DuplicateArg,
996
+ // HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
997
+ // AND_1_VALUE_PARAMS(output)) {
998
+ // *output = T(::testing::get<k>(args));
999
+ // }
1000
+ // ...
1001
+ // int n;
1002
+ // EXPECT_CALL(mock, Foo(_, _))
1003
+ // .WillOnce(DuplicateArg<1, unsigned char>(&n));
1004
+ //
1005
+ // To create an instance of an action template, write:
1006
+ //
1007
+ // ActionName<t1, ..., t_m>(v1, ..., v_n)
1008
+ //
1009
+ // where the ts are the template arguments and the vs are the value
1010
+ // arguments. The value argument types are inferred by the compiler.
1011
+ // If you want to explicitly specify the value argument types, you can
1012
+ // provide additional template arguments:
1013
+ //
1014
+ // ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
1015
+ //
1016
+ // where u_i is the desired type of v_i.
1017
+ //
1018
+ // ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the
1019
+ // number of value parameters, but not on the number of template
1020
+ // parameters. Without the restriction, the meaning of the following
1021
+ // is unclear:
1022
+ //
1023
+ // OverloadedAction<int, bool>(x);
1024
+ //
1025
+ // Are we using a single-template-parameter action where 'bool' refers
1026
+ // to the type of x, or are we using a two-template-parameter action
1027
+ // where the compiler is asked to infer the type of x?
1028
+ //
1029
+ // Implementation notes:
1030
+ //
1031
+ // GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and
1032
+ // GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for
1033
+ // implementing ACTION_TEMPLATE. The main trick we use is to create
1034
+ // new macro invocations when expanding a macro. For example, we have
1035
+ //
1036
+ // #define ACTION_TEMPLATE(name, template_params, value_params)
1037
+ // ... GMOCK_INTERNAL_DECL_##template_params ...
1038
+ //
1039
+ // which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)
1040
+ // to expand to
1041
+ //
1042
+ // ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...
1043
+ //
1044
+ // Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the
1045
+ // preprocessor will continue to expand it to
1046
+ //
1047
+ // ... typename T ...
1048
+ //
1049
+ // This technique conforms to the C++ standard and is portable. It
1050
+ // allows us to implement action templates using O(N) code, where N is
1051
+ // the maximum number of template/value parameters supported. Without
1052
+ // using it, we'd have to devote O(N^2) amount of code to implement all
1053
+ // combinations of m and n.
1054
+
1055
+ // Declares the template parameters.
1056
+ #define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0
1057
+ #define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
1058
+ name1) kind0 name0, kind1 name1
1059
+ #define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1060
+ kind2, name2) kind0 name0, kind1 name1, kind2 name2
1061
+ #define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1062
+ kind2, name2, kind3, name3) kind0 name0, kind1 name1, kind2 name2, \
1063
+ kind3 name3
1064
+ #define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1065
+ kind2, name2, kind3, name3, kind4, name4) kind0 name0, kind1 name1, \
1066
+ kind2 name2, kind3 name3, kind4 name4
1067
+ #define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1068
+ kind2, name2, kind3, name3, kind4, name4, kind5, name5) kind0 name0, \
1069
+ kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5
1070
+ #define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1071
+ kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
1072
+ name6) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
1073
+ kind5 name5, kind6 name6
1074
+ #define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1075
+ kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
1076
+ kind7, name7) kind0 name0, kind1 name1, kind2 name2, kind3 name3, \
1077
+ kind4 name4, kind5 name5, kind6 name6, kind7 name7
1078
+ #define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1079
+ kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
1080
+ kind7, name7, kind8, name8) kind0 name0, kind1 name1, kind2 name2, \
1081
+ kind3 name3, kind4 name4, kind5 name5, kind6 name6, kind7 name7, \
1082
+ kind8 name8
1083
+ #define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
1084
+ name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
1085
+ name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \
1086
+ kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \
1087
+ kind6 name6, kind7 name7, kind8 name8, kind9 name9
1088
+
1089
+ // Lists the template parameters.
1090
+ #define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0
1091
+ #define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
1092
+ name1) name0, name1
1093
+ #define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1094
+ kind2, name2) name0, name1, name2
1095
+ #define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1096
+ kind2, name2, kind3, name3) name0, name1, name2, name3
1097
+ #define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1098
+ kind2, name2, kind3, name3, kind4, name4) name0, name1, name2, name3, \
1099
+ name4
1100
+ #define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1101
+ kind2, name2, kind3, name3, kind4, name4, kind5, name5) name0, name1, \
1102
+ name2, name3, name4, name5
1103
+ #define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1104
+ kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
1105
+ name6) name0, name1, name2, name3, name4, name5, name6
1106
+ #define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1107
+ kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
1108
+ kind7, name7) name0, name1, name2, name3, name4, name5, name6, name7
1109
+ #define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
1110
+ kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
1111
+ kind7, name7, kind8, name8) name0, name1, name2, name3, name4, name5, \
1112
+ name6, name7, name8
1113
+ #define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
1114
+ name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
1115
+ name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \
1116
+ name3, name4, name5, name6, name7, name8, name9
1117
+
1118
+ // Declares the types of value parameters.
1119
+ #define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
1120
+ #define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type
1121
+ #define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) , \
1122
+ typename p0##_type, typename p1##_type
1123
+ #define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , \
1124
+ typename p0##_type, typename p1##_type, typename p2##_type
1125
+ #define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
1126
+ typename p0##_type, typename p1##_type, typename p2##_type, \
1127
+ typename p3##_type
1128
+ #define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
1129
+ typename p0##_type, typename p1##_type, typename p2##_type, \
1130
+ typename p3##_type, typename p4##_type
1131
+ #define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
1132
+ typename p0##_type, typename p1##_type, typename p2##_type, \
1133
+ typename p3##_type, typename p4##_type, typename p5##_type
1134
+ #define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1135
+ p6) , typename p0##_type, typename p1##_type, typename p2##_type, \
1136
+ typename p3##_type, typename p4##_type, typename p5##_type, \
1137
+ typename p6##_type
1138
+ #define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1139
+ p6, p7) , typename p0##_type, typename p1##_type, typename p2##_type, \
1140
+ typename p3##_type, typename p4##_type, typename p5##_type, \
1141
+ typename p6##_type, typename p7##_type
1142
+ #define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1143
+ p6, p7, p8) , typename p0##_type, typename p1##_type, typename p2##_type, \
1144
+ typename p3##_type, typename p4##_type, typename p5##_type, \
1145
+ typename p6##_type, typename p7##_type, typename p8##_type
1146
+ #define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1147
+ p6, p7, p8, p9) , typename p0##_type, typename p1##_type, \
1148
+ typename p2##_type, typename p3##_type, typename p4##_type, \
1149
+ typename p5##_type, typename p6##_type, typename p7##_type, \
1150
+ typename p8##_type, typename p9##_type
1151
+
1152
+ // Initializes the value parameters.
1153
+ #define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\
1154
+ ()
1155
+ #define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\
1156
+ (p0##_type gmock_p0) : p0(::testing::internal::move(gmock_p0))
1157
+ #define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\
1158
+ (p0##_type gmock_p0, \
1159
+ p1##_type gmock_p1) : p0(::testing::internal::move(gmock_p0)), \
1160
+ p1(::testing::internal::move(gmock_p1))
1161
+ #define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\
1162
+ (p0##_type gmock_p0, p1##_type gmock_p1, \
1163
+ p2##_type gmock_p2) : p0(::testing::internal::move(gmock_p0)), \
1164
+ p1(::testing::internal::move(gmock_p1)), \
1165
+ p2(::testing::internal::move(gmock_p2))
1166
+ #define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\
1167
+ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1168
+ p3##_type gmock_p3) : p0(::testing::internal::move(gmock_p0)), \
1169
+ p1(::testing::internal::move(gmock_p1)), \
1170
+ p2(::testing::internal::move(gmock_p2)), \
1171
+ p3(::testing::internal::move(gmock_p3))
1172
+ #define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\
1173
+ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1174
+ p3##_type gmock_p3, \
1175
+ p4##_type gmock_p4) : p0(::testing::internal::move(gmock_p0)), \
1176
+ p1(::testing::internal::move(gmock_p1)), \
1177
+ p2(::testing::internal::move(gmock_p2)), \
1178
+ p3(::testing::internal::move(gmock_p3)), \
1179
+ p4(::testing::internal::move(gmock_p4))
1180
+ #define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\
1181
+ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1182
+ p3##_type gmock_p3, p4##_type gmock_p4, \
1183
+ p5##_type gmock_p5) : p0(::testing::internal::move(gmock_p0)), \
1184
+ p1(::testing::internal::move(gmock_p1)), \
1185
+ p2(::testing::internal::move(gmock_p2)), \
1186
+ p3(::testing::internal::move(gmock_p3)), \
1187
+ p4(::testing::internal::move(gmock_p4)), \
1188
+ p5(::testing::internal::move(gmock_p5))
1189
+ #define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\
1190
+ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1191
+ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1192
+ p6##_type gmock_p6) : p0(::testing::internal::move(gmock_p0)), \
1193
+ p1(::testing::internal::move(gmock_p1)), \
1194
+ p2(::testing::internal::move(gmock_p2)), \
1195
+ p3(::testing::internal::move(gmock_p3)), \
1196
+ p4(::testing::internal::move(gmock_p4)), \
1197
+ p5(::testing::internal::move(gmock_p5)), \
1198
+ p6(::testing::internal::move(gmock_p6))
1199
+ #define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\
1200
+ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1201
+ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1202
+ p6##_type gmock_p6, \
1203
+ p7##_type gmock_p7) : p0(::testing::internal::move(gmock_p0)), \
1204
+ p1(::testing::internal::move(gmock_p1)), \
1205
+ p2(::testing::internal::move(gmock_p2)), \
1206
+ p3(::testing::internal::move(gmock_p3)), \
1207
+ p4(::testing::internal::move(gmock_p4)), \
1208
+ p5(::testing::internal::move(gmock_p5)), \
1209
+ p6(::testing::internal::move(gmock_p6)), \
1210
+ p7(::testing::internal::move(gmock_p7))
1211
+ #define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1212
+ p7, p8)\
1213
+ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1214
+ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1215
+ p6##_type gmock_p6, p7##_type gmock_p7, \
1216
+ p8##_type gmock_p8) : p0(::testing::internal::move(gmock_p0)), \
1217
+ p1(::testing::internal::move(gmock_p1)), \
1218
+ p2(::testing::internal::move(gmock_p2)), \
1219
+ p3(::testing::internal::move(gmock_p3)), \
1220
+ p4(::testing::internal::move(gmock_p4)), \
1221
+ p5(::testing::internal::move(gmock_p5)), \
1222
+ p6(::testing::internal::move(gmock_p6)), \
1223
+ p7(::testing::internal::move(gmock_p7)), \
1224
+ p8(::testing::internal::move(gmock_p8))
1225
+ #define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1226
+ p7, p8, p9)\
1227
+ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1228
+ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1229
+ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
1230
+ p9##_type gmock_p9) : p0(::testing::internal::move(gmock_p0)), \
1231
+ p1(::testing::internal::move(gmock_p1)), \
1232
+ p2(::testing::internal::move(gmock_p2)), \
1233
+ p3(::testing::internal::move(gmock_p3)), \
1234
+ p4(::testing::internal::move(gmock_p4)), \
1235
+ p5(::testing::internal::move(gmock_p5)), \
1236
+ p6(::testing::internal::move(gmock_p6)), \
1237
+ p7(::testing::internal::move(gmock_p7)), \
1238
+ p8(::testing::internal::move(gmock_p8)), \
1239
+ p9(::testing::internal::move(gmock_p9))
1240
+
1241
+ // Declares the fields for storing the value parameters.
1242
+ #define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
1243
+ #define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0;
1244
+ #define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0; \
1245
+ p1##_type p1;
1246
+ #define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0; \
1247
+ p1##_type p1; p2##_type p2;
1248
+ #define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0; \
1249
+ p1##_type p1; p2##_type p2; p3##_type p3;
1250
+ #define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
1251
+ p4) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4;
1252
+ #define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
1253
+ p5) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
1254
+ p5##_type p5;
1255
+ #define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1256
+ p6) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
1257
+ p5##_type p5; p6##_type p6;
1258
+ #define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1259
+ p7) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
1260
+ p5##_type p5; p6##_type p6; p7##_type p7;
1261
+ #define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1262
+ p7, p8) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
1263
+ p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8;
1264
+ #define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1265
+ p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
1266
+ p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \
1267
+ p9##_type p9;
1268
+
1269
+ // Lists the value parameters.
1270
+ #define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
1271
+ #define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0
1272
+ #define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1
1273
+ #define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2
1274
+ #define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3
1275
+ #define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) p0, p1, \
1276
+ p2, p3, p4
1277
+ #define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) p0, \
1278
+ p1, p2, p3, p4, p5
1279
+ #define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1280
+ p6) p0, p1, p2, p3, p4, p5, p6
1281
+ #define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1282
+ p7) p0, p1, p2, p3, p4, p5, p6, p7
1283
+ #define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1284
+ p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8
1285
+ #define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1286
+ p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9
1287
+
1288
+ // Lists the value parameter types.
1289
+ #define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
1290
+ #define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type
1291
+ #define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) , p0##_type, \
1292
+ p1##_type
1293
+ #define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , p0##_type, \
1294
+ p1##_type, p2##_type
1295
+ #define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
1296
+ p0##_type, p1##_type, p2##_type, p3##_type
1297
+ #define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
1298
+ p0##_type, p1##_type, p2##_type, p3##_type, p4##_type
1299
+ #define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
1300
+ p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type
1301
+ #define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1302
+ p6) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \
1303
+ p6##_type
1304
+ #define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1305
+ p6, p7) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1306
+ p5##_type, p6##_type, p7##_type
1307
+ #define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1308
+ p6, p7, p8) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1309
+ p5##_type, p6##_type, p7##_type, p8##_type
1310
+ #define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1311
+ p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1312
+ p5##_type, p6##_type, p7##_type, p8##_type, p9##_type
1313
+
1314
+ // Declares the value parameters.
1315
+ #define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
1316
+ #define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0
1317
+ #define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0, \
1318
+ p1##_type p1
1319
+ #define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0, \
1320
+ p1##_type p1, p2##_type p2
1321
+ #define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0, \
1322
+ p1##_type p1, p2##_type p2, p3##_type p3
1323
+ #define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
1324
+ p4) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4
1325
+ #define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
1326
+ p5) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
1327
+ p5##_type p5
1328
+ #define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
1329
+ p6) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
1330
+ p5##_type p5, p6##_type p6
1331
+ #define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1332
+ p7) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
1333
+ p5##_type p5, p6##_type p6, p7##_type p7
1334
+ #define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1335
+ p7, p8) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1336
+ p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8
1337
+ #define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1338
+ p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1339
+ p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
1340
+ p9##_type p9
1341
+
1342
+ // The suffix of the class template implementing the action template.
1343
+ #define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
1344
+ #define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P
1345
+ #define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2
1346
+ #define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3
1347
+ #define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4
1348
+ #define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5
1349
+ #define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6
1350
+ #define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7
1351
+ #define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1352
+ p7) P8
1353
+ #define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1354
+ p7, p8) P9
1355
+ #define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
1356
+ p7, p8, p9) P10
1357
+
1358
+ // The name of the class template implementing the action template.
1359
+ #define GMOCK_ACTION_CLASS_(name, value_params)\
1360
+ GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
1361
+
1362
+ #define ACTION_TEMPLATE(name, template_params, value_params)\
1363
+ template <GMOCK_INTERNAL_DECL_##template_params\
1364
+ GMOCK_INTERNAL_DECL_TYPE_##value_params>\
1365
+ class GMOCK_ACTION_CLASS_(name, value_params) {\
1366
+ public:\
1367
+ explicit GMOCK_ACTION_CLASS_(name, value_params)\
1368
+ GMOCK_INTERNAL_INIT_##value_params {}\
1369
+ template <typename F>\
1370
+ class gmock_Impl : public ::testing::ActionInterface<F> {\
1371
+ public:\
1372
+ typedef F function_type;\
1373
+ typedef typename ::testing::internal::Function<F>::Result return_type;\
1374
+ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1375
+ args_type;\
1376
+ explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\
1377
+ virtual return_type Perform(const args_type& args) {\
1378
+ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1379
+ Perform(this, args);\
1380
+ }\
1381
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1382
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1383
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1384
+ typename arg9_type>\
1385
+ return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1386
+ arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1387
+ arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1388
+ arg9_type arg9) const;\
1389
+ GMOCK_INTERNAL_DEFN_##value_params\
1390
+ private:\
1391
+ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1392
+ };\
1393
+ template <typename F> operator ::testing::Action<F>() const {\
1394
+ return ::testing::Action<F>(\
1395
+ new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
1396
+ }\
1397
+ GMOCK_INTERNAL_DEFN_##value_params\
1398
+ private:\
1399
+ GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
1400
+ };\
1401
+ template <GMOCK_INTERNAL_DECL_##template_params\
1402
+ GMOCK_INTERNAL_DECL_TYPE_##value_params>\
1403
+ inline GMOCK_ACTION_CLASS_(name, value_params)<\
1404
+ GMOCK_INTERNAL_LIST_##template_params\
1405
+ GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\
1406
+ GMOCK_INTERNAL_DECL_##value_params) {\
1407
+ return GMOCK_ACTION_CLASS_(name, value_params)<\
1408
+ GMOCK_INTERNAL_LIST_##template_params\
1409
+ GMOCK_INTERNAL_LIST_TYPE_##value_params>(\
1410
+ GMOCK_INTERNAL_LIST_##value_params);\
1411
+ }\
1412
+ template <GMOCK_INTERNAL_DECL_##template_params\
1413
+ GMOCK_INTERNAL_DECL_TYPE_##value_params>\
1414
+ template <typename F>\
1415
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1416
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1417
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1418
+ typename arg9_type>\
1419
+ typename ::testing::internal::Function<F>::Result\
1420
+ GMOCK_ACTION_CLASS_(name, value_params)<\
1421
+ GMOCK_INTERNAL_LIST_##template_params\
1422
+ GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\
1423
+ gmock_PerformImpl(\
1424
+ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1425
+
1426
+ #define ACTION(name)\
1427
+ class name##Action {\
1428
+ public:\
1429
+ name##Action() {}\
1430
+ template <typename F>\
1431
+ class gmock_Impl : public ::testing::ActionInterface<F> {\
1432
+ public:\
1433
+ typedef F function_type;\
1434
+ typedef typename ::testing::internal::Function<F>::Result return_type;\
1435
+ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1436
+ args_type;\
1437
+ gmock_Impl() {}\
1438
+ virtual return_type Perform(const args_type& args) {\
1439
+ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1440
+ Perform(this, args);\
1441
+ }\
1442
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1443
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1444
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1445
+ typename arg9_type>\
1446
+ return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1447
+ arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1448
+ arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1449
+ arg9_type arg9) const;\
1450
+ private:\
1451
+ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1452
+ };\
1453
+ template <typename F> operator ::testing::Action<F>() const {\
1454
+ return ::testing::Action<F>(new gmock_Impl<F>());\
1455
+ }\
1456
+ private:\
1457
+ GTEST_DISALLOW_ASSIGN_(name##Action);\
1458
+ };\
1459
+ inline name##Action name() {\
1460
+ return name##Action();\
1461
+ }\
1462
+ template <typename F>\
1463
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1464
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1465
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1466
+ typename arg9_type>\
1467
+ typename ::testing::internal::Function<F>::Result\
1468
+ name##Action::gmock_Impl<F>::gmock_PerformImpl(\
1469
+ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1470
+
1471
+ #define ACTION_P(name, p0)\
1472
+ template <typename p0##_type>\
1473
+ class name##ActionP {\
1474
+ public:\
1475
+ explicit name##ActionP(p0##_type gmock_p0) : \
1476
+ p0(::testing::internal::forward<p0##_type>(gmock_p0)) {}\
1477
+ template <typename F>\
1478
+ class gmock_Impl : public ::testing::ActionInterface<F> {\
1479
+ public:\
1480
+ typedef F function_type;\
1481
+ typedef typename ::testing::internal::Function<F>::Result return_type;\
1482
+ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1483
+ args_type;\
1484
+ explicit gmock_Impl(p0##_type gmock_p0) : \
1485
+ p0(::testing::internal::forward<p0##_type>(gmock_p0)) {}\
1486
+ virtual return_type Perform(const args_type& args) {\
1487
+ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1488
+ Perform(this, args);\
1489
+ }\
1490
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1491
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1492
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1493
+ typename arg9_type>\
1494
+ return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1495
+ arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1496
+ arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1497
+ arg9_type arg9) const;\
1498
+ p0##_type p0;\
1499
+ private:\
1500
+ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1501
+ };\
1502
+ template <typename F> operator ::testing::Action<F>() const {\
1503
+ return ::testing::Action<F>(new gmock_Impl<F>(p0));\
1504
+ }\
1505
+ p0##_type p0;\
1506
+ private:\
1507
+ GTEST_DISALLOW_ASSIGN_(name##ActionP);\
1508
+ };\
1509
+ template <typename p0##_type>\
1510
+ inline name##ActionP<p0##_type> name(p0##_type p0) {\
1511
+ return name##ActionP<p0##_type>(p0);\
1512
+ }\
1513
+ template <typename p0##_type>\
1514
+ template <typename F>\
1515
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1516
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1517
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1518
+ typename arg9_type>\
1519
+ typename ::testing::internal::Function<F>::Result\
1520
+ name##ActionP<p0##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1521
+ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1522
+
1523
+ #define ACTION_P2(name, p0, p1)\
1524
+ template <typename p0##_type, typename p1##_type>\
1525
+ class name##ActionP2 {\
1526
+ public:\
1527
+ name##ActionP2(p0##_type gmock_p0, \
1528
+ p1##_type gmock_p1) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1529
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)) {}\
1530
+ template <typename F>\
1531
+ class gmock_Impl : public ::testing::ActionInterface<F> {\
1532
+ public:\
1533
+ typedef F function_type;\
1534
+ typedef typename ::testing::internal::Function<F>::Result return_type;\
1535
+ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1536
+ args_type;\
1537
+ gmock_Impl(p0##_type gmock_p0, \
1538
+ p1##_type gmock_p1) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1539
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)) {}\
1540
+ virtual return_type Perform(const args_type& args) {\
1541
+ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1542
+ Perform(this, args);\
1543
+ }\
1544
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1545
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1546
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1547
+ typename arg9_type>\
1548
+ return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1549
+ arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1550
+ arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1551
+ arg9_type arg9) const;\
1552
+ p0##_type p0;\
1553
+ p1##_type p1;\
1554
+ private:\
1555
+ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1556
+ };\
1557
+ template <typename F> operator ::testing::Action<F>() const {\
1558
+ return ::testing::Action<F>(new gmock_Impl<F>(p0, p1));\
1559
+ }\
1560
+ p0##_type p0;\
1561
+ p1##_type p1;\
1562
+ private:\
1563
+ GTEST_DISALLOW_ASSIGN_(name##ActionP2);\
1564
+ };\
1565
+ template <typename p0##_type, typename p1##_type>\
1566
+ inline name##ActionP2<p0##_type, p1##_type> name(p0##_type p0, \
1567
+ p1##_type p1) {\
1568
+ return name##ActionP2<p0##_type, p1##_type>(p0, p1);\
1569
+ }\
1570
+ template <typename p0##_type, typename p1##_type>\
1571
+ template <typename F>\
1572
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1573
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1574
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1575
+ typename arg9_type>\
1576
+ typename ::testing::internal::Function<F>::Result\
1577
+ name##ActionP2<p0##_type, p1##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1578
+ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1579
+
1580
+ #define ACTION_P3(name, p0, p1, p2)\
1581
+ template <typename p0##_type, typename p1##_type, typename p2##_type>\
1582
+ class name##ActionP3 {\
1583
+ public:\
1584
+ name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \
1585
+ p2##_type gmock_p2) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1586
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1587
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)) {}\
1588
+ template <typename F>\
1589
+ class gmock_Impl : public ::testing::ActionInterface<F> {\
1590
+ public:\
1591
+ typedef F function_type;\
1592
+ typedef typename ::testing::internal::Function<F>::Result return_type;\
1593
+ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1594
+ args_type;\
1595
+ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \
1596
+ p2##_type gmock_p2) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1597
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1598
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)) {}\
1599
+ virtual return_type Perform(const args_type& args) {\
1600
+ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1601
+ Perform(this, args);\
1602
+ }\
1603
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1604
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1605
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1606
+ typename arg9_type>\
1607
+ return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1608
+ arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1609
+ arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1610
+ arg9_type arg9) const;\
1611
+ p0##_type p0;\
1612
+ p1##_type p1;\
1613
+ p2##_type p2;\
1614
+ private:\
1615
+ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1616
+ };\
1617
+ template <typename F> operator ::testing::Action<F>() const {\
1618
+ return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2));\
1619
+ }\
1620
+ p0##_type p0;\
1621
+ p1##_type p1;\
1622
+ p2##_type p2;\
1623
+ private:\
1624
+ GTEST_DISALLOW_ASSIGN_(name##ActionP3);\
1625
+ };\
1626
+ template <typename p0##_type, typename p1##_type, typename p2##_type>\
1627
+ inline name##ActionP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
1628
+ p1##_type p1, p2##_type p2) {\
1629
+ return name##ActionP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
1630
+ }\
1631
+ template <typename p0##_type, typename p1##_type, typename p2##_type>\
1632
+ template <typename F>\
1633
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1634
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1635
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1636
+ typename arg9_type>\
1637
+ typename ::testing::internal::Function<F>::Result\
1638
+ name##ActionP3<p0##_type, p1##_type, \
1639
+ p2##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1640
+ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1641
+
1642
+ #define ACTION_P4(name, p0, p1, p2, p3)\
1643
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1644
+ typename p3##_type>\
1645
+ class name##ActionP4 {\
1646
+ public:\
1647
+ name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \
1648
+ p2##_type gmock_p2, \
1649
+ p3##_type gmock_p3) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1650
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1651
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1652
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)) {}\
1653
+ template <typename F>\
1654
+ class gmock_Impl : public ::testing::ActionInterface<F> {\
1655
+ public:\
1656
+ typedef F function_type;\
1657
+ typedef typename ::testing::internal::Function<F>::Result return_type;\
1658
+ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1659
+ args_type;\
1660
+ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1661
+ p3##_type gmock_p3) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1662
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1663
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1664
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)) {}\
1665
+ virtual return_type Perform(const args_type& args) {\
1666
+ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1667
+ Perform(this, args);\
1668
+ }\
1669
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1670
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1671
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1672
+ typename arg9_type>\
1673
+ return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1674
+ arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1675
+ arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1676
+ arg9_type arg9) const;\
1677
+ p0##_type p0;\
1678
+ p1##_type p1;\
1679
+ p2##_type p2;\
1680
+ p3##_type p3;\
1681
+ private:\
1682
+ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1683
+ };\
1684
+ template <typename F> operator ::testing::Action<F>() const {\
1685
+ return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3));\
1686
+ }\
1687
+ p0##_type p0;\
1688
+ p1##_type p1;\
1689
+ p2##_type p2;\
1690
+ p3##_type p3;\
1691
+ private:\
1692
+ GTEST_DISALLOW_ASSIGN_(name##ActionP4);\
1693
+ };\
1694
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1695
+ typename p3##_type>\
1696
+ inline name##ActionP4<p0##_type, p1##_type, p2##_type, \
1697
+ p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1698
+ p3##_type p3) {\
1699
+ return name##ActionP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, p1, \
1700
+ p2, p3);\
1701
+ }\
1702
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1703
+ typename p3##_type>\
1704
+ template <typename F>\
1705
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1706
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1707
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1708
+ typename arg9_type>\
1709
+ typename ::testing::internal::Function<F>::Result\
1710
+ name##ActionP4<p0##_type, p1##_type, p2##_type, \
1711
+ p3##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1712
+ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1713
+
1714
+ #define ACTION_P5(name, p0, p1, p2, p3, p4)\
1715
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1716
+ typename p3##_type, typename p4##_type>\
1717
+ class name##ActionP5 {\
1718
+ public:\
1719
+ name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \
1720
+ p2##_type gmock_p2, p3##_type gmock_p3, \
1721
+ p4##_type gmock_p4) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1722
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1723
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1724
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1725
+ p4(::testing::internal::forward<p4##_type>(gmock_p4)) {}\
1726
+ template <typename F>\
1727
+ class gmock_Impl : public ::testing::ActionInterface<F> {\
1728
+ public:\
1729
+ typedef F function_type;\
1730
+ typedef typename ::testing::internal::Function<F>::Result return_type;\
1731
+ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1732
+ args_type;\
1733
+ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1734
+ p3##_type gmock_p3, \
1735
+ p4##_type gmock_p4) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1736
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1737
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1738
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1739
+ p4(::testing::internal::forward<p4##_type>(gmock_p4)) {}\
1740
+ virtual return_type Perform(const args_type& args) {\
1741
+ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1742
+ Perform(this, args);\
1743
+ }\
1744
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1745
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1746
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1747
+ typename arg9_type>\
1748
+ return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1749
+ arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1750
+ arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1751
+ arg9_type arg9) const;\
1752
+ p0##_type p0;\
1753
+ p1##_type p1;\
1754
+ p2##_type p2;\
1755
+ p3##_type p3;\
1756
+ p4##_type p4;\
1757
+ private:\
1758
+ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1759
+ };\
1760
+ template <typename F> operator ::testing::Action<F>() const {\
1761
+ return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4));\
1762
+ }\
1763
+ p0##_type p0;\
1764
+ p1##_type p1;\
1765
+ p2##_type p2;\
1766
+ p3##_type p3;\
1767
+ p4##_type p4;\
1768
+ private:\
1769
+ GTEST_DISALLOW_ASSIGN_(name##ActionP5);\
1770
+ };\
1771
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1772
+ typename p3##_type, typename p4##_type>\
1773
+ inline name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1774
+ p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
1775
+ p4##_type p4) {\
1776
+ return name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1777
+ p4##_type>(p0, p1, p2, p3, p4);\
1778
+ }\
1779
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1780
+ typename p3##_type, typename p4##_type>\
1781
+ template <typename F>\
1782
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1783
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1784
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1785
+ typename arg9_type>\
1786
+ typename ::testing::internal::Function<F>::Result\
1787
+ name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
1788
+ p4##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1789
+ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1790
+
1791
+ #define ACTION_P6(name, p0, p1, p2, p3, p4, p5)\
1792
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1793
+ typename p3##_type, typename p4##_type, typename p5##_type>\
1794
+ class name##ActionP6 {\
1795
+ public:\
1796
+ name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \
1797
+ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1798
+ p5##_type gmock_p5) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1799
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1800
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1801
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1802
+ p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
1803
+ p5(::testing::internal::forward<p5##_type>(gmock_p5)) {}\
1804
+ template <typename F>\
1805
+ class gmock_Impl : public ::testing::ActionInterface<F> {\
1806
+ public:\
1807
+ typedef F function_type;\
1808
+ typedef typename ::testing::internal::Function<F>::Result return_type;\
1809
+ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1810
+ args_type;\
1811
+ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1812
+ p3##_type gmock_p3, p4##_type gmock_p4, \
1813
+ p5##_type gmock_p5) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1814
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1815
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1816
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1817
+ p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
1818
+ p5(::testing::internal::forward<p5##_type>(gmock_p5)) {}\
1819
+ virtual return_type Perform(const args_type& args) {\
1820
+ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1821
+ Perform(this, args);\
1822
+ }\
1823
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1824
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1825
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1826
+ typename arg9_type>\
1827
+ return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1828
+ arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1829
+ arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1830
+ arg9_type arg9) const;\
1831
+ p0##_type p0;\
1832
+ p1##_type p1;\
1833
+ p2##_type p2;\
1834
+ p3##_type p3;\
1835
+ p4##_type p4;\
1836
+ p5##_type p5;\
1837
+ private:\
1838
+ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1839
+ };\
1840
+ template <typename F> operator ::testing::Action<F>() const {\
1841
+ return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5));\
1842
+ }\
1843
+ p0##_type p0;\
1844
+ p1##_type p1;\
1845
+ p2##_type p2;\
1846
+ p3##_type p3;\
1847
+ p4##_type p4;\
1848
+ p5##_type p5;\
1849
+ private:\
1850
+ GTEST_DISALLOW_ASSIGN_(name##ActionP6);\
1851
+ };\
1852
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1853
+ typename p3##_type, typename p4##_type, typename p5##_type>\
1854
+ inline name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1855
+ p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
1856
+ p3##_type p3, p4##_type p4, p5##_type p5) {\
1857
+ return name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
1858
+ p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
1859
+ }\
1860
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1861
+ typename p3##_type, typename p4##_type, typename p5##_type>\
1862
+ template <typename F>\
1863
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1864
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1865
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1866
+ typename arg9_type>\
1867
+ typename ::testing::internal::Function<F>::Result\
1868
+ name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1869
+ p5##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1870
+ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1871
+
1872
+ #define ACTION_P7(name, p0, p1, p2, p3, p4, p5, p6)\
1873
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1874
+ typename p3##_type, typename p4##_type, typename p5##_type, \
1875
+ typename p6##_type>\
1876
+ class name##ActionP7 {\
1877
+ public:\
1878
+ name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \
1879
+ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1880
+ p5##_type gmock_p5, \
1881
+ p6##_type gmock_p6) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1882
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1883
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1884
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1885
+ p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
1886
+ p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
1887
+ p6(::testing::internal::forward<p6##_type>(gmock_p6)) {}\
1888
+ template <typename F>\
1889
+ class gmock_Impl : public ::testing::ActionInterface<F> {\
1890
+ public:\
1891
+ typedef F function_type;\
1892
+ typedef typename ::testing::internal::Function<F>::Result return_type;\
1893
+ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1894
+ args_type;\
1895
+ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1896
+ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1897
+ p6##_type gmock_p6) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1898
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1899
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1900
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1901
+ p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
1902
+ p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
1903
+ p6(::testing::internal::forward<p6##_type>(gmock_p6)) {}\
1904
+ virtual return_type Perform(const args_type& args) {\
1905
+ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
1906
+ Perform(this, args);\
1907
+ }\
1908
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1909
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1910
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1911
+ typename arg9_type>\
1912
+ return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
1913
+ arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
1914
+ arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
1915
+ arg9_type arg9) const;\
1916
+ p0##_type p0;\
1917
+ p1##_type p1;\
1918
+ p2##_type p2;\
1919
+ p3##_type p3;\
1920
+ p4##_type p4;\
1921
+ p5##_type p5;\
1922
+ p6##_type p6;\
1923
+ private:\
1924
+ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
1925
+ };\
1926
+ template <typename F> operator ::testing::Action<F>() const {\
1927
+ return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
1928
+ p6));\
1929
+ }\
1930
+ p0##_type p0;\
1931
+ p1##_type p1;\
1932
+ p2##_type p2;\
1933
+ p3##_type p3;\
1934
+ p4##_type p4;\
1935
+ p5##_type p5;\
1936
+ p6##_type p6;\
1937
+ private:\
1938
+ GTEST_DISALLOW_ASSIGN_(name##ActionP7);\
1939
+ };\
1940
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1941
+ typename p3##_type, typename p4##_type, typename p5##_type, \
1942
+ typename p6##_type>\
1943
+ inline name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
1944
+ p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
1945
+ p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
1946
+ p6##_type p6) {\
1947
+ return name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
1948
+ p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
1949
+ }\
1950
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1951
+ typename p3##_type, typename p4##_type, typename p5##_type, \
1952
+ typename p6##_type>\
1953
+ template <typename F>\
1954
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
1955
+ typename arg3_type, typename arg4_type, typename arg5_type, \
1956
+ typename arg6_type, typename arg7_type, typename arg8_type, \
1957
+ typename arg9_type>\
1958
+ typename ::testing::internal::Function<F>::Result\
1959
+ name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
1960
+ p5##_type, p6##_type>::gmock_Impl<F>::gmock_PerformImpl(\
1961
+ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
1962
+
1963
+ #define ACTION_P8(name, p0, p1, p2, p3, p4, p5, p6, p7)\
1964
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
1965
+ typename p3##_type, typename p4##_type, typename p5##_type, \
1966
+ typename p6##_type, typename p7##_type>\
1967
+ class name##ActionP8 {\
1968
+ public:\
1969
+ name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \
1970
+ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
1971
+ p5##_type gmock_p5, p6##_type gmock_p6, \
1972
+ p7##_type gmock_p7) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1973
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1974
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1975
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1976
+ p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
1977
+ p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
1978
+ p6(::testing::internal::forward<p6##_type>(gmock_p6)), \
1979
+ p7(::testing::internal::forward<p7##_type>(gmock_p7)) {}\
1980
+ template <typename F>\
1981
+ class gmock_Impl : public ::testing::ActionInterface<F> {\
1982
+ public:\
1983
+ typedef F function_type;\
1984
+ typedef typename ::testing::internal::Function<F>::Result return_type;\
1985
+ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
1986
+ args_type;\
1987
+ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
1988
+ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
1989
+ p6##_type gmock_p6, \
1990
+ p7##_type gmock_p7) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
1991
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
1992
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
1993
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
1994
+ p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
1995
+ p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
1996
+ p6(::testing::internal::forward<p6##_type>(gmock_p6)), \
1997
+ p7(::testing::internal::forward<p7##_type>(gmock_p7)) {}\
1998
+ virtual return_type Perform(const args_type& args) {\
1999
+ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
2000
+ Perform(this, args);\
2001
+ }\
2002
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
2003
+ typename arg3_type, typename arg4_type, typename arg5_type, \
2004
+ typename arg6_type, typename arg7_type, typename arg8_type, \
2005
+ typename arg9_type>\
2006
+ return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
2007
+ arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
2008
+ arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
2009
+ arg9_type arg9) const;\
2010
+ p0##_type p0;\
2011
+ p1##_type p1;\
2012
+ p2##_type p2;\
2013
+ p3##_type p3;\
2014
+ p4##_type p4;\
2015
+ p5##_type p5;\
2016
+ p6##_type p6;\
2017
+ p7##_type p7;\
2018
+ private:\
2019
+ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
2020
+ };\
2021
+ template <typename F> operator ::testing::Action<F>() const {\
2022
+ return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
2023
+ p6, p7));\
2024
+ }\
2025
+ p0##_type p0;\
2026
+ p1##_type p1;\
2027
+ p2##_type p2;\
2028
+ p3##_type p3;\
2029
+ p4##_type p4;\
2030
+ p5##_type p5;\
2031
+ p6##_type p6;\
2032
+ p7##_type p7;\
2033
+ private:\
2034
+ GTEST_DISALLOW_ASSIGN_(name##ActionP8);\
2035
+ };\
2036
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
2037
+ typename p3##_type, typename p4##_type, typename p5##_type, \
2038
+ typename p6##_type, typename p7##_type>\
2039
+ inline name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
2040
+ p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
2041
+ p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
2042
+ p6##_type p6, p7##_type p7) {\
2043
+ return name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
2044
+ p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
2045
+ p6, p7);\
2046
+ }\
2047
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
2048
+ typename p3##_type, typename p4##_type, typename p5##_type, \
2049
+ typename p6##_type, typename p7##_type>\
2050
+ template <typename F>\
2051
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
2052
+ typename arg3_type, typename arg4_type, typename arg5_type, \
2053
+ typename arg6_type, typename arg7_type, typename arg8_type, \
2054
+ typename arg9_type>\
2055
+ typename ::testing::internal::Function<F>::Result\
2056
+ name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
2057
+ p5##_type, p6##_type, \
2058
+ p7##_type>::gmock_Impl<F>::gmock_PerformImpl(\
2059
+ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
2060
+
2061
+ #define ACTION_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8)\
2062
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
2063
+ typename p3##_type, typename p4##_type, typename p5##_type, \
2064
+ typename p6##_type, typename p7##_type, typename p8##_type>\
2065
+ class name##ActionP9 {\
2066
+ public:\
2067
+ name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \
2068
+ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
2069
+ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
2070
+ p8##_type gmock_p8) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
2071
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
2072
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
2073
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
2074
+ p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
2075
+ p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
2076
+ p6(::testing::internal::forward<p6##_type>(gmock_p6)), \
2077
+ p7(::testing::internal::forward<p7##_type>(gmock_p7)), \
2078
+ p8(::testing::internal::forward<p8##_type>(gmock_p8)) {}\
2079
+ template <typename F>\
2080
+ class gmock_Impl : public ::testing::ActionInterface<F> {\
2081
+ public:\
2082
+ typedef F function_type;\
2083
+ typedef typename ::testing::internal::Function<F>::Result return_type;\
2084
+ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
2085
+ args_type;\
2086
+ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
2087
+ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
2088
+ p6##_type gmock_p6, p7##_type gmock_p7, \
2089
+ p8##_type gmock_p8) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
2090
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
2091
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
2092
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
2093
+ p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
2094
+ p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
2095
+ p6(::testing::internal::forward<p6##_type>(gmock_p6)), \
2096
+ p7(::testing::internal::forward<p7##_type>(gmock_p7)), \
2097
+ p8(::testing::internal::forward<p8##_type>(gmock_p8)) {}\
2098
+ virtual return_type Perform(const args_type& args) {\
2099
+ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
2100
+ Perform(this, args);\
2101
+ }\
2102
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
2103
+ typename arg3_type, typename arg4_type, typename arg5_type, \
2104
+ typename arg6_type, typename arg7_type, typename arg8_type, \
2105
+ typename arg9_type>\
2106
+ return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
2107
+ arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
2108
+ arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
2109
+ arg9_type arg9) const;\
2110
+ p0##_type p0;\
2111
+ p1##_type p1;\
2112
+ p2##_type p2;\
2113
+ p3##_type p3;\
2114
+ p4##_type p4;\
2115
+ p5##_type p5;\
2116
+ p6##_type p6;\
2117
+ p7##_type p7;\
2118
+ p8##_type p8;\
2119
+ private:\
2120
+ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
2121
+ };\
2122
+ template <typename F> operator ::testing::Action<F>() const {\
2123
+ return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
2124
+ p6, p7, p8));\
2125
+ }\
2126
+ p0##_type p0;\
2127
+ p1##_type p1;\
2128
+ p2##_type p2;\
2129
+ p3##_type p3;\
2130
+ p4##_type p4;\
2131
+ p5##_type p5;\
2132
+ p6##_type p6;\
2133
+ p7##_type p7;\
2134
+ p8##_type p8;\
2135
+ private:\
2136
+ GTEST_DISALLOW_ASSIGN_(name##ActionP9);\
2137
+ };\
2138
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
2139
+ typename p3##_type, typename p4##_type, typename p5##_type, \
2140
+ typename p6##_type, typename p7##_type, typename p8##_type>\
2141
+ inline name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
2142
+ p4##_type, p5##_type, p6##_type, p7##_type, \
2143
+ p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
2144
+ p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
2145
+ p8##_type p8) {\
2146
+ return name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
2147
+ p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
2148
+ p3, p4, p5, p6, p7, p8);\
2149
+ }\
2150
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
2151
+ typename p3##_type, typename p4##_type, typename p5##_type, \
2152
+ typename p6##_type, typename p7##_type, typename p8##_type>\
2153
+ template <typename F>\
2154
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
2155
+ typename arg3_type, typename arg4_type, typename arg5_type, \
2156
+ typename arg6_type, typename arg7_type, typename arg8_type, \
2157
+ typename arg9_type>\
2158
+ typename ::testing::internal::Function<F>::Result\
2159
+ name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
2160
+ p5##_type, p6##_type, p7##_type, \
2161
+ p8##_type>::gmock_Impl<F>::gmock_PerformImpl(\
2162
+ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
2163
+
2164
+ #define ACTION_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)\
2165
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
2166
+ typename p3##_type, typename p4##_type, typename p5##_type, \
2167
+ typename p6##_type, typename p7##_type, typename p8##_type, \
2168
+ typename p9##_type>\
2169
+ class name##ActionP10 {\
2170
+ public:\
2171
+ name##ActionP10(p0##_type gmock_p0, p1##_type gmock_p1, \
2172
+ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
2173
+ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
2174
+ p8##_type gmock_p8, \
2175
+ p9##_type gmock_p9) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
2176
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
2177
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
2178
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
2179
+ p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
2180
+ p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
2181
+ p6(::testing::internal::forward<p6##_type>(gmock_p6)), \
2182
+ p7(::testing::internal::forward<p7##_type>(gmock_p7)), \
2183
+ p8(::testing::internal::forward<p8##_type>(gmock_p8)), \
2184
+ p9(::testing::internal::forward<p9##_type>(gmock_p9)) {}\
2185
+ template <typename F>\
2186
+ class gmock_Impl : public ::testing::ActionInterface<F> {\
2187
+ public:\
2188
+ typedef F function_type;\
2189
+ typedef typename ::testing::internal::Function<F>::Result return_type;\
2190
+ typedef typename ::testing::internal::Function<F>::ArgumentTuple\
2191
+ args_type;\
2192
+ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
2193
+ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
2194
+ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
2195
+ p9##_type gmock_p9) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \
2196
+ p1(::testing::internal::forward<p1##_type>(gmock_p1)), \
2197
+ p2(::testing::internal::forward<p2##_type>(gmock_p2)), \
2198
+ p3(::testing::internal::forward<p3##_type>(gmock_p3)), \
2199
+ p4(::testing::internal::forward<p4##_type>(gmock_p4)), \
2200
+ p5(::testing::internal::forward<p5##_type>(gmock_p5)), \
2201
+ p6(::testing::internal::forward<p6##_type>(gmock_p6)), \
2202
+ p7(::testing::internal::forward<p7##_type>(gmock_p7)), \
2203
+ p8(::testing::internal::forward<p8##_type>(gmock_p8)), \
2204
+ p9(::testing::internal::forward<p9##_type>(gmock_p9)) {}\
2205
+ virtual return_type Perform(const args_type& args) {\
2206
+ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
2207
+ Perform(this, args);\
2208
+ }\
2209
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
2210
+ typename arg3_type, typename arg4_type, typename arg5_type, \
2211
+ typename arg6_type, typename arg7_type, typename arg8_type, \
2212
+ typename arg9_type>\
2213
+ return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
2214
+ arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
2215
+ arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
2216
+ arg9_type arg9) const;\
2217
+ p0##_type p0;\
2218
+ p1##_type p1;\
2219
+ p2##_type p2;\
2220
+ p3##_type p3;\
2221
+ p4##_type p4;\
2222
+ p5##_type p5;\
2223
+ p6##_type p6;\
2224
+ p7##_type p7;\
2225
+ p8##_type p8;\
2226
+ p9##_type p9;\
2227
+ private:\
2228
+ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
2229
+ };\
2230
+ template <typename F> operator ::testing::Action<F>() const {\
2231
+ return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
2232
+ p6, p7, p8, p9));\
2233
+ }\
2234
+ p0##_type p0;\
2235
+ p1##_type p1;\
2236
+ p2##_type p2;\
2237
+ p3##_type p3;\
2238
+ p4##_type p4;\
2239
+ p5##_type p5;\
2240
+ p6##_type p6;\
2241
+ p7##_type p7;\
2242
+ p8##_type p8;\
2243
+ p9##_type p9;\
2244
+ private:\
2245
+ GTEST_DISALLOW_ASSIGN_(name##ActionP10);\
2246
+ };\
2247
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
2248
+ typename p3##_type, typename p4##_type, typename p5##_type, \
2249
+ typename p6##_type, typename p7##_type, typename p8##_type, \
2250
+ typename p9##_type>\
2251
+ inline name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2252
+ p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
2253
+ p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
2254
+ p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
2255
+ p9##_type p9) {\
2256
+ return name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
2257
+ p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
2258
+ p1, p2, p3, p4, p5, p6, p7, p8, p9);\
2259
+ }\
2260
+ template <typename p0##_type, typename p1##_type, typename p2##_type, \
2261
+ typename p3##_type, typename p4##_type, typename p5##_type, \
2262
+ typename p6##_type, typename p7##_type, typename p8##_type, \
2263
+ typename p9##_type>\
2264
+ template <typename F>\
2265
+ template <typename arg0_type, typename arg1_type, typename arg2_type, \
2266
+ typename arg3_type, typename arg4_type, typename arg5_type, \
2267
+ typename arg6_type, typename arg7_type, typename arg8_type, \
2268
+ typename arg9_type>\
2269
+ typename ::testing::internal::Function<F>::Result\
2270
+ name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
2271
+ p5##_type, p6##_type, p7##_type, p8##_type, \
2272
+ p9##_type>::gmock_Impl<F>::gmock_PerformImpl(\
2273
+ GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
2274
+
2275
+ namespace testing {
2276
+
2277
+
2278
+ // The ACTION*() macros trigger warning C4100 (unreferenced formal
2279
+ // parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
2280
+ // the macro definition, as the warnings are generated when the macro
2281
+ // is expanded and macro expansion cannot contain #pragma. Therefore
2282
+ // we suppress them here.
2283
+ #ifdef _MSC_VER
2284
+ # pragma warning(push)
2285
+ # pragma warning(disable:4100)
2286
+ #endif
2287
+
2288
+ // Various overloads for InvokeArgument<N>().
2289
+ //
2290
+ // The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th
2291
+ // (0-based) argument, which must be a k-ary callable, of the mock
2292
+ // function, with arguments a1, a2, ..., a_k.
2293
+ //
2294
+ // Notes:
2295
+ //
2296
+ // 1. The arguments are passed by value by default. If you need to
2297
+ // pass an argument by reference, wrap it inside ByRef(). For
2298
+ // example,
2299
+ //
2300
+ // InvokeArgument<1>(5, string("Hello"), ByRef(foo))
2301
+ //
2302
+ // passes 5 and string("Hello") by value, and passes foo by
2303
+ // reference.
2304
+ //
2305
+ // 2. If the callable takes an argument by reference but ByRef() is
2306
+ // not used, it will receive the reference to a copy of the value,
2307
+ // instead of the original value. For example, when the 0-th
2308
+ // argument of the mock function takes a const string&, the action
2309
+ //
2310
+ // InvokeArgument<0>(string("Hello"))
2311
+ //
2312
+ // makes a copy of the temporary string("Hello") object and passes a
2313
+ // reference of the copy, instead of the original temporary object,
2314
+ // to the callable. This makes it easy for a user to define an
2315
+ // InvokeArgument action from temporary values and have it performed
2316
+ // later.
2317
+
2318
+ namespace internal {
2319
+ namespace invoke_argument {
2320
+
2321
+ // Appears in InvokeArgumentAdl's argument list to help avoid
2322
+ // accidental calls to user functions of the same name.
2323
+ struct AdlTag {};
2324
+
2325
+ // InvokeArgumentAdl - a helper for InvokeArgument.
2326
+ // The basic overloads are provided here for generic functors.
2327
+ // Overloads for other custom-callables are provided in the
2328
+ // internal/custom/callback-actions.h header.
2329
+
2330
+ template <typename R, typename F>
2331
+ R InvokeArgumentAdl(AdlTag, F f) {
2332
+ return f();
2333
+ }
2334
+ template <typename R, typename F, typename A1>
2335
+ R InvokeArgumentAdl(AdlTag, F f, A1 a1) {
2336
+ return f(a1);
2337
+ }
2338
+ template <typename R, typename F, typename A1, typename A2>
2339
+ R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2) {
2340
+ return f(a1, a2);
2341
+ }
2342
+ template <typename R, typename F, typename A1, typename A2, typename A3>
2343
+ R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3) {
2344
+ return f(a1, a2, a3);
2345
+ }
2346
+ template <typename R, typename F, typename A1, typename A2, typename A3,
2347
+ typename A4>
2348
+ R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4) {
2349
+ return f(a1, a2, a3, a4);
2350
+ }
2351
+ template <typename R, typename F, typename A1, typename A2, typename A3,
2352
+ typename A4, typename A5>
2353
+ R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
2354
+ return f(a1, a2, a3, a4, a5);
2355
+ }
2356
+ template <typename R, typename F, typename A1, typename A2, typename A3,
2357
+ typename A4, typename A5, typename A6>
2358
+ R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
2359
+ return f(a1, a2, a3, a4, a5, a6);
2360
+ }
2361
+ template <typename R, typename F, typename A1, typename A2, typename A3,
2362
+ typename A4, typename A5, typename A6, typename A7>
2363
+ R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
2364
+ A7 a7) {
2365
+ return f(a1, a2, a3, a4, a5, a6, a7);
2366
+ }
2367
+ template <typename R, typename F, typename A1, typename A2, typename A3,
2368
+ typename A4, typename A5, typename A6, typename A7, typename A8>
2369
+ R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
2370
+ A7 a7, A8 a8) {
2371
+ return f(a1, a2, a3, a4, a5, a6, a7, a8);
2372
+ }
2373
+ template <typename R, typename F, typename A1, typename A2, typename A3,
2374
+ typename A4, typename A5, typename A6, typename A7, typename A8,
2375
+ typename A9>
2376
+ R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
2377
+ A7 a7, A8 a8, A9 a9) {
2378
+ return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
2379
+ }
2380
+ template <typename R, typename F, typename A1, typename A2, typename A3,
2381
+ typename A4, typename A5, typename A6, typename A7, typename A8,
2382
+ typename A9, typename A10>
2383
+ R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
2384
+ A7 a7, A8 a8, A9 a9, A10 a10) {
2385
+ return f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
2386
+ }
2387
+ } // namespace invoke_argument
2388
+ } // namespace internal
2389
+
2390
+ ACTION_TEMPLATE(InvokeArgument,
2391
+ HAS_1_TEMPLATE_PARAMS(int, k),
2392
+ AND_0_VALUE_PARAMS()) {
2393
+ using internal::invoke_argument::InvokeArgumentAdl;
2394
+ return InvokeArgumentAdl<return_type>(
2395
+ internal::invoke_argument::AdlTag(),
2396
+ ::testing::get<k>(args));
2397
+ }
2398
+
2399
+ ACTION_TEMPLATE(InvokeArgument,
2400
+ HAS_1_TEMPLATE_PARAMS(int, k),
2401
+ AND_1_VALUE_PARAMS(p0)) {
2402
+ using internal::invoke_argument::InvokeArgumentAdl;
2403
+ return InvokeArgumentAdl<return_type>(
2404
+ internal::invoke_argument::AdlTag(),
2405
+ ::testing::get<k>(args), p0);
2406
+ }
2407
+
2408
+ ACTION_TEMPLATE(InvokeArgument,
2409
+ HAS_1_TEMPLATE_PARAMS(int, k),
2410
+ AND_2_VALUE_PARAMS(p0, p1)) {
2411
+ using internal::invoke_argument::InvokeArgumentAdl;
2412
+ return InvokeArgumentAdl<return_type>(
2413
+ internal::invoke_argument::AdlTag(),
2414
+ ::testing::get<k>(args), p0, p1);
2415
+ }
2416
+
2417
+ ACTION_TEMPLATE(InvokeArgument,
2418
+ HAS_1_TEMPLATE_PARAMS(int, k),
2419
+ AND_3_VALUE_PARAMS(p0, p1, p2)) {
2420
+ using internal::invoke_argument::InvokeArgumentAdl;
2421
+ return InvokeArgumentAdl<return_type>(
2422
+ internal::invoke_argument::AdlTag(),
2423
+ ::testing::get<k>(args), p0, p1, p2);
2424
+ }
2425
+
2426
+ ACTION_TEMPLATE(InvokeArgument,
2427
+ HAS_1_TEMPLATE_PARAMS(int, k),
2428
+ AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
2429
+ using internal::invoke_argument::InvokeArgumentAdl;
2430
+ return InvokeArgumentAdl<return_type>(
2431
+ internal::invoke_argument::AdlTag(),
2432
+ ::testing::get<k>(args), p0, p1, p2, p3);
2433
+ }
2434
+
2435
+ ACTION_TEMPLATE(InvokeArgument,
2436
+ HAS_1_TEMPLATE_PARAMS(int, k),
2437
+ AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
2438
+ using internal::invoke_argument::InvokeArgumentAdl;
2439
+ return InvokeArgumentAdl<return_type>(
2440
+ internal::invoke_argument::AdlTag(),
2441
+ ::testing::get<k>(args), p0, p1, p2, p3, p4);
2442
+ }
2443
+
2444
+ ACTION_TEMPLATE(InvokeArgument,
2445
+ HAS_1_TEMPLATE_PARAMS(int, k),
2446
+ AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
2447
+ using internal::invoke_argument::InvokeArgumentAdl;
2448
+ return InvokeArgumentAdl<return_type>(
2449
+ internal::invoke_argument::AdlTag(),
2450
+ ::testing::get<k>(args), p0, p1, p2, p3, p4, p5);
2451
+ }
2452
+
2453
+ ACTION_TEMPLATE(InvokeArgument,
2454
+ HAS_1_TEMPLATE_PARAMS(int, k),
2455
+ AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
2456
+ using internal::invoke_argument::InvokeArgumentAdl;
2457
+ return InvokeArgumentAdl<return_type>(
2458
+ internal::invoke_argument::AdlTag(),
2459
+ ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6);
2460
+ }
2461
+
2462
+ ACTION_TEMPLATE(InvokeArgument,
2463
+ HAS_1_TEMPLATE_PARAMS(int, k),
2464
+ AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
2465
+ using internal::invoke_argument::InvokeArgumentAdl;
2466
+ return InvokeArgumentAdl<return_type>(
2467
+ internal::invoke_argument::AdlTag(),
2468
+ ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7);
2469
+ }
2470
+
2471
+ ACTION_TEMPLATE(InvokeArgument,
2472
+ HAS_1_TEMPLATE_PARAMS(int, k),
2473
+ AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
2474
+ using internal::invoke_argument::InvokeArgumentAdl;
2475
+ return InvokeArgumentAdl<return_type>(
2476
+ internal::invoke_argument::AdlTag(),
2477
+ ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8);
2478
+ }
2479
+
2480
+ ACTION_TEMPLATE(InvokeArgument,
2481
+ HAS_1_TEMPLATE_PARAMS(int, k),
2482
+ AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
2483
+ using internal::invoke_argument::InvokeArgumentAdl;
2484
+ return InvokeArgumentAdl<return_type>(
2485
+ internal::invoke_argument::AdlTag(),
2486
+ ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2487
+ }
2488
+
2489
+ // Various overloads for ReturnNew<T>().
2490
+ //
2491
+ // The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
2492
+ // instance of type T, constructed on the heap with constructor arguments
2493
+ // a1, a2, ..., and a_k. The caller assumes ownership of the returned value.
2494
+ ACTION_TEMPLATE(ReturnNew,
2495
+ HAS_1_TEMPLATE_PARAMS(typename, T),
2496
+ AND_0_VALUE_PARAMS()) {
2497
+ return new T();
2498
+ }
2499
+
2500
+ ACTION_TEMPLATE(ReturnNew,
2501
+ HAS_1_TEMPLATE_PARAMS(typename, T),
2502
+ AND_1_VALUE_PARAMS(p0)) {
2503
+ return new T(p0);
2504
+ }
2505
+
2506
+ ACTION_TEMPLATE(ReturnNew,
2507
+ HAS_1_TEMPLATE_PARAMS(typename, T),
2508
+ AND_2_VALUE_PARAMS(p0, p1)) {
2509
+ return new T(p0, p1);
2510
+ }
2511
+
2512
+ ACTION_TEMPLATE(ReturnNew,
2513
+ HAS_1_TEMPLATE_PARAMS(typename, T),
2514
+ AND_3_VALUE_PARAMS(p0, p1, p2)) {
2515
+ return new T(p0, p1, p2);
2516
+ }
2517
+
2518
+ ACTION_TEMPLATE(ReturnNew,
2519
+ HAS_1_TEMPLATE_PARAMS(typename, T),
2520
+ AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
2521
+ return new T(p0, p1, p2, p3);
2522
+ }
2523
+
2524
+ ACTION_TEMPLATE(ReturnNew,
2525
+ HAS_1_TEMPLATE_PARAMS(typename, T),
2526
+ AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
2527
+ return new T(p0, p1, p2, p3, p4);
2528
+ }
2529
+
2530
+ ACTION_TEMPLATE(ReturnNew,
2531
+ HAS_1_TEMPLATE_PARAMS(typename, T),
2532
+ AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
2533
+ return new T(p0, p1, p2, p3, p4, p5);
2534
+ }
2535
+
2536
+ ACTION_TEMPLATE(ReturnNew,
2537
+ HAS_1_TEMPLATE_PARAMS(typename, T),
2538
+ AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
2539
+ return new T(p0, p1, p2, p3, p4, p5, p6);
2540
+ }
2541
+
2542
+ ACTION_TEMPLATE(ReturnNew,
2543
+ HAS_1_TEMPLATE_PARAMS(typename, T),
2544
+ AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
2545
+ return new T(p0, p1, p2, p3, p4, p5, p6, p7);
2546
+ }
2547
+
2548
+ ACTION_TEMPLATE(ReturnNew,
2549
+ HAS_1_TEMPLATE_PARAMS(typename, T),
2550
+ AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
2551
+ return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8);
2552
+ }
2553
+
2554
+ ACTION_TEMPLATE(ReturnNew,
2555
+ HAS_1_TEMPLATE_PARAMS(typename, T),
2556
+ AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
2557
+ return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2558
+ }
2559
+
2560
+ #ifdef _MSC_VER
2561
+ # pragma warning(pop)
2562
+ #endif
2563
+
2564
+ } // namespace testing
2565
+
2566
+ // Include any custom callback actions added by the local installation.
2567
+ // We must include this header at the end to make sure it can use the
2568
+ // declarations from this file.
2569
+ #include "gmock/internal/custom/gmock-generated-actions.h"
2570
+
2571
+ #endif // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_