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,19 @@
1
+ As any non-trivial software system, Google Mock has some known limitations and problems. We are working on improving it, and welcome your help! The follow is a list of issues we know about.
2
+
3
+
4
+
5
+ ## README contains outdated information on Google Mock's compatibility with other testing frameworks ##
6
+
7
+ The `README` file in release 1.1.0 still says that Google Mock only works with Google Test. Actually, you can configure Google Mock to work with any testing framework you choose.
8
+
9
+ ## Tests failing on machines using Power PC CPUs (e.g. some Macs) ##
10
+
11
+ `gmock_output_test` and `gmock-printers_test` are known to fail with Power PC CPUs. This is due to portability issues with these tests, and is not an indication of problems in Google Mock itself. You can safely ignore them.
12
+
13
+ ## Failed to resolve libgtest.so.0 in tests when built against installed Google Test ##
14
+
15
+ This only applies if you manually built and installed Google Test, and then built a Google Mock against it (either explicitly, or because gtest-config was in your path post-install). In this situation, Libtool has a known issue with certain systems' ldconfig setup:
16
+
17
+ http://article.gmane.org/gmane.comp.sysutils.automake.general/9025
18
+
19
+ This requires a manual run of "sudo ldconfig" after the "sudo make install" for Google Test before any binaries which link against it can be executed. This isn't a bug in our install, but we should at least have documented it or hacked a work-around into our install. We should have one of these solutions in our next release.
@@ -0,0 +1,1262 @@
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 actions.
35
+
36
+ #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
37
+ #define GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
38
+
39
+ #ifndef _WIN32_WCE
40
+ # include <errno.h>
41
+ #endif
42
+
43
+ #include <algorithm>
44
+ #include <string>
45
+
46
+ #include "gmock/internal/gmock-internal-utils.h"
47
+ #include "gmock/internal/gmock-port.h"
48
+
49
+ #if GTEST_LANG_CXX11 // Defined by gtest-port.h via gmock-port.h.
50
+ #include <functional>
51
+ #include <type_traits>
52
+ #endif // GTEST_LANG_CXX11
53
+
54
+ namespace testing {
55
+
56
+ // To implement an action Foo, define:
57
+ // 1. a class FooAction that implements the ActionInterface interface, and
58
+ // 2. a factory function that creates an Action object from a
59
+ // const FooAction*.
60
+ //
61
+ // The two-level delegation design follows that of Matcher, providing
62
+ // consistency for extension developers. It also eases ownership
63
+ // management as Action objects can now be copied like plain values.
64
+
65
+ namespace internal {
66
+
67
+ template <typename F1, typename F2>
68
+ class ActionAdaptor;
69
+
70
+ // BuiltInDefaultValueGetter<T, true>::Get() returns a
71
+ // default-constructed T value. BuiltInDefaultValueGetter<T,
72
+ // false>::Get() crashes with an error.
73
+ //
74
+ // This primary template is used when kDefaultConstructible is true.
75
+ template <typename T, bool kDefaultConstructible>
76
+ struct BuiltInDefaultValueGetter {
77
+ static T Get() { return T(); }
78
+ };
79
+ template <typename T>
80
+ struct BuiltInDefaultValueGetter<T, false> {
81
+ static T Get() {
82
+ Assert(false, __FILE__, __LINE__,
83
+ "Default action undefined for the function return type.");
84
+ return internal::Invalid<T>();
85
+ // The above statement will never be reached, but is required in
86
+ // order for this function to compile.
87
+ }
88
+ };
89
+
90
+ // BuiltInDefaultValue<T>::Get() returns the "built-in" default value
91
+ // for type T, which is NULL when T is a raw pointer type, 0 when T is
92
+ // a numeric type, false when T is bool, or "" when T is string or
93
+ // std::string. In addition, in C++11 and above, it turns a
94
+ // default-constructed T value if T is default constructible. For any
95
+ // other type T, the built-in default T value is undefined, and the
96
+ // function will abort the process.
97
+ template <typename T>
98
+ class BuiltInDefaultValue {
99
+ public:
100
+ #if GTEST_LANG_CXX11
101
+ // This function returns true iff type T has a built-in default value.
102
+ static bool Exists() {
103
+ return ::std::is_default_constructible<T>::value;
104
+ }
105
+
106
+ static T Get() {
107
+ return BuiltInDefaultValueGetter<
108
+ T, ::std::is_default_constructible<T>::value>::Get();
109
+ }
110
+
111
+ #else // GTEST_LANG_CXX11
112
+ // This function returns true iff type T has a built-in default value.
113
+ static bool Exists() {
114
+ return false;
115
+ }
116
+
117
+ static T Get() {
118
+ return BuiltInDefaultValueGetter<T, false>::Get();
119
+ }
120
+
121
+ #endif // GTEST_LANG_CXX11
122
+ };
123
+
124
+ // This partial specialization says that we use the same built-in
125
+ // default value for T and const T.
126
+ template <typename T>
127
+ class BuiltInDefaultValue<const T> {
128
+ public:
129
+ static bool Exists() { return BuiltInDefaultValue<T>::Exists(); }
130
+ static T Get() { return BuiltInDefaultValue<T>::Get(); }
131
+ };
132
+
133
+ // This partial specialization defines the default values for pointer
134
+ // types.
135
+ template <typename T>
136
+ class BuiltInDefaultValue<T*> {
137
+ public:
138
+ static bool Exists() { return true; }
139
+ static T* Get() { return NULL; }
140
+ };
141
+
142
+ // The following specializations define the default values for
143
+ // specific types we care about.
144
+ #define GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(type, value) \
145
+ template <> \
146
+ class BuiltInDefaultValue<type> { \
147
+ public: \
148
+ static bool Exists() { return true; } \
149
+ static type Get() { return value; } \
150
+ }
151
+
152
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(void, ); // NOLINT
153
+ #if GTEST_HAS_GLOBAL_STRING
154
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::string, "");
155
+ #endif // GTEST_HAS_GLOBAL_STRING
156
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::std::string, "");
157
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(bool, false);
158
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned char, '\0');
159
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed char, '\0');
160
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(char, '\0');
161
+
162
+ // There's no need for a default action for signed wchar_t, as that
163
+ // type is the same as wchar_t for gcc, and invalid for MSVC.
164
+ //
165
+ // There's also no need for a default action for unsigned wchar_t, as
166
+ // that type is the same as unsigned int for gcc, and invalid for
167
+ // MSVC.
168
+ #if GMOCK_WCHAR_T_IS_NATIVE_
169
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(wchar_t, 0U); // NOLINT
170
+ #endif
171
+
172
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned short, 0U); // NOLINT
173
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed short, 0); // NOLINT
174
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned int, 0U);
175
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed int, 0);
176
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long, 0UL); // NOLINT
177
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long, 0L); // NOLINT
178
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(UInt64, 0);
179
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(Int64, 0);
180
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(float, 0);
181
+ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(double, 0);
182
+
183
+ #undef GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_
184
+
185
+ } // namespace internal
186
+
187
+ // When an unexpected function call is encountered, Google Mock will
188
+ // let it return a default value if the user has specified one for its
189
+ // return type, or if the return type has a built-in default value;
190
+ // otherwise Google Mock won't know what value to return and will have
191
+ // to abort the process.
192
+ //
193
+ // The DefaultValue<T> class allows a user to specify the
194
+ // default value for a type T that is both copyable and publicly
195
+ // destructible (i.e. anything that can be used as a function return
196
+ // type). The usage is:
197
+ //
198
+ // // Sets the default value for type T to be foo.
199
+ // DefaultValue<T>::Set(foo);
200
+ template <typename T>
201
+ class DefaultValue {
202
+ public:
203
+ // Sets the default value for type T; requires T to be
204
+ // copy-constructable and have a public destructor.
205
+ static void Set(T x) {
206
+ delete producer_;
207
+ producer_ = new FixedValueProducer(x);
208
+ }
209
+
210
+ // Provides a factory function to be called to generate the default value.
211
+ // This method can be used even if T is only move-constructible, but it is not
212
+ // limited to that case.
213
+ typedef T (*FactoryFunction)();
214
+ static void SetFactory(FactoryFunction factory) {
215
+ delete producer_;
216
+ producer_ = new FactoryValueProducer(factory);
217
+ }
218
+
219
+ // Unsets the default value for type T.
220
+ static void Clear() {
221
+ delete producer_;
222
+ producer_ = NULL;
223
+ }
224
+
225
+ // Returns true iff the user has set the default value for type T.
226
+ static bool IsSet() { return producer_ != NULL; }
227
+
228
+ // Returns true if T has a default return value set by the user or there
229
+ // exists a built-in default value.
230
+ static bool Exists() {
231
+ return IsSet() || internal::BuiltInDefaultValue<T>::Exists();
232
+ }
233
+
234
+ // Returns the default value for type T if the user has set one;
235
+ // otherwise returns the built-in default value. Requires that Exists()
236
+ // is true, which ensures that the return value is well-defined.
237
+ static T Get() {
238
+ return producer_ == NULL ?
239
+ internal::BuiltInDefaultValue<T>::Get() : producer_->Produce();
240
+ }
241
+
242
+ private:
243
+ class ValueProducer {
244
+ public:
245
+ virtual ~ValueProducer() {}
246
+ virtual T Produce() = 0;
247
+ };
248
+
249
+ class FixedValueProducer : public ValueProducer {
250
+ public:
251
+ explicit FixedValueProducer(T value) : value_(value) {}
252
+ virtual T Produce() { return value_; }
253
+
254
+ private:
255
+ const T value_;
256
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(FixedValueProducer);
257
+ };
258
+
259
+ class FactoryValueProducer : public ValueProducer {
260
+ public:
261
+ explicit FactoryValueProducer(FactoryFunction factory)
262
+ : factory_(factory) {}
263
+ virtual T Produce() { return factory_(); }
264
+
265
+ private:
266
+ const FactoryFunction factory_;
267
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(FactoryValueProducer);
268
+ };
269
+
270
+ static ValueProducer* producer_;
271
+ };
272
+
273
+ // This partial specialization allows a user to set default values for
274
+ // reference types.
275
+ template <typename T>
276
+ class DefaultValue<T&> {
277
+ public:
278
+ // Sets the default value for type T&.
279
+ static void Set(T& x) { // NOLINT
280
+ address_ = &x;
281
+ }
282
+
283
+ // Unsets the default value for type T&.
284
+ static void Clear() {
285
+ address_ = NULL;
286
+ }
287
+
288
+ // Returns true iff the user has set the default value for type T&.
289
+ static bool IsSet() { return address_ != NULL; }
290
+
291
+ // Returns true if T has a default return value set by the user or there
292
+ // exists a built-in default value.
293
+ static bool Exists() {
294
+ return IsSet() || internal::BuiltInDefaultValue<T&>::Exists();
295
+ }
296
+
297
+ // Returns the default value for type T& if the user has set one;
298
+ // otherwise returns the built-in default value if there is one;
299
+ // otherwise aborts the process.
300
+ static T& Get() {
301
+ return address_ == NULL ?
302
+ internal::BuiltInDefaultValue<T&>::Get() : *address_;
303
+ }
304
+
305
+ private:
306
+ static T* address_;
307
+ };
308
+
309
+ // This specialization allows DefaultValue<void>::Get() to
310
+ // compile.
311
+ template <>
312
+ class DefaultValue<void> {
313
+ public:
314
+ static bool Exists() { return true; }
315
+ static void Get() {}
316
+ };
317
+
318
+ // Points to the user-set default value for type T.
319
+ template <typename T>
320
+ typename DefaultValue<T>::ValueProducer* DefaultValue<T>::producer_ = NULL;
321
+
322
+ // Points to the user-set default value for type T&.
323
+ template <typename T>
324
+ T* DefaultValue<T&>::address_ = NULL;
325
+
326
+ // Implement this interface to define an action for function type F.
327
+ template <typename F>
328
+ class ActionInterface {
329
+ public:
330
+ typedef typename internal::Function<F>::Result Result;
331
+ typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
332
+
333
+ ActionInterface() {}
334
+ virtual ~ActionInterface() {}
335
+
336
+ // Performs the action. This method is not const, as in general an
337
+ // action can have side effects and be stateful. For example, a
338
+ // get-the-next-element-from-the-collection action will need to
339
+ // remember the current element.
340
+ virtual Result Perform(const ArgumentTuple& args) = 0;
341
+
342
+ private:
343
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface);
344
+ };
345
+
346
+ // An Action<F> is a copyable and IMMUTABLE (except by assignment)
347
+ // object that represents an action to be taken when a mock function
348
+ // of type F is called. The implementation of Action<T> is just a
349
+ // linked_ptr to const ActionInterface<T>, so copying is fairly cheap.
350
+ // Don't inherit from Action!
351
+ //
352
+ // You can view an object implementing ActionInterface<F> as a
353
+ // concrete action (including its current state), and an Action<F>
354
+ // object as a handle to it.
355
+ template <typename F>
356
+ class Action {
357
+ public:
358
+ typedef typename internal::Function<F>::Result Result;
359
+ typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
360
+
361
+ // Constructs a null Action. Needed for storing Action objects in
362
+ // STL containers.
363
+ Action() {}
364
+
365
+ #if GTEST_LANG_CXX11
366
+ // Construct an Action from a specified callable.
367
+ // This cannot take std::function directly, because then Action would not be
368
+ // directly constructible from lambda (it would require two conversions).
369
+ template <typename G,
370
+ typename = typename ::std::enable_if<
371
+ ::std::is_constructible<::std::function<F>, G>::value>::type>
372
+ Action(G&& fun) : fun_(::std::forward<G>(fun)) {} // NOLINT
373
+ #endif
374
+
375
+ // Constructs an Action from its implementation.
376
+ explicit Action(ActionInterface<F>* impl) : impl_(impl) {}
377
+
378
+ // This constructor allows us to turn an Action<Func> object into an
379
+ // Action<F>, as long as F's arguments can be implicitly converted
380
+ // to Func's and Func's return type can be implicitly converted to
381
+ // F's.
382
+ template <typename Func>
383
+ explicit Action(const Action<Func>& action);
384
+
385
+ // Returns true iff this is the DoDefault() action.
386
+ bool IsDoDefault() const {
387
+ #if GTEST_LANG_CXX11
388
+ return impl_ == nullptr && fun_ == nullptr;
389
+ #else
390
+ return impl_ == NULL;
391
+ #endif
392
+ }
393
+
394
+ // Performs the action. Note that this method is const even though
395
+ // the corresponding method in ActionInterface is not. The reason
396
+ // is that a const Action<F> means that it cannot be re-bound to
397
+ // another concrete action, not that the concrete action it binds to
398
+ // cannot change state. (Think of the difference between a const
399
+ // pointer and a pointer to const.)
400
+ Result Perform(ArgumentTuple args) const {
401
+ if (IsDoDefault()) {
402
+ internal::IllegalDoDefault(__FILE__, __LINE__);
403
+ }
404
+ #if GTEST_LANG_CXX11
405
+ if (fun_ != nullptr) {
406
+ return internal::Apply(fun_, ::std::move(args));
407
+ }
408
+ #endif
409
+ return impl_->Perform(args);
410
+ }
411
+
412
+ private:
413
+ template <typename F1, typename F2>
414
+ friend class internal::ActionAdaptor;
415
+
416
+ template <typename G>
417
+ friend class Action;
418
+
419
+ // In C++11, Action can be implemented either as a generic functor (through
420
+ // std::function), or legacy ActionInterface. In C++98, only ActionInterface
421
+ // is available. The invariants are as follows:
422
+ // * in C++98, impl_ is null iff this is the default action
423
+ // * in C++11, at most one of fun_ & impl_ may be nonnull; both are null iff
424
+ // this is the default action
425
+ #if GTEST_LANG_CXX11
426
+ ::std::function<F> fun_;
427
+ #endif
428
+ internal::linked_ptr<ActionInterface<F> > impl_;
429
+ };
430
+
431
+ // The PolymorphicAction class template makes it easy to implement a
432
+ // polymorphic action (i.e. an action that can be used in mock
433
+ // functions of than one type, e.g. Return()).
434
+ //
435
+ // To define a polymorphic action, a user first provides a COPYABLE
436
+ // implementation class that has a Perform() method template:
437
+ //
438
+ // class FooAction {
439
+ // public:
440
+ // template <typename Result, typename ArgumentTuple>
441
+ // Result Perform(const ArgumentTuple& args) const {
442
+ // // Processes the arguments and returns a result, using
443
+ // // tr1::get<N>(args) to get the N-th (0-based) argument in the tuple.
444
+ // }
445
+ // ...
446
+ // };
447
+ //
448
+ // Then the user creates the polymorphic action using
449
+ // MakePolymorphicAction(object) where object has type FooAction. See
450
+ // the definition of Return(void) and SetArgumentPointee<N>(value) for
451
+ // complete examples.
452
+ template <typename Impl>
453
+ class PolymorphicAction {
454
+ public:
455
+ explicit PolymorphicAction(const Impl& impl) : impl_(impl) {}
456
+
457
+ template <typename F>
458
+ operator Action<F>() const {
459
+ return Action<F>(new MonomorphicImpl<F>(impl_));
460
+ }
461
+
462
+ private:
463
+ template <typename F>
464
+ class MonomorphicImpl : public ActionInterface<F> {
465
+ public:
466
+ typedef typename internal::Function<F>::Result Result;
467
+ typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
468
+
469
+ explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
470
+
471
+ virtual Result Perform(const ArgumentTuple& args) {
472
+ return impl_.template Perform<Result>(args);
473
+ }
474
+
475
+ private:
476
+ Impl impl_;
477
+
478
+ GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);
479
+ };
480
+
481
+ Impl impl_;
482
+
483
+ GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
484
+ };
485
+
486
+ // Creates an Action from its implementation and returns it. The
487
+ // created Action object owns the implementation.
488
+ template <typename F>
489
+ Action<F> MakeAction(ActionInterface<F>* impl) {
490
+ return Action<F>(impl);
491
+ }
492
+
493
+ // Creates a polymorphic action from its implementation. This is
494
+ // easier to use than the PolymorphicAction<Impl> constructor as it
495
+ // doesn't require you to explicitly write the template argument, e.g.
496
+ //
497
+ // MakePolymorphicAction(foo);
498
+ // vs
499
+ // PolymorphicAction<TypeOfFoo>(foo);
500
+ template <typename Impl>
501
+ inline PolymorphicAction<Impl> MakePolymorphicAction(const Impl& impl) {
502
+ return PolymorphicAction<Impl>(impl);
503
+ }
504
+
505
+ namespace internal {
506
+
507
+ // Allows an Action<F2> object to pose as an Action<F1>, as long as F2
508
+ // and F1 are compatible.
509
+ template <typename F1, typename F2>
510
+ class ActionAdaptor : public ActionInterface<F1> {
511
+ public:
512
+ typedef typename internal::Function<F1>::Result Result;
513
+ typedef typename internal::Function<F1>::ArgumentTuple ArgumentTuple;
514
+
515
+ explicit ActionAdaptor(const Action<F2>& from) : impl_(from.impl_) {}
516
+
517
+ virtual Result Perform(const ArgumentTuple& args) {
518
+ return impl_->Perform(args);
519
+ }
520
+
521
+ private:
522
+ const internal::linked_ptr<ActionInterface<F2> > impl_;
523
+
524
+ GTEST_DISALLOW_ASSIGN_(ActionAdaptor);
525
+ };
526
+
527
+ // Helper struct to specialize ReturnAction to execute a move instead of a copy
528
+ // on return. Useful for move-only types, but could be used on any type.
529
+ template <typename T>
530
+ struct ByMoveWrapper {
531
+ explicit ByMoveWrapper(T value) : payload(internal::move(value)) {}
532
+ T payload;
533
+ };
534
+
535
+ // Implements the polymorphic Return(x) action, which can be used in
536
+ // any function that returns the type of x, regardless of the argument
537
+ // types.
538
+ //
539
+ // Note: The value passed into Return must be converted into
540
+ // Function<F>::Result when this action is cast to Action<F> rather than
541
+ // when that action is performed. This is important in scenarios like
542
+ //
543
+ // MOCK_METHOD1(Method, T(U));
544
+ // ...
545
+ // {
546
+ // Foo foo;
547
+ // X x(&foo);
548
+ // EXPECT_CALL(mock, Method(_)).WillOnce(Return(x));
549
+ // }
550
+ //
551
+ // In the example above the variable x holds reference to foo which leaves
552
+ // scope and gets destroyed. If copying X just copies a reference to foo,
553
+ // that copy will be left with a hanging reference. If conversion to T
554
+ // makes a copy of foo, the above code is safe. To support that scenario, we
555
+ // need to make sure that the type conversion happens inside the EXPECT_CALL
556
+ // statement, and conversion of the result of Return to Action<T(U)> is a
557
+ // good place for that.
558
+ //
559
+ // The real life example of the above scenario happens when an invocation
560
+ // of gtl::Container() is passed into Return.
561
+ //
562
+ template <typename R>
563
+ class ReturnAction {
564
+ public:
565
+ // Constructs a ReturnAction object from the value to be returned.
566
+ // 'value' is passed by value instead of by const reference in order
567
+ // to allow Return("string literal") to compile.
568
+ explicit ReturnAction(R value) : value_(new R(internal::move(value))) {}
569
+
570
+ // This template type conversion operator allows Return(x) to be
571
+ // used in ANY function that returns x's type.
572
+ template <typename F>
573
+ operator Action<F>() const {
574
+ // Assert statement belongs here because this is the best place to verify
575
+ // conditions on F. It produces the clearest error messages
576
+ // in most compilers.
577
+ // Impl really belongs in this scope as a local class but can't
578
+ // because MSVC produces duplicate symbols in different translation units
579
+ // in this case. Until MS fixes that bug we put Impl into the class scope
580
+ // and put the typedef both here (for use in assert statement) and
581
+ // in the Impl class. But both definitions must be the same.
582
+ typedef typename Function<F>::Result Result;
583
+ GTEST_COMPILE_ASSERT_(
584
+ !is_reference<Result>::value,
585
+ use_ReturnRef_instead_of_Return_to_return_a_reference);
586
+ return Action<F>(new Impl<R, F>(value_));
587
+ }
588
+
589
+ private:
590
+ // Implements the Return(x) action for a particular function type F.
591
+ template <typename R_, typename F>
592
+ class Impl : public ActionInterface<F> {
593
+ public:
594
+ typedef typename Function<F>::Result Result;
595
+ typedef typename Function<F>::ArgumentTuple ArgumentTuple;
596
+
597
+ // The implicit cast is necessary when Result has more than one
598
+ // single-argument constructor (e.g. Result is std::vector<int>) and R
599
+ // has a type conversion operator template. In that case, value_(value)
600
+ // won't compile as the compiler doesn't known which constructor of
601
+ // Result to call. ImplicitCast_ forces the compiler to convert R to
602
+ // Result without considering explicit constructors, thus resolving the
603
+ // ambiguity. value_ is then initialized using its copy constructor.
604
+ explicit Impl(const linked_ptr<R>& value)
605
+ : value_before_cast_(*value),
606
+ value_(ImplicitCast_<Result>(value_before_cast_)) {}
607
+
608
+ virtual Result Perform(const ArgumentTuple&) { return value_; }
609
+
610
+ private:
611
+ GTEST_COMPILE_ASSERT_(!is_reference<Result>::value,
612
+ Result_cannot_be_a_reference_type);
613
+ // We save the value before casting just in case it is being cast to a
614
+ // wrapper type.
615
+ R value_before_cast_;
616
+ Result value_;
617
+
618
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
619
+ };
620
+
621
+ // Partially specialize for ByMoveWrapper. This version of ReturnAction will
622
+ // move its contents instead.
623
+ template <typename R_, typename F>
624
+ class Impl<ByMoveWrapper<R_>, F> : public ActionInterface<F> {
625
+ public:
626
+ typedef typename Function<F>::Result Result;
627
+ typedef typename Function<F>::ArgumentTuple ArgumentTuple;
628
+
629
+ explicit Impl(const linked_ptr<R>& wrapper)
630
+ : performed_(false), wrapper_(wrapper) {}
631
+
632
+ virtual Result Perform(const ArgumentTuple&) {
633
+ GTEST_CHECK_(!performed_)
634
+ << "A ByMove() action should only be performed once.";
635
+ performed_ = true;
636
+ return internal::move(wrapper_->payload);
637
+ }
638
+
639
+ private:
640
+ bool performed_;
641
+ const linked_ptr<R> wrapper_;
642
+
643
+ GTEST_DISALLOW_ASSIGN_(Impl);
644
+ };
645
+
646
+ const linked_ptr<R> value_;
647
+
648
+ GTEST_DISALLOW_ASSIGN_(ReturnAction);
649
+ };
650
+
651
+ // Implements the ReturnNull() action.
652
+ class ReturnNullAction {
653
+ public:
654
+ // Allows ReturnNull() to be used in any pointer-returning function. In C++11
655
+ // this is enforced by returning nullptr, and in non-C++11 by asserting a
656
+ // pointer type on compile time.
657
+ template <typename Result, typename ArgumentTuple>
658
+ static Result Perform(const ArgumentTuple&) {
659
+ #if GTEST_LANG_CXX11
660
+ return nullptr;
661
+ #else
662
+ GTEST_COMPILE_ASSERT_(internal::is_pointer<Result>::value,
663
+ ReturnNull_can_be_used_to_return_a_pointer_only);
664
+ return NULL;
665
+ #endif // GTEST_LANG_CXX11
666
+ }
667
+ };
668
+
669
+ // Implements the Return() action.
670
+ class ReturnVoidAction {
671
+ public:
672
+ // Allows Return() to be used in any void-returning function.
673
+ template <typename Result, typename ArgumentTuple>
674
+ static void Perform(const ArgumentTuple&) {
675
+ CompileAssertTypesEqual<void, Result>();
676
+ }
677
+ };
678
+
679
+ // Implements the polymorphic ReturnRef(x) action, which can be used
680
+ // in any function that returns a reference to the type of x,
681
+ // regardless of the argument types.
682
+ template <typename T>
683
+ class ReturnRefAction {
684
+ public:
685
+ // Constructs a ReturnRefAction object from the reference to be returned.
686
+ explicit ReturnRefAction(T& ref) : ref_(ref) {} // NOLINT
687
+
688
+ // This template type conversion operator allows ReturnRef(x) to be
689
+ // used in ANY function that returns a reference to x's type.
690
+ template <typename F>
691
+ operator Action<F>() const {
692
+ typedef typename Function<F>::Result Result;
693
+ // Asserts that the function return type is a reference. This
694
+ // catches the user error of using ReturnRef(x) when Return(x)
695
+ // should be used, and generates some helpful error message.
696
+ GTEST_COMPILE_ASSERT_(internal::is_reference<Result>::value,
697
+ use_Return_instead_of_ReturnRef_to_return_a_value);
698
+ return Action<F>(new Impl<F>(ref_));
699
+ }
700
+
701
+ private:
702
+ // Implements the ReturnRef(x) action for a particular function type F.
703
+ template <typename F>
704
+ class Impl : public ActionInterface<F> {
705
+ public:
706
+ typedef typename Function<F>::Result Result;
707
+ typedef typename Function<F>::ArgumentTuple ArgumentTuple;
708
+
709
+ explicit Impl(T& ref) : ref_(ref) {} // NOLINT
710
+
711
+ virtual Result Perform(const ArgumentTuple&) {
712
+ return ref_;
713
+ }
714
+
715
+ private:
716
+ T& ref_;
717
+
718
+ GTEST_DISALLOW_ASSIGN_(Impl);
719
+ };
720
+
721
+ T& ref_;
722
+
723
+ GTEST_DISALLOW_ASSIGN_(ReturnRefAction);
724
+ };
725
+
726
+ // Implements the polymorphic ReturnRefOfCopy(x) action, which can be
727
+ // used in any function that returns a reference to the type of x,
728
+ // regardless of the argument types.
729
+ template <typename T>
730
+ class ReturnRefOfCopyAction {
731
+ public:
732
+ // Constructs a ReturnRefOfCopyAction object from the reference to
733
+ // be returned.
734
+ explicit ReturnRefOfCopyAction(const T& value) : value_(value) {} // NOLINT
735
+
736
+ // This template type conversion operator allows ReturnRefOfCopy(x) to be
737
+ // used in ANY function that returns a reference to x's type.
738
+ template <typename F>
739
+ operator Action<F>() const {
740
+ typedef typename Function<F>::Result Result;
741
+ // Asserts that the function return type is a reference. This
742
+ // catches the user error of using ReturnRefOfCopy(x) when Return(x)
743
+ // should be used, and generates some helpful error message.
744
+ GTEST_COMPILE_ASSERT_(
745
+ internal::is_reference<Result>::value,
746
+ use_Return_instead_of_ReturnRefOfCopy_to_return_a_value);
747
+ return Action<F>(new Impl<F>(value_));
748
+ }
749
+
750
+ private:
751
+ // Implements the ReturnRefOfCopy(x) action for a particular function type F.
752
+ template <typename F>
753
+ class Impl : public ActionInterface<F> {
754
+ public:
755
+ typedef typename Function<F>::Result Result;
756
+ typedef typename Function<F>::ArgumentTuple ArgumentTuple;
757
+
758
+ explicit Impl(const T& value) : value_(value) {} // NOLINT
759
+
760
+ virtual Result Perform(const ArgumentTuple&) {
761
+ return value_;
762
+ }
763
+
764
+ private:
765
+ T value_;
766
+
767
+ GTEST_DISALLOW_ASSIGN_(Impl);
768
+ };
769
+
770
+ const T value_;
771
+
772
+ GTEST_DISALLOW_ASSIGN_(ReturnRefOfCopyAction);
773
+ };
774
+
775
+ // Implements the polymorphic DoDefault() action.
776
+ class DoDefaultAction {
777
+ public:
778
+ // This template type conversion operator allows DoDefault() to be
779
+ // used in any function.
780
+ template <typename F>
781
+ operator Action<F>() const { return Action<F>(); } // NOLINT
782
+ };
783
+
784
+ // Implements the Assign action to set a given pointer referent to a
785
+ // particular value.
786
+ template <typename T1, typename T2>
787
+ class AssignAction {
788
+ public:
789
+ AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {}
790
+
791
+ template <typename Result, typename ArgumentTuple>
792
+ void Perform(const ArgumentTuple& /* args */) const {
793
+ *ptr_ = value_;
794
+ }
795
+
796
+ private:
797
+ T1* const ptr_;
798
+ const T2 value_;
799
+
800
+ GTEST_DISALLOW_ASSIGN_(AssignAction);
801
+ };
802
+
803
+ #if !GTEST_OS_WINDOWS_MOBILE
804
+
805
+ // Implements the SetErrnoAndReturn action to simulate return from
806
+ // various system calls and libc functions.
807
+ template <typename T>
808
+ class SetErrnoAndReturnAction {
809
+ public:
810
+ SetErrnoAndReturnAction(int errno_value, T result)
811
+ : errno_(errno_value),
812
+ result_(result) {}
813
+ template <typename Result, typename ArgumentTuple>
814
+ Result Perform(const ArgumentTuple& /* args */) const {
815
+ errno = errno_;
816
+ return result_;
817
+ }
818
+
819
+ private:
820
+ const int errno_;
821
+ const T result_;
822
+
823
+ GTEST_DISALLOW_ASSIGN_(SetErrnoAndReturnAction);
824
+ };
825
+
826
+ #endif // !GTEST_OS_WINDOWS_MOBILE
827
+
828
+ // Implements the SetArgumentPointee<N>(x) action for any function
829
+ // whose N-th argument (0-based) is a pointer to x's type. The
830
+ // template parameter kIsProto is true iff type A is ProtocolMessage,
831
+ // proto2::Message, or a sub-class of those.
832
+ template <size_t N, typename A, bool kIsProto>
833
+ class SetArgumentPointeeAction {
834
+ public:
835
+ // Constructs an action that sets the variable pointed to by the
836
+ // N-th function argument to 'value'.
837
+ explicit SetArgumentPointeeAction(const A& value) : value_(value) {}
838
+
839
+ template <typename Result, typename ArgumentTuple>
840
+ void Perform(const ArgumentTuple& args) const {
841
+ CompileAssertTypesEqual<void, Result>();
842
+ *::testing::get<N>(args) = value_;
843
+ }
844
+
845
+ private:
846
+ const A value_;
847
+
848
+ GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction);
849
+ };
850
+
851
+ template <size_t N, typename Proto>
852
+ class SetArgumentPointeeAction<N, Proto, true> {
853
+ public:
854
+ // Constructs an action that sets the variable pointed to by the
855
+ // N-th function argument to 'proto'. Both ProtocolMessage and
856
+ // proto2::Message have the CopyFrom() method, so the same
857
+ // implementation works for both.
858
+ explicit SetArgumentPointeeAction(const Proto& proto) : proto_(new Proto) {
859
+ proto_->CopyFrom(proto);
860
+ }
861
+
862
+ template <typename Result, typename ArgumentTuple>
863
+ void Perform(const ArgumentTuple& args) const {
864
+ CompileAssertTypesEqual<void, Result>();
865
+ ::testing::get<N>(args)->CopyFrom(*proto_);
866
+ }
867
+
868
+ private:
869
+ const internal::linked_ptr<Proto> proto_;
870
+
871
+ GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction);
872
+ };
873
+
874
+ // Implements the InvokeWithoutArgs(f) action. The template argument
875
+ // FunctionImpl is the implementation type of f, which can be either a
876
+ // function pointer or a functor. InvokeWithoutArgs(f) can be used as an
877
+ // Action<F> as long as f's type is compatible with F (i.e. f can be
878
+ // assigned to a tr1::function<F>).
879
+ template <typename FunctionImpl>
880
+ class InvokeWithoutArgsAction {
881
+ public:
882
+ // The c'tor makes a copy of function_impl (either a function
883
+ // pointer or a functor).
884
+ explicit InvokeWithoutArgsAction(FunctionImpl function_impl)
885
+ : function_impl_(function_impl) {}
886
+
887
+ // Allows InvokeWithoutArgs(f) to be used as any action whose type is
888
+ // compatible with f.
889
+ template <typename Result, typename ArgumentTuple>
890
+ Result Perform(const ArgumentTuple&) { return function_impl_(); }
891
+
892
+ private:
893
+ FunctionImpl function_impl_;
894
+
895
+ GTEST_DISALLOW_ASSIGN_(InvokeWithoutArgsAction);
896
+ };
897
+
898
+ // Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action.
899
+ template <class Class, typename MethodPtr>
900
+ class InvokeMethodWithoutArgsAction {
901
+ public:
902
+ InvokeMethodWithoutArgsAction(Class* obj_ptr, MethodPtr method_ptr)
903
+ : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}
904
+
905
+ template <typename Result, typename ArgumentTuple>
906
+ Result Perform(const ArgumentTuple&) const {
907
+ return (obj_ptr_->*method_ptr_)();
908
+ }
909
+
910
+ private:
911
+ Class* const obj_ptr_;
912
+ const MethodPtr method_ptr_;
913
+
914
+ GTEST_DISALLOW_ASSIGN_(InvokeMethodWithoutArgsAction);
915
+ };
916
+
917
+ // Implements the InvokeWithoutArgs(callback) action.
918
+ template <typename CallbackType>
919
+ class InvokeCallbackWithoutArgsAction {
920
+ public:
921
+ // The c'tor takes ownership of the callback.
922
+ explicit InvokeCallbackWithoutArgsAction(CallbackType* callback)
923
+ : callback_(callback) {
924
+ callback->CheckIsRepeatable(); // Makes sure the callback is permanent.
925
+ }
926
+
927
+ // This type conversion operator template allows Invoke(callback) to
928
+ // be used wherever the callback's return type can be implicitly
929
+ // converted to that of the mock function.
930
+ template <typename Result, typename ArgumentTuple>
931
+ Result Perform(const ArgumentTuple&) const { return callback_->Run(); }
932
+
933
+ private:
934
+ const internal::linked_ptr<CallbackType> callback_;
935
+
936
+ GTEST_DISALLOW_ASSIGN_(InvokeCallbackWithoutArgsAction);
937
+ };
938
+
939
+ // Implements the IgnoreResult(action) action.
940
+ template <typename A>
941
+ class IgnoreResultAction {
942
+ public:
943
+ explicit IgnoreResultAction(const A& action) : action_(action) {}
944
+
945
+ template <typename F>
946
+ operator Action<F>() const {
947
+ // Assert statement belongs here because this is the best place to verify
948
+ // conditions on F. It produces the clearest error messages
949
+ // in most compilers.
950
+ // Impl really belongs in this scope as a local class but can't
951
+ // because MSVC produces duplicate symbols in different translation units
952
+ // in this case. Until MS fixes that bug we put Impl into the class scope
953
+ // and put the typedef both here (for use in assert statement) and
954
+ // in the Impl class. But both definitions must be the same.
955
+ typedef typename internal::Function<F>::Result Result;
956
+
957
+ // Asserts at compile time that F returns void.
958
+ CompileAssertTypesEqual<void, Result>();
959
+
960
+ return Action<F>(new Impl<F>(action_));
961
+ }
962
+
963
+ private:
964
+ template <typename F>
965
+ class Impl : public ActionInterface<F> {
966
+ public:
967
+ typedef typename internal::Function<F>::Result Result;
968
+ typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
969
+
970
+ explicit Impl(const A& action) : action_(action) {}
971
+
972
+ virtual void Perform(const ArgumentTuple& args) {
973
+ // Performs the action and ignores its result.
974
+ action_.Perform(args);
975
+ }
976
+
977
+ private:
978
+ // Type OriginalFunction is the same as F except that its return
979
+ // type is IgnoredValue.
980
+ typedef typename internal::Function<F>::MakeResultIgnoredValue
981
+ OriginalFunction;
982
+
983
+ const Action<OriginalFunction> action_;
984
+
985
+ GTEST_DISALLOW_ASSIGN_(Impl);
986
+ };
987
+
988
+ const A action_;
989
+
990
+ GTEST_DISALLOW_ASSIGN_(IgnoreResultAction);
991
+ };
992
+
993
+ // A ReferenceWrapper<T> object represents a reference to type T,
994
+ // which can be either const or not. It can be explicitly converted
995
+ // from, and implicitly converted to, a T&. Unlike a reference,
996
+ // ReferenceWrapper<T> can be copied and can survive template type
997
+ // inference. This is used to support by-reference arguments in the
998
+ // InvokeArgument<N>(...) action. The idea was from "reference
999
+ // wrappers" in tr1, which we don't have in our source tree yet.
1000
+ template <typename T>
1001
+ class ReferenceWrapper {
1002
+ public:
1003
+ // Constructs a ReferenceWrapper<T> object from a T&.
1004
+ explicit ReferenceWrapper(T& l_value) : pointer_(&l_value) {} // NOLINT
1005
+
1006
+ // Allows a ReferenceWrapper<T> object to be implicitly converted to
1007
+ // a T&.
1008
+ operator T&() const { return *pointer_; }
1009
+ private:
1010
+ T* pointer_;
1011
+ };
1012
+
1013
+ // Allows the expression ByRef(x) to be printed as a reference to x.
1014
+ template <typename T>
1015
+ void PrintTo(const ReferenceWrapper<T>& ref, ::std::ostream* os) {
1016
+ T& value = ref;
1017
+ UniversalPrinter<T&>::Print(value, os);
1018
+ }
1019
+
1020
+ // Does two actions sequentially. Used for implementing the DoAll(a1,
1021
+ // a2, ...) action.
1022
+ template <typename Action1, typename Action2>
1023
+ class DoBothAction {
1024
+ public:
1025
+ DoBothAction(Action1 action1, Action2 action2)
1026
+ : action1_(action1), action2_(action2) {}
1027
+
1028
+ // This template type conversion operator allows DoAll(a1, ..., a_n)
1029
+ // to be used in ANY function of compatible type.
1030
+ template <typename F>
1031
+ operator Action<F>() const {
1032
+ return Action<F>(new Impl<F>(action1_, action2_));
1033
+ }
1034
+
1035
+ private:
1036
+ // Implements the DoAll(...) action for a particular function type F.
1037
+ template <typename F>
1038
+ class Impl : public ActionInterface<F> {
1039
+ public:
1040
+ typedef typename Function<F>::Result Result;
1041
+ typedef typename Function<F>::ArgumentTuple ArgumentTuple;
1042
+ typedef typename Function<F>::MakeResultVoid VoidResult;
1043
+
1044
+ Impl(const Action<VoidResult>& action1, const Action<F>& action2)
1045
+ : action1_(action1), action2_(action2) {}
1046
+
1047
+ virtual Result Perform(const ArgumentTuple& args) {
1048
+ action1_.Perform(args);
1049
+ return action2_.Perform(args);
1050
+ }
1051
+
1052
+ private:
1053
+ const Action<VoidResult> action1_;
1054
+ const Action<F> action2_;
1055
+
1056
+ GTEST_DISALLOW_ASSIGN_(Impl);
1057
+ };
1058
+
1059
+ Action1 action1_;
1060
+ Action2 action2_;
1061
+
1062
+ GTEST_DISALLOW_ASSIGN_(DoBothAction);
1063
+ };
1064
+
1065
+ } // namespace internal
1066
+
1067
+ // An Unused object can be implicitly constructed from ANY value.
1068
+ // This is handy when defining actions that ignore some or all of the
1069
+ // mock function arguments. For example, given
1070
+ //
1071
+ // MOCK_METHOD3(Foo, double(const string& label, double x, double y));
1072
+ // MOCK_METHOD3(Bar, double(int index, double x, double y));
1073
+ //
1074
+ // instead of
1075
+ //
1076
+ // double DistanceToOriginWithLabel(const string& label, double x, double y) {
1077
+ // return sqrt(x*x + y*y);
1078
+ // }
1079
+ // double DistanceToOriginWithIndex(int index, double x, double y) {
1080
+ // return sqrt(x*x + y*y);
1081
+ // }
1082
+ // ...
1083
+ // EXPECT_CALL(mock, Foo("abc", _, _))
1084
+ // .WillOnce(Invoke(DistanceToOriginWithLabel));
1085
+ // EXPECT_CALL(mock, Bar(5, _, _))
1086
+ // .WillOnce(Invoke(DistanceToOriginWithIndex));
1087
+ //
1088
+ // you could write
1089
+ //
1090
+ // // We can declare any uninteresting argument as Unused.
1091
+ // double DistanceToOrigin(Unused, double x, double y) {
1092
+ // return sqrt(x*x + y*y);
1093
+ // }
1094
+ // ...
1095
+ // EXPECT_CALL(mock, Foo("abc", _, _)).WillOnce(Invoke(DistanceToOrigin));
1096
+ // EXPECT_CALL(mock, Bar(5, _, _)).WillOnce(Invoke(DistanceToOrigin));
1097
+ typedef internal::IgnoredValue Unused;
1098
+
1099
+ // This constructor allows us to turn an Action<From> object into an
1100
+ // Action<To>, as long as To's arguments can be implicitly converted
1101
+ // to From's and From's return type cann be implicitly converted to
1102
+ // To's.
1103
+ template <typename To>
1104
+ template <typename From>
1105
+ Action<To>::Action(const Action<From>& from)
1106
+ :
1107
+ #if GTEST_LANG_CXX11
1108
+ fun_(from.fun_),
1109
+ #endif
1110
+ impl_(from.impl_ == NULL ? NULL
1111
+ : new internal::ActionAdaptor<To, From>(from)) {
1112
+ }
1113
+
1114
+ // Creates an action that returns 'value'. 'value' is passed by value
1115
+ // instead of const reference - otherwise Return("string literal")
1116
+ // will trigger a compiler error about using array as initializer.
1117
+ template <typename R>
1118
+ internal::ReturnAction<R> Return(R value) {
1119
+ return internal::ReturnAction<R>(internal::move(value));
1120
+ }
1121
+
1122
+ // Creates an action that returns NULL.
1123
+ inline PolymorphicAction<internal::ReturnNullAction> ReturnNull() {
1124
+ return MakePolymorphicAction(internal::ReturnNullAction());
1125
+ }
1126
+
1127
+ // Creates an action that returns from a void function.
1128
+ inline PolymorphicAction<internal::ReturnVoidAction> Return() {
1129
+ return MakePolymorphicAction(internal::ReturnVoidAction());
1130
+ }
1131
+
1132
+ // Creates an action that returns the reference to a variable.
1133
+ template <typename R>
1134
+ inline internal::ReturnRefAction<R> ReturnRef(R& x) { // NOLINT
1135
+ return internal::ReturnRefAction<R>(x);
1136
+ }
1137
+
1138
+ // Creates an action that returns the reference to a copy of the
1139
+ // argument. The copy is created when the action is constructed and
1140
+ // lives as long as the action.
1141
+ template <typename R>
1142
+ inline internal::ReturnRefOfCopyAction<R> ReturnRefOfCopy(const R& x) {
1143
+ return internal::ReturnRefOfCopyAction<R>(x);
1144
+ }
1145
+
1146
+ // Modifies the parent action (a Return() action) to perform a move of the
1147
+ // argument instead of a copy.
1148
+ // Return(ByMove()) actions can only be executed once and will assert this
1149
+ // invariant.
1150
+ template <typename R>
1151
+ internal::ByMoveWrapper<R> ByMove(R x) {
1152
+ return internal::ByMoveWrapper<R>(internal::move(x));
1153
+ }
1154
+
1155
+ // Creates an action that does the default action for the give mock function.
1156
+ inline internal::DoDefaultAction DoDefault() {
1157
+ return internal::DoDefaultAction();
1158
+ }
1159
+
1160
+ // Creates an action that sets the variable pointed by the N-th
1161
+ // (0-based) function argument to 'value'.
1162
+ template <size_t N, typename T>
1163
+ PolymorphicAction<
1164
+ internal::SetArgumentPointeeAction<
1165
+ N, T, internal::IsAProtocolMessage<T>::value> >
1166
+ SetArgPointee(const T& x) {
1167
+ return MakePolymorphicAction(internal::SetArgumentPointeeAction<
1168
+ N, T, internal::IsAProtocolMessage<T>::value>(x));
1169
+ }
1170
+
1171
+ #if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)
1172
+ // This overload allows SetArgPointee() to accept a string literal.
1173
+ // GCC prior to the version 4.0 and Symbian C++ compiler cannot distinguish
1174
+ // this overload from the templated version and emit a compile error.
1175
+ template <size_t N>
1176
+ PolymorphicAction<
1177
+ internal::SetArgumentPointeeAction<N, const char*, false> >
1178
+ SetArgPointee(const char* p) {
1179
+ return MakePolymorphicAction(internal::SetArgumentPointeeAction<
1180
+ N, const char*, false>(p));
1181
+ }
1182
+
1183
+ template <size_t N>
1184
+ PolymorphicAction<
1185
+ internal::SetArgumentPointeeAction<N, const wchar_t*, false> >
1186
+ SetArgPointee(const wchar_t* p) {
1187
+ return MakePolymorphicAction(internal::SetArgumentPointeeAction<
1188
+ N, const wchar_t*, false>(p));
1189
+ }
1190
+ #endif
1191
+
1192
+ // The following version is DEPRECATED.
1193
+ template <size_t N, typename T>
1194
+ PolymorphicAction<
1195
+ internal::SetArgumentPointeeAction<
1196
+ N, T, internal::IsAProtocolMessage<T>::value> >
1197
+ SetArgumentPointee(const T& x) {
1198
+ return MakePolymorphicAction(internal::SetArgumentPointeeAction<
1199
+ N, T, internal::IsAProtocolMessage<T>::value>(x));
1200
+ }
1201
+
1202
+ // Creates an action that sets a pointer referent to a given value.
1203
+ template <typename T1, typename T2>
1204
+ PolymorphicAction<internal::AssignAction<T1, T2> > Assign(T1* ptr, T2 val) {
1205
+ return MakePolymorphicAction(internal::AssignAction<T1, T2>(ptr, val));
1206
+ }
1207
+
1208
+ #if !GTEST_OS_WINDOWS_MOBILE
1209
+
1210
+ // Creates an action that sets errno and returns the appropriate error.
1211
+ template <typename T>
1212
+ PolymorphicAction<internal::SetErrnoAndReturnAction<T> >
1213
+ SetErrnoAndReturn(int errval, T result) {
1214
+ return MakePolymorphicAction(
1215
+ internal::SetErrnoAndReturnAction<T>(errval, result));
1216
+ }
1217
+
1218
+ #endif // !GTEST_OS_WINDOWS_MOBILE
1219
+
1220
+ // Various overloads for InvokeWithoutArgs().
1221
+
1222
+ // Creates an action that invokes 'function_impl' with no argument.
1223
+ template <typename FunctionImpl>
1224
+ PolymorphicAction<internal::InvokeWithoutArgsAction<FunctionImpl> >
1225
+ InvokeWithoutArgs(FunctionImpl function_impl) {
1226
+ return MakePolymorphicAction(
1227
+ internal::InvokeWithoutArgsAction<FunctionImpl>(function_impl));
1228
+ }
1229
+
1230
+ // Creates an action that invokes the given method on the given object
1231
+ // with no argument.
1232
+ template <class Class, typename MethodPtr>
1233
+ PolymorphicAction<internal::InvokeMethodWithoutArgsAction<Class, MethodPtr> >
1234
+ InvokeWithoutArgs(Class* obj_ptr, MethodPtr method_ptr) {
1235
+ return MakePolymorphicAction(
1236
+ internal::InvokeMethodWithoutArgsAction<Class, MethodPtr>(
1237
+ obj_ptr, method_ptr));
1238
+ }
1239
+
1240
+ // Creates an action that performs an_action and throws away its
1241
+ // result. In other words, it changes the return type of an_action to
1242
+ // void. an_action MUST NOT return void, or the code won't compile.
1243
+ template <typename A>
1244
+ inline internal::IgnoreResultAction<A> IgnoreResult(const A& an_action) {
1245
+ return internal::IgnoreResultAction<A>(an_action);
1246
+ }
1247
+
1248
+ // Creates a reference wrapper for the given L-value. If necessary,
1249
+ // you can explicitly specify the type of the reference. For example,
1250
+ // suppose 'derived' is an object of type Derived, ByRef(derived)
1251
+ // would wrap a Derived&. If you want to wrap a const Base& instead,
1252
+ // where Base is a base class of Derived, just write:
1253
+ //
1254
+ // ByRef<const Base>(derived)
1255
+ template <typename T>
1256
+ inline internal::ReferenceWrapper<T> ByRef(T& l_value) { // NOLINT
1257
+ return internal::ReferenceWrapper<T>(l_value);
1258
+ }
1259
+
1260
+ } // namespace testing
1261
+
1262
+ #endif // GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_