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,1277 @@
1
+ // Copyright 2005, 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
+ //
31
+ // The Google C++ Testing and Mocking Framework (Google Test)
32
+ //
33
+ // This header file declares functions and macros used internally by
34
+ // Google Test. They are subject to change without notice.
35
+
36
+ #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
37
+ #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
38
+
39
+ #include "gtest/internal/gtest-port.h"
40
+
41
+ #if GTEST_OS_LINUX
42
+ # include <stdlib.h>
43
+ # include <sys/types.h>
44
+ # include <sys/wait.h>
45
+ # include <unistd.h>
46
+ #endif // GTEST_OS_LINUX
47
+
48
+ #if GTEST_HAS_EXCEPTIONS
49
+ # include <stdexcept>
50
+ #endif
51
+
52
+ #include <ctype.h>
53
+ #include <float.h>
54
+ #include <string.h>
55
+ #include <iomanip>
56
+ #include <limits>
57
+ #include <map>
58
+ #include <set>
59
+ #include <string>
60
+ #include <vector>
61
+
62
+ #include "gtest/gtest-message.h"
63
+ #include "gtest/internal/gtest-filepath.h"
64
+ #include "gtest/internal/gtest-string.h"
65
+ #include "gtest/internal/gtest-type-util.h"
66
+
67
+ // Due to C++ preprocessor weirdness, we need double indirection to
68
+ // concatenate two tokens when one of them is __LINE__. Writing
69
+ //
70
+ // foo ## __LINE__
71
+ //
72
+ // will result in the token foo__LINE__, instead of foo followed by
73
+ // the current line number. For more details, see
74
+ // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
75
+ #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
76
+ #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
77
+
78
+ // Stringifies its argument.
79
+ #define GTEST_STRINGIFY_(name) #name
80
+
81
+ class ProtocolMessage;
82
+ namespace proto2 { class Message; }
83
+
84
+ namespace testing {
85
+
86
+ // Forward declarations.
87
+
88
+ class AssertionResult; // Result of an assertion.
89
+ class Message; // Represents a failure message.
90
+ class Test; // Represents a test.
91
+ class TestInfo; // Information about a test.
92
+ class TestPartResult; // Result of a test part.
93
+ class UnitTest; // A collection of test cases.
94
+
95
+ template <typename T>
96
+ ::std::string PrintToString(const T& value);
97
+
98
+ namespace internal {
99
+
100
+ struct TraceInfo; // Information about a trace point.
101
+ class TestInfoImpl; // Opaque implementation of TestInfo
102
+ class UnitTestImpl; // Opaque implementation of UnitTest
103
+
104
+ // The text used in failure messages to indicate the start of the
105
+ // stack trace.
106
+ GTEST_API_ extern const char kStackTraceMarker[];
107
+
108
+ // Two overloaded helpers for checking at compile time whether an
109
+ // expression is a null pointer literal (i.e. NULL or any 0-valued
110
+ // compile-time integral constant). Their return values have
111
+ // different sizes, so we can use sizeof() to test which version is
112
+ // picked by the compiler. These helpers have no implementations, as
113
+ // we only need their signatures.
114
+ //
115
+ // Given IsNullLiteralHelper(x), the compiler will pick the first
116
+ // version if x can be implicitly converted to Secret*, and pick the
117
+ // second version otherwise. Since Secret is a secret and incomplete
118
+ // type, the only expression a user can write that has type Secret* is
119
+ // a null pointer literal. Therefore, we know that x is a null
120
+ // pointer literal if and only if the first version is picked by the
121
+ // compiler.
122
+ char IsNullLiteralHelper(Secret* p);
123
+ char (&IsNullLiteralHelper(...))[2]; // NOLINT
124
+
125
+ // A compile-time bool constant that is true if and only if x is a
126
+ // null pointer literal (i.e. NULL or any 0-valued compile-time
127
+ // integral constant).
128
+ #ifdef GTEST_ELLIPSIS_NEEDS_POD_
129
+ // We lose support for NULL detection where the compiler doesn't like
130
+ // passing non-POD classes through ellipsis (...).
131
+ # define GTEST_IS_NULL_LITERAL_(x) false
132
+ #else
133
+ # define GTEST_IS_NULL_LITERAL_(x) \
134
+ (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
135
+ #endif // GTEST_ELLIPSIS_NEEDS_POD_
136
+
137
+ // Appends the user-supplied message to the Google-Test-generated message.
138
+ GTEST_API_ std::string AppendUserMessage(
139
+ const std::string& gtest_msg, const Message& user_msg);
140
+
141
+ #if GTEST_HAS_EXCEPTIONS
142
+
143
+ // This exception is thrown by (and only by) a failed Google Test
144
+ // assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
145
+ // are enabled). We derive it from std::runtime_error, which is for
146
+ // errors presumably detectable only at run time. Since
147
+ // std::runtime_error inherits from std::exception, many testing
148
+ // frameworks know how to extract and print the message inside it.
149
+ class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
150
+ public:
151
+ explicit GoogleTestFailureException(const TestPartResult& failure);
152
+ };
153
+
154
+ #endif // GTEST_HAS_EXCEPTIONS
155
+
156
+ namespace edit_distance {
157
+ // Returns the optimal edits to go from 'left' to 'right'.
158
+ // All edits cost the same, with replace having lower priority than
159
+ // add/remove.
160
+ // Simple implementation of the Wagner-Fischer algorithm.
161
+ // See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
162
+ enum EditType { kMatch, kAdd, kRemove, kReplace };
163
+ GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
164
+ const std::vector<size_t>& left, const std::vector<size_t>& right);
165
+
166
+ // Same as above, but the input is represented as strings.
167
+ GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
168
+ const std::vector<std::string>& left,
169
+ const std::vector<std::string>& right);
170
+
171
+ // Create a diff of the input strings in Unified diff format.
172
+ GTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,
173
+ const std::vector<std::string>& right,
174
+ size_t context = 2);
175
+
176
+ } // namespace edit_distance
177
+
178
+ // Calculate the diff between 'left' and 'right' and return it in unified diff
179
+ // format.
180
+ // If not null, stores in 'total_line_count' the total number of lines found
181
+ // in left + right.
182
+ GTEST_API_ std::string DiffStrings(const std::string& left,
183
+ const std::string& right,
184
+ size_t* total_line_count);
185
+
186
+ // Constructs and returns the message for an equality assertion
187
+ // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
188
+ //
189
+ // The first four parameters are the expressions used in the assertion
190
+ // and their values, as strings. For example, for ASSERT_EQ(foo, bar)
191
+ // where foo is 5 and bar is 6, we have:
192
+ //
193
+ // expected_expression: "foo"
194
+ // actual_expression: "bar"
195
+ // expected_value: "5"
196
+ // actual_value: "6"
197
+ //
198
+ // The ignoring_case parameter is true iff the assertion is a
199
+ // *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
200
+ // be inserted into the message.
201
+ GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
202
+ const char* actual_expression,
203
+ const std::string& expected_value,
204
+ const std::string& actual_value,
205
+ bool ignoring_case);
206
+
207
+ // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
208
+ GTEST_API_ std::string GetBoolAssertionFailureMessage(
209
+ const AssertionResult& assertion_result,
210
+ const char* expression_text,
211
+ const char* actual_predicate_value,
212
+ const char* expected_predicate_value);
213
+
214
+ // This template class represents an IEEE floating-point number
215
+ // (either single-precision or double-precision, depending on the
216
+ // template parameters).
217
+ //
218
+ // The purpose of this class is to do more sophisticated number
219
+ // comparison. (Due to round-off error, etc, it's very unlikely that
220
+ // two floating-points will be equal exactly. Hence a naive
221
+ // comparison by the == operation often doesn't work.)
222
+ //
223
+ // Format of IEEE floating-point:
224
+ //
225
+ // The most-significant bit being the leftmost, an IEEE
226
+ // floating-point looks like
227
+ //
228
+ // sign_bit exponent_bits fraction_bits
229
+ //
230
+ // Here, sign_bit is a single bit that designates the sign of the
231
+ // number.
232
+ //
233
+ // For float, there are 8 exponent bits and 23 fraction bits.
234
+ //
235
+ // For double, there are 11 exponent bits and 52 fraction bits.
236
+ //
237
+ // More details can be found at
238
+ // http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
239
+ //
240
+ // Template parameter:
241
+ //
242
+ // RawType: the raw floating-point type (either float or double)
243
+ template <typename RawType>
244
+ class FloatingPoint {
245
+ public:
246
+ // Defines the unsigned integer type that has the same size as the
247
+ // floating point number.
248
+ typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
249
+
250
+ // Constants.
251
+
252
+ // # of bits in a number.
253
+ static const size_t kBitCount = 8*sizeof(RawType);
254
+
255
+ // # of fraction bits in a number.
256
+ static const size_t kFractionBitCount =
257
+ std::numeric_limits<RawType>::digits - 1;
258
+
259
+ // # of exponent bits in a number.
260
+ static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
261
+
262
+ // The mask for the sign bit.
263
+ static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
264
+
265
+ // The mask for the fraction bits.
266
+ static const Bits kFractionBitMask =
267
+ ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
268
+
269
+ // The mask for the exponent bits.
270
+ static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
271
+
272
+ // How many ULP's (Units in the Last Place) we want to tolerate when
273
+ // comparing two numbers. The larger the value, the more error we
274
+ // allow. A 0 value means that two numbers must be exactly the same
275
+ // to be considered equal.
276
+ //
277
+ // The maximum error of a single floating-point operation is 0.5
278
+ // units in the last place. On Intel CPU's, all floating-point
279
+ // calculations are done with 80-bit precision, while double has 64
280
+ // bits. Therefore, 4 should be enough for ordinary use.
281
+ //
282
+ // See the following article for more details on ULP:
283
+ // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
284
+ static const size_t kMaxUlps = 4;
285
+
286
+ // Constructs a FloatingPoint from a raw floating-point number.
287
+ //
288
+ // On an Intel CPU, passing a non-normalized NAN (Not a Number)
289
+ // around may change its bits, although the new value is guaranteed
290
+ // to be also a NAN. Therefore, don't expect this constructor to
291
+ // preserve the bits in x when x is a NAN.
292
+ explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
293
+
294
+ // Static methods
295
+
296
+ // Reinterprets a bit pattern as a floating-point number.
297
+ //
298
+ // This function is needed to test the AlmostEquals() method.
299
+ static RawType ReinterpretBits(const Bits bits) {
300
+ FloatingPoint fp(0);
301
+ fp.u_.bits_ = bits;
302
+ return fp.u_.value_;
303
+ }
304
+
305
+ // Returns the floating-point number that represent positive infinity.
306
+ static RawType Infinity() {
307
+ return ReinterpretBits(kExponentBitMask);
308
+ }
309
+
310
+ // Returns the maximum representable finite floating-point number.
311
+ static RawType Max();
312
+
313
+ // Non-static methods
314
+
315
+ // Returns the bits that represents this number.
316
+ const Bits &bits() const { return u_.bits_; }
317
+
318
+ // Returns the exponent bits of this number.
319
+ Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
320
+
321
+ // Returns the fraction bits of this number.
322
+ Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
323
+
324
+ // Returns the sign bit of this number.
325
+ Bits sign_bit() const { return kSignBitMask & u_.bits_; }
326
+
327
+ // Returns true iff this is NAN (not a number).
328
+ bool is_nan() const {
329
+ // It's a NAN if the exponent bits are all ones and the fraction
330
+ // bits are not entirely zeros.
331
+ return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
332
+ }
333
+
334
+ // Returns true iff this number is at most kMaxUlps ULP's away from
335
+ // rhs. In particular, this function:
336
+ //
337
+ // - returns false if either number is (or both are) NAN.
338
+ // - treats really large numbers as almost equal to infinity.
339
+ // - thinks +0.0 and -0.0 are 0 DLP's apart.
340
+ bool AlmostEquals(const FloatingPoint& rhs) const {
341
+ // The IEEE standard says that any comparison operation involving
342
+ // a NAN must return false.
343
+ if (is_nan() || rhs.is_nan()) return false;
344
+
345
+ return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
346
+ <= kMaxUlps;
347
+ }
348
+
349
+ private:
350
+ // The data type used to store the actual floating-point number.
351
+ union FloatingPointUnion {
352
+ RawType value_; // The raw floating-point number.
353
+ Bits bits_; // The bits that represent the number.
354
+ };
355
+
356
+ // Converts an integer from the sign-and-magnitude representation to
357
+ // the biased representation. More precisely, let N be 2 to the
358
+ // power of (kBitCount - 1), an integer x is represented by the
359
+ // unsigned number x + N.
360
+ //
361
+ // For instance,
362
+ //
363
+ // -N + 1 (the most negative number representable using
364
+ // sign-and-magnitude) is represented by 1;
365
+ // 0 is represented by N; and
366
+ // N - 1 (the biggest number representable using
367
+ // sign-and-magnitude) is represented by 2N - 1.
368
+ //
369
+ // Read http://en.wikipedia.org/wiki/Signed_number_representations
370
+ // for more details on signed number representations.
371
+ static Bits SignAndMagnitudeToBiased(const Bits &sam) {
372
+ if (kSignBitMask & sam) {
373
+ // sam represents a negative number.
374
+ return ~sam + 1;
375
+ } else {
376
+ // sam represents a positive number.
377
+ return kSignBitMask | sam;
378
+ }
379
+ }
380
+
381
+ // Given two numbers in the sign-and-magnitude representation,
382
+ // returns the distance between them as an unsigned number.
383
+ static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
384
+ const Bits &sam2) {
385
+ const Bits biased1 = SignAndMagnitudeToBiased(sam1);
386
+ const Bits biased2 = SignAndMagnitudeToBiased(sam2);
387
+ return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
388
+ }
389
+
390
+ FloatingPointUnion u_;
391
+ };
392
+
393
+ // We cannot use std::numeric_limits<T>::max() as it clashes with the max()
394
+ // macro defined by <windows.h>.
395
+ template <>
396
+ inline float FloatingPoint<float>::Max() { return FLT_MAX; }
397
+ template <>
398
+ inline double FloatingPoint<double>::Max() { return DBL_MAX; }
399
+
400
+ // Typedefs the instances of the FloatingPoint template class that we
401
+ // care to use.
402
+ typedef FloatingPoint<float> Float;
403
+ typedef FloatingPoint<double> Double;
404
+
405
+ // In order to catch the mistake of putting tests that use different
406
+ // test fixture classes in the same test case, we need to assign
407
+ // unique IDs to fixture classes and compare them. The TypeId type is
408
+ // used to hold such IDs. The user should treat TypeId as an opaque
409
+ // type: the only operation allowed on TypeId values is to compare
410
+ // them for equality using the == operator.
411
+ typedef const void* TypeId;
412
+
413
+ template <typename T>
414
+ class TypeIdHelper {
415
+ public:
416
+ // dummy_ must not have a const type. Otherwise an overly eager
417
+ // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
418
+ // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
419
+ static bool dummy_;
420
+ };
421
+
422
+ template <typename T>
423
+ bool TypeIdHelper<T>::dummy_ = false;
424
+
425
+ // GetTypeId<T>() returns the ID of type T. Different values will be
426
+ // returned for different types. Calling the function twice with the
427
+ // same type argument is guaranteed to return the same ID.
428
+ template <typename T>
429
+ TypeId GetTypeId() {
430
+ // The compiler is required to allocate a different
431
+ // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
432
+ // the template. Therefore, the address of dummy_ is guaranteed to
433
+ // be unique.
434
+ return &(TypeIdHelper<T>::dummy_);
435
+ }
436
+
437
+ // Returns the type ID of ::testing::Test. Always call this instead
438
+ // of GetTypeId< ::testing::Test>() to get the type ID of
439
+ // ::testing::Test, as the latter may give the wrong result due to a
440
+ // suspected linker bug when compiling Google Test as a Mac OS X
441
+ // framework.
442
+ GTEST_API_ TypeId GetTestTypeId();
443
+
444
+ // Defines the abstract factory interface that creates instances
445
+ // of a Test object.
446
+ class TestFactoryBase {
447
+ public:
448
+ virtual ~TestFactoryBase() {}
449
+
450
+ // Creates a test instance to run. The instance is both created and destroyed
451
+ // within TestInfoImpl::Run()
452
+ virtual Test* CreateTest() = 0;
453
+
454
+ protected:
455
+ TestFactoryBase() {}
456
+
457
+ private:
458
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
459
+ };
460
+
461
+ // This class provides implementation of TeastFactoryBase interface.
462
+ // It is used in TEST and TEST_F macros.
463
+ template <class TestClass>
464
+ class TestFactoryImpl : public TestFactoryBase {
465
+ public:
466
+ virtual Test* CreateTest() { return new TestClass; }
467
+ };
468
+
469
+ #if GTEST_OS_WINDOWS
470
+
471
+ // Predicate-formatters for implementing the HRESULT checking macros
472
+ // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
473
+ // We pass a long instead of HRESULT to avoid causing an
474
+ // include dependency for the HRESULT type.
475
+ GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
476
+ long hr); // NOLINT
477
+ GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
478
+ long hr); // NOLINT
479
+
480
+ #endif // GTEST_OS_WINDOWS
481
+
482
+ // Types of SetUpTestCase() and TearDownTestCase() functions.
483
+ typedef void (*SetUpTestCaseFunc)();
484
+ typedef void (*TearDownTestCaseFunc)();
485
+
486
+ struct CodeLocation {
487
+ CodeLocation(const std::string& a_file, int a_line)
488
+ : file(a_file), line(a_line) {}
489
+
490
+ std::string file;
491
+ int line;
492
+ };
493
+
494
+ // Creates a new TestInfo object and registers it with Google Test;
495
+ // returns the created object.
496
+ //
497
+ // Arguments:
498
+ //
499
+ // test_case_name: name of the test case
500
+ // name: name of the test
501
+ // type_param the name of the test's type parameter, or NULL if
502
+ // this is not a typed or a type-parameterized test.
503
+ // value_param text representation of the test's value parameter,
504
+ // or NULL if this is not a type-parameterized test.
505
+ // code_location: code location where the test is defined
506
+ // fixture_class_id: ID of the test fixture class
507
+ // set_up_tc: pointer to the function that sets up the test case
508
+ // tear_down_tc: pointer to the function that tears down the test case
509
+ // factory: pointer to the factory that creates a test object.
510
+ // The newly created TestInfo instance will assume
511
+ // ownership of the factory object.
512
+ GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
513
+ const char* test_case_name,
514
+ const char* name,
515
+ const char* type_param,
516
+ const char* value_param,
517
+ CodeLocation code_location,
518
+ TypeId fixture_class_id,
519
+ SetUpTestCaseFunc set_up_tc,
520
+ TearDownTestCaseFunc tear_down_tc,
521
+ TestFactoryBase* factory);
522
+
523
+ // If *pstr starts with the given prefix, modifies *pstr to be right
524
+ // past the prefix and returns true; otherwise leaves *pstr unchanged
525
+ // and returns false. None of pstr, *pstr, and prefix can be NULL.
526
+ GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
527
+
528
+ #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
529
+
530
+ // State of the definition of a type-parameterized test case.
531
+ class GTEST_API_ TypedTestCasePState {
532
+ public:
533
+ TypedTestCasePState() : registered_(false) {}
534
+
535
+ // Adds the given test name to defined_test_names_ and return true
536
+ // if the test case hasn't been registered; otherwise aborts the
537
+ // program.
538
+ bool AddTestName(const char* file, int line, const char* case_name,
539
+ const char* test_name) {
540
+ if (registered_) {
541
+ fprintf(stderr, "%s Test %s must be defined before "
542
+ "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
543
+ FormatFileLocation(file, line).c_str(), test_name, case_name);
544
+ fflush(stderr);
545
+ posix::Abort();
546
+ }
547
+ registered_tests_.insert(
548
+ ::std::make_pair(test_name, CodeLocation(file, line)));
549
+ return true;
550
+ }
551
+
552
+ bool TestExists(const std::string& test_name) const {
553
+ return registered_tests_.count(test_name) > 0;
554
+ }
555
+
556
+ const CodeLocation& GetCodeLocation(const std::string& test_name) const {
557
+ RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
558
+ GTEST_CHECK_(it != registered_tests_.end());
559
+ return it->second;
560
+ }
561
+
562
+ // Verifies that registered_tests match the test names in
563
+ // defined_test_names_; returns registered_tests if successful, or
564
+ // aborts the program otherwise.
565
+ const char* VerifyRegisteredTestNames(
566
+ const char* file, int line, const char* registered_tests);
567
+
568
+ private:
569
+ typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;
570
+
571
+ bool registered_;
572
+ RegisteredTestsMap registered_tests_;
573
+ };
574
+
575
+ // Skips to the first non-space char after the first comma in 'str';
576
+ // returns NULL if no comma is found in 'str'.
577
+ inline const char* SkipComma(const char* str) {
578
+ const char* comma = strchr(str, ',');
579
+ if (comma == NULL) {
580
+ return NULL;
581
+ }
582
+ while (IsSpace(*(++comma))) {}
583
+ return comma;
584
+ }
585
+
586
+ // Returns the prefix of 'str' before the first comma in it; returns
587
+ // the entire string if it contains no comma.
588
+ inline std::string GetPrefixUntilComma(const char* str) {
589
+ const char* comma = strchr(str, ',');
590
+ return comma == NULL ? str : std::string(str, comma);
591
+ }
592
+
593
+ // Splits a given string on a given delimiter, populating a given
594
+ // vector with the fields.
595
+ void SplitString(const ::std::string& str, char delimiter,
596
+ ::std::vector< ::std::string>* dest);
597
+
598
+ // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
599
+ // registers a list of type-parameterized tests with Google Test. The
600
+ // return value is insignificant - we just need to return something
601
+ // such that we can call this function in a namespace scope.
602
+ //
603
+ // Implementation note: The GTEST_TEMPLATE_ macro declares a template
604
+ // template parameter. It's defined in gtest-type-util.h.
605
+ template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
606
+ class TypeParameterizedTest {
607
+ public:
608
+ // 'index' is the index of the test in the type list 'Types'
609
+ // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
610
+ // Types). Valid values for 'index' are [0, N - 1] where N is the
611
+ // length of Types.
612
+ static bool Register(const char* prefix,
613
+ const CodeLocation& code_location,
614
+ const char* case_name, const char* test_names,
615
+ int index) {
616
+ typedef typename Types::Head Type;
617
+ typedef Fixture<Type> FixtureClass;
618
+ typedef typename GTEST_BIND_(TestSel, Type) TestClass;
619
+
620
+ // First, registers the first type-parameterized test in the type
621
+ // list.
622
+ MakeAndRegisterTestInfo(
623
+ (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
624
+ + StreamableToString(index)).c_str(),
625
+ StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
626
+ GetTypeName<Type>().c_str(),
627
+ NULL, // No value parameter.
628
+ code_location,
629
+ GetTypeId<FixtureClass>(),
630
+ TestClass::SetUpTestCase,
631
+ TestClass::TearDownTestCase,
632
+ new TestFactoryImpl<TestClass>);
633
+
634
+ // Next, recurses (at compile time) with the tail of the type list.
635
+ return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
636
+ ::Register(prefix, code_location, case_name, test_names, index + 1);
637
+ }
638
+ };
639
+
640
+ // The base case for the compile time recursion.
641
+ template <GTEST_TEMPLATE_ Fixture, class TestSel>
642
+ class TypeParameterizedTest<Fixture, TestSel, Types0> {
643
+ public:
644
+ static bool Register(const char* /*prefix*/, const CodeLocation&,
645
+ const char* /*case_name*/, const char* /*test_names*/,
646
+ int /*index*/) {
647
+ return true;
648
+ }
649
+ };
650
+
651
+ // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
652
+ // registers *all combinations* of 'Tests' and 'Types' with Google
653
+ // Test. The return value is insignificant - we just need to return
654
+ // something such that we can call this function in a namespace scope.
655
+ template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
656
+ class TypeParameterizedTestCase {
657
+ public:
658
+ static bool Register(const char* prefix, CodeLocation code_location,
659
+ const TypedTestCasePState* state,
660
+ const char* case_name, const char* test_names) {
661
+ std::string test_name = StripTrailingSpaces(
662
+ GetPrefixUntilComma(test_names));
663
+ if (!state->TestExists(test_name)) {
664
+ fprintf(stderr, "Failed to get code location for test %s.%s at %s.",
665
+ case_name, test_name.c_str(),
666
+ FormatFileLocation(code_location.file.c_str(),
667
+ code_location.line).c_str());
668
+ fflush(stderr);
669
+ posix::Abort();
670
+ }
671
+ const CodeLocation& test_location = state->GetCodeLocation(test_name);
672
+
673
+ typedef typename Tests::Head Head;
674
+
675
+ // First, register the first test in 'Test' for each type in 'Types'.
676
+ TypeParameterizedTest<Fixture, Head, Types>::Register(
677
+ prefix, test_location, case_name, test_names, 0);
678
+
679
+ // Next, recurses (at compile time) with the tail of the test list.
680
+ return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
681
+ ::Register(prefix, code_location, state,
682
+ case_name, SkipComma(test_names));
683
+ }
684
+ };
685
+
686
+ // The base case for the compile time recursion.
687
+ template <GTEST_TEMPLATE_ Fixture, typename Types>
688
+ class TypeParameterizedTestCase<Fixture, Templates0, Types> {
689
+ public:
690
+ static bool Register(const char* /*prefix*/, const CodeLocation&,
691
+ const TypedTestCasePState* /*state*/,
692
+ const char* /*case_name*/, const char* /*test_names*/) {
693
+ return true;
694
+ }
695
+ };
696
+
697
+ #endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
698
+
699
+ // Returns the current OS stack trace as an std::string.
700
+ //
701
+ // The maximum number of stack frames to be included is specified by
702
+ // the gtest_stack_trace_depth flag. The skip_count parameter
703
+ // specifies the number of top frames to be skipped, which doesn't
704
+ // count against the number of frames to be included.
705
+ //
706
+ // For example, if Foo() calls Bar(), which in turn calls
707
+ // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
708
+ // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
709
+ GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
710
+ UnitTest* unit_test, int skip_count);
711
+
712
+ // Helpers for suppressing warnings on unreachable code or constant
713
+ // condition.
714
+
715
+ // Always returns true.
716
+ GTEST_API_ bool AlwaysTrue();
717
+
718
+ // Always returns false.
719
+ inline bool AlwaysFalse() { return !AlwaysTrue(); }
720
+
721
+ // Helper for suppressing false warning from Clang on a const char*
722
+ // variable declared in a conditional expression always being NULL in
723
+ // the else branch.
724
+ struct GTEST_API_ ConstCharPtr {
725
+ ConstCharPtr(const char* str) : value(str) {}
726
+ operator bool() const { return true; }
727
+ const char* value;
728
+ };
729
+
730
+ // A simple Linear Congruential Generator for generating random
731
+ // numbers with a uniform distribution. Unlike rand() and srand(), it
732
+ // doesn't use global state (and therefore can't interfere with user
733
+ // code). Unlike rand_r(), it's portable. An LCG isn't very random,
734
+ // but it's good enough for our purposes.
735
+ class GTEST_API_ Random {
736
+ public:
737
+ static const UInt32 kMaxRange = 1u << 31;
738
+
739
+ explicit Random(UInt32 seed) : state_(seed) {}
740
+
741
+ void Reseed(UInt32 seed) { state_ = seed; }
742
+
743
+ // Generates a random number from [0, range). Crashes if 'range' is
744
+ // 0 or greater than kMaxRange.
745
+ UInt32 Generate(UInt32 range);
746
+
747
+ private:
748
+ UInt32 state_;
749
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
750
+ };
751
+
752
+ // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
753
+ // compiler error iff T1 and T2 are different types.
754
+ template <typename T1, typename T2>
755
+ struct CompileAssertTypesEqual;
756
+
757
+ template <typename T>
758
+ struct CompileAssertTypesEqual<T, T> {
759
+ };
760
+
761
+ // Removes the reference from a type if it is a reference type,
762
+ // otherwise leaves it unchanged. This is the same as
763
+ // tr1::remove_reference, which is not widely available yet.
764
+ template <typename T>
765
+ struct RemoveReference { typedef T type; }; // NOLINT
766
+ template <typename T>
767
+ struct RemoveReference<T&> { typedef T type; }; // NOLINT
768
+
769
+ // A handy wrapper around RemoveReference that works when the argument
770
+ // T depends on template parameters.
771
+ #define GTEST_REMOVE_REFERENCE_(T) \
772
+ typename ::testing::internal::RemoveReference<T>::type
773
+
774
+ // Removes const from a type if it is a const type, otherwise leaves
775
+ // it unchanged. This is the same as tr1::remove_const, which is not
776
+ // widely available yet.
777
+ template <typename T>
778
+ struct RemoveConst { typedef T type; }; // NOLINT
779
+ template <typename T>
780
+ struct RemoveConst<const T> { typedef T type; }; // NOLINT
781
+
782
+ // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
783
+ // definition to fail to remove the const in 'const int[3]' and 'const
784
+ // char[3][4]'. The following specialization works around the bug.
785
+ template <typename T, size_t N>
786
+ struct RemoveConst<const T[N]> {
787
+ typedef typename RemoveConst<T>::type type[N];
788
+ };
789
+
790
+ #if defined(_MSC_VER) && _MSC_VER < 1400
791
+ // This is the only specialization that allows VC++ 7.1 to remove const in
792
+ // 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC
793
+ // and thus needs to be conditionally compiled.
794
+ template <typename T, size_t N>
795
+ struct RemoveConst<T[N]> {
796
+ typedef typename RemoveConst<T>::type type[N];
797
+ };
798
+ #endif
799
+
800
+ // A handy wrapper around RemoveConst that works when the argument
801
+ // T depends on template parameters.
802
+ #define GTEST_REMOVE_CONST_(T) \
803
+ typename ::testing::internal::RemoveConst<T>::type
804
+
805
+ // Turns const U&, U&, const U, and U all into U.
806
+ #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
807
+ GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
808
+
809
+ // ImplicitlyConvertible<From, To>::value is a compile-time bool
810
+ // constant that's true iff type From can be implicitly converted to
811
+ // type To.
812
+ template <typename From, typename To>
813
+ class ImplicitlyConvertible {
814
+ private:
815
+ // We need the following helper functions only for their types.
816
+ // They have no implementations.
817
+
818
+ // MakeFrom() is an expression whose type is From. We cannot simply
819
+ // use From(), as the type From may not have a public default
820
+ // constructor.
821
+ static typename AddReference<From>::type MakeFrom();
822
+
823
+ // These two functions are overloaded. Given an expression
824
+ // Helper(x), the compiler will pick the first version if x can be
825
+ // implicitly converted to type To; otherwise it will pick the
826
+ // second version.
827
+ //
828
+ // The first version returns a value of size 1, and the second
829
+ // version returns a value of size 2. Therefore, by checking the
830
+ // size of Helper(x), which can be done at compile time, we can tell
831
+ // which version of Helper() is used, and hence whether x can be
832
+ // implicitly converted to type To.
833
+ static char Helper(To);
834
+ static char (&Helper(...))[2]; // NOLINT
835
+
836
+ // We have to put the 'public' section after the 'private' section,
837
+ // or MSVC refuses to compile the code.
838
+ public:
839
+ #if defined(__BORLANDC__)
840
+ // C++Builder cannot use member overload resolution during template
841
+ // instantiation. The simplest workaround is to use its C++0x type traits
842
+ // functions (C++Builder 2009 and above only).
843
+ static const bool value = __is_convertible(From, To);
844
+ #else
845
+ // MSVC warns about implicitly converting from double to int for
846
+ // possible loss of data, so we need to temporarily disable the
847
+ // warning.
848
+ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
849
+ static const bool value =
850
+ sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
851
+ GTEST_DISABLE_MSC_WARNINGS_POP_()
852
+ #endif // __BORLANDC__
853
+ };
854
+ template <typename From, typename To>
855
+ const bool ImplicitlyConvertible<From, To>::value;
856
+
857
+ // IsAProtocolMessage<T>::value is a compile-time bool constant that's
858
+ // true iff T is type ProtocolMessage, proto2::Message, or a subclass
859
+ // of those.
860
+ template <typename T>
861
+ struct IsAProtocolMessage
862
+ : public bool_constant<
863
+ ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
864
+ ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
865
+ };
866
+
867
+ // When the compiler sees expression IsContainerTest<C>(0), if C is an
868
+ // STL-style container class, the first overload of IsContainerTest
869
+ // will be viable (since both C::iterator* and C::const_iterator* are
870
+ // valid types and NULL can be implicitly converted to them). It will
871
+ // be picked over the second overload as 'int' is a perfect match for
872
+ // the type of argument 0. If C::iterator or C::const_iterator is not
873
+ // a valid type, the first overload is not viable, and the second
874
+ // overload will be picked. Therefore, we can determine whether C is
875
+ // a container class by checking the type of IsContainerTest<C>(0).
876
+ // The value of the expression is insignificant.
877
+ //
878
+ // In C++11 mode we check the existence of a const_iterator and that an
879
+ // iterator is properly implemented for the container.
880
+ //
881
+ // For pre-C++11 that we look for both C::iterator and C::const_iterator.
882
+ // The reason is that C++ injects the name of a class as a member of the
883
+ // class itself (e.g. you can refer to class iterator as either
884
+ // 'iterator' or 'iterator::iterator'). If we look for C::iterator
885
+ // only, for example, we would mistakenly think that a class named
886
+ // iterator is an STL container.
887
+ //
888
+ // Also note that the simpler approach of overloading
889
+ // IsContainerTest(typename C::const_iterator*) and
890
+ // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
891
+ typedef int IsContainer;
892
+ #if GTEST_LANG_CXX11
893
+ template <class C,
894
+ class Iterator = decltype(::std::declval<const C&>().begin()),
895
+ class = decltype(::std::declval<const C&>().end()),
896
+ class = decltype(++::std::declval<Iterator&>()),
897
+ class = decltype(*::std::declval<Iterator>()),
898
+ class = typename C::const_iterator>
899
+ IsContainer IsContainerTest(int /* dummy */) {
900
+ return 0;
901
+ }
902
+ #else
903
+ template <class C>
904
+ IsContainer IsContainerTest(int /* dummy */,
905
+ typename C::iterator* /* it */ = NULL,
906
+ typename C::const_iterator* /* const_it */ = NULL) {
907
+ return 0;
908
+ }
909
+ #endif // GTEST_LANG_CXX11
910
+
911
+ typedef char IsNotContainer;
912
+ template <class C>
913
+ IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
914
+
915
+ // Trait to detect whether a type T is a hash table.
916
+ // The heuristic used is that the type contains an inner type `hasher` and does
917
+ // not contain an inner type `reverse_iterator`.
918
+ // If the container is iterable in reverse, then order might actually matter.
919
+ template <typename T>
920
+ struct IsHashTable {
921
+ private:
922
+ template <typename U>
923
+ static char test(typename U::hasher*, typename U::reverse_iterator*);
924
+ template <typename U>
925
+ static int test(typename U::hasher*, ...);
926
+ template <typename U>
927
+ static char test(...);
928
+
929
+ public:
930
+ static const bool value = sizeof(test<T>(0, 0)) == sizeof(int);
931
+ };
932
+
933
+ template <typename T>
934
+ const bool IsHashTable<T>::value;
935
+
936
+ template<typename T>
937
+ struct VoidT {
938
+ typedef void value_type;
939
+ };
940
+
941
+ template <typename T, typename = void>
942
+ struct HasValueType : false_type {};
943
+ template <typename T>
944
+ struct HasValueType<T, VoidT<typename T::value_type> > : true_type {
945
+ };
946
+
947
+ template <typename C,
948
+ bool = sizeof(IsContainerTest<C>(0)) == sizeof(IsContainer),
949
+ bool = HasValueType<C>::value>
950
+ struct IsRecursiveContainerImpl;
951
+
952
+ template <typename C, bool HV>
953
+ struct IsRecursiveContainerImpl<C, false, HV> : public false_type {};
954
+
955
+ // Since the IsRecursiveContainerImpl depends on the IsContainerTest we need to
956
+ // obey the same inconsistencies as the IsContainerTest, namely check if
957
+ // something is a container is relying on only const_iterator in C++11 and
958
+ // is relying on both const_iterator and iterator otherwise
959
+ template <typename C>
960
+ struct IsRecursiveContainerImpl<C, true, false> : public false_type {};
961
+
962
+ template <typename C>
963
+ struct IsRecursiveContainerImpl<C, true, true> {
964
+ #if GTEST_LANG_CXX11
965
+ typedef typename IteratorTraits<typename C::const_iterator>::value_type
966
+ value_type;
967
+ #else
968
+ typedef typename IteratorTraits<typename C::iterator>::value_type value_type;
969
+ #endif
970
+ typedef is_same<value_type, C> type;
971
+ };
972
+
973
+ // IsRecursiveContainer<Type> is a unary compile-time predicate that
974
+ // evaluates whether C is a recursive container type. A recursive container
975
+ // type is a container type whose value_type is equal to the container type
976
+ // itself. An example for a recursive container type is
977
+ // boost::filesystem::path, whose iterator has a value_type that is equal to
978
+ // boost::filesystem::path.
979
+ template <typename C>
980
+ struct IsRecursiveContainer : public IsRecursiveContainerImpl<C>::type {};
981
+
982
+ // EnableIf<condition>::type is void when 'Cond' is true, and
983
+ // undefined when 'Cond' is false. To use SFINAE to make a function
984
+ // overload only apply when a particular expression is true, add
985
+ // "typename EnableIf<expression>::type* = 0" as the last parameter.
986
+ template<bool> struct EnableIf;
987
+ template<> struct EnableIf<true> { typedef void type; }; // NOLINT
988
+
989
+ // Utilities for native arrays.
990
+
991
+ // ArrayEq() compares two k-dimensional native arrays using the
992
+ // elements' operator==, where k can be any integer >= 0. When k is
993
+ // 0, ArrayEq() degenerates into comparing a single pair of values.
994
+
995
+ template <typename T, typename U>
996
+ bool ArrayEq(const T* lhs, size_t size, const U* rhs);
997
+
998
+ // This generic version is used when k is 0.
999
+ template <typename T, typename U>
1000
+ inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
1001
+
1002
+ // This overload is used when k >= 1.
1003
+ template <typename T, typename U, size_t N>
1004
+ inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
1005
+ return internal::ArrayEq(lhs, N, rhs);
1006
+ }
1007
+
1008
+ // This helper reduces code bloat. If we instead put its logic inside
1009
+ // the previous ArrayEq() function, arrays with different sizes would
1010
+ // lead to different copies of the template code.
1011
+ template <typename T, typename U>
1012
+ bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
1013
+ for (size_t i = 0; i != size; i++) {
1014
+ if (!internal::ArrayEq(lhs[i], rhs[i]))
1015
+ return false;
1016
+ }
1017
+ return true;
1018
+ }
1019
+
1020
+ // Finds the first element in the iterator range [begin, end) that
1021
+ // equals elem. Element may be a native array type itself.
1022
+ template <typename Iter, typename Element>
1023
+ Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
1024
+ for (Iter it = begin; it != end; ++it) {
1025
+ if (internal::ArrayEq(*it, elem))
1026
+ return it;
1027
+ }
1028
+ return end;
1029
+ }
1030
+
1031
+ // CopyArray() copies a k-dimensional native array using the elements'
1032
+ // operator=, where k can be any integer >= 0. When k is 0,
1033
+ // CopyArray() degenerates into copying a single value.
1034
+
1035
+ template <typename T, typename U>
1036
+ void CopyArray(const T* from, size_t size, U* to);
1037
+
1038
+ // This generic version is used when k is 0.
1039
+ template <typename T, typename U>
1040
+ inline void CopyArray(const T& from, U* to) { *to = from; }
1041
+
1042
+ // This overload is used when k >= 1.
1043
+ template <typename T, typename U, size_t N>
1044
+ inline void CopyArray(const T(&from)[N], U(*to)[N]) {
1045
+ internal::CopyArray(from, N, *to);
1046
+ }
1047
+
1048
+ // This helper reduces code bloat. If we instead put its logic inside
1049
+ // the previous CopyArray() function, arrays with different sizes
1050
+ // would lead to different copies of the template code.
1051
+ template <typename T, typename U>
1052
+ void CopyArray(const T* from, size_t size, U* to) {
1053
+ for (size_t i = 0; i != size; i++) {
1054
+ internal::CopyArray(from[i], to + i);
1055
+ }
1056
+ }
1057
+
1058
+ // The relation between an NativeArray object (see below) and the
1059
+ // native array it represents.
1060
+ // We use 2 different structs to allow non-copyable types to be used, as long
1061
+ // as RelationToSourceReference() is passed.
1062
+ struct RelationToSourceReference {};
1063
+ struct RelationToSourceCopy {};
1064
+
1065
+ // Adapts a native array to a read-only STL-style container. Instead
1066
+ // of the complete STL container concept, this adaptor only implements
1067
+ // members useful for Google Mock's container matchers. New members
1068
+ // should be added as needed. To simplify the implementation, we only
1069
+ // support Element being a raw type (i.e. having no top-level const or
1070
+ // reference modifier). It's the client's responsibility to satisfy
1071
+ // this requirement. Element can be an array type itself (hence
1072
+ // multi-dimensional arrays are supported).
1073
+ template <typename Element>
1074
+ class NativeArray {
1075
+ public:
1076
+ // STL-style container typedefs.
1077
+ typedef Element value_type;
1078
+ typedef Element* iterator;
1079
+ typedef const Element* const_iterator;
1080
+
1081
+ // Constructs from a native array. References the source.
1082
+ NativeArray(const Element* array, size_t count, RelationToSourceReference) {
1083
+ InitRef(array, count);
1084
+ }
1085
+
1086
+ // Constructs from a native array. Copies the source.
1087
+ NativeArray(const Element* array, size_t count, RelationToSourceCopy) {
1088
+ InitCopy(array, count);
1089
+ }
1090
+
1091
+ // Copy constructor.
1092
+ NativeArray(const NativeArray& rhs) {
1093
+ (this->*rhs.clone_)(rhs.array_, rhs.size_);
1094
+ }
1095
+
1096
+ ~NativeArray() {
1097
+ if (clone_ != &NativeArray::InitRef)
1098
+ delete[] array_;
1099
+ }
1100
+
1101
+ // STL-style container methods.
1102
+ size_t size() const { return size_; }
1103
+ const_iterator begin() const { return array_; }
1104
+ const_iterator end() const { return array_ + size_; }
1105
+ bool operator==(const NativeArray& rhs) const {
1106
+ return size() == rhs.size() &&
1107
+ ArrayEq(begin(), size(), rhs.begin());
1108
+ }
1109
+
1110
+ private:
1111
+ enum {
1112
+ kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
1113
+ Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value
1114
+ };
1115
+
1116
+ // Initializes this object with a copy of the input.
1117
+ void InitCopy(const Element* array, size_t a_size) {
1118
+ Element* const copy = new Element[a_size];
1119
+ CopyArray(array, a_size, copy);
1120
+ array_ = copy;
1121
+ size_ = a_size;
1122
+ clone_ = &NativeArray::InitCopy;
1123
+ }
1124
+
1125
+ // Initializes this object with a reference of the input.
1126
+ void InitRef(const Element* array, size_t a_size) {
1127
+ array_ = array;
1128
+ size_ = a_size;
1129
+ clone_ = &NativeArray::InitRef;
1130
+ }
1131
+
1132
+ const Element* array_;
1133
+ size_t size_;
1134
+ void (NativeArray::*clone_)(const Element*, size_t);
1135
+
1136
+ GTEST_DISALLOW_ASSIGN_(NativeArray);
1137
+ };
1138
+
1139
+ } // namespace internal
1140
+ } // namespace testing
1141
+
1142
+ #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
1143
+ ::testing::internal::AssertHelper(result_type, file, line, message) \
1144
+ = ::testing::Message()
1145
+
1146
+ #define GTEST_MESSAGE_(message, result_type) \
1147
+ GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
1148
+
1149
+ #define GTEST_FATAL_FAILURE_(message) \
1150
+ return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
1151
+
1152
+ #define GTEST_NONFATAL_FAILURE_(message) \
1153
+ GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
1154
+
1155
+ #define GTEST_SUCCESS_(message) \
1156
+ GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
1157
+
1158
+ // Suppress MSVC warning 4702 (unreachable code) for the code following
1159
+ // statement if it returns or throws (or doesn't return or throw in some
1160
+ // situations).
1161
+ #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
1162
+ if (::testing::internal::AlwaysTrue()) { statement; }
1163
+
1164
+ #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
1165
+ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
1166
+ if (::testing::internal::ConstCharPtr gtest_msg = "") { \
1167
+ bool gtest_caught_expected = false; \
1168
+ try { \
1169
+ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
1170
+ } \
1171
+ catch (expected_exception const&) { \
1172
+ gtest_caught_expected = true; \
1173
+ } \
1174
+ catch (...) { \
1175
+ gtest_msg.value = \
1176
+ "Expected: " #statement " throws an exception of type " \
1177
+ #expected_exception ".\n Actual: it throws a different type."; \
1178
+ goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
1179
+ } \
1180
+ if (!gtest_caught_expected) { \
1181
+ gtest_msg.value = \
1182
+ "Expected: " #statement " throws an exception of type " \
1183
+ #expected_exception ".\n Actual: it throws nothing."; \
1184
+ goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
1185
+ } \
1186
+ } else \
1187
+ GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
1188
+ fail(gtest_msg.value)
1189
+
1190
+ #define GTEST_TEST_NO_THROW_(statement, fail) \
1191
+ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
1192
+ if (::testing::internal::AlwaysTrue()) { \
1193
+ try { \
1194
+ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
1195
+ } \
1196
+ catch (...) { \
1197
+ goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
1198
+ } \
1199
+ } else \
1200
+ GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
1201
+ fail("Expected: " #statement " doesn't throw an exception.\n" \
1202
+ " Actual: it throws.")
1203
+
1204
+ #define GTEST_TEST_ANY_THROW_(statement, fail) \
1205
+ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
1206
+ if (::testing::internal::AlwaysTrue()) { \
1207
+ bool gtest_caught_any = false; \
1208
+ try { \
1209
+ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
1210
+ } \
1211
+ catch (...) { \
1212
+ gtest_caught_any = true; \
1213
+ } \
1214
+ if (!gtest_caught_any) { \
1215
+ goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
1216
+ } \
1217
+ } else \
1218
+ GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
1219
+ fail("Expected: " #statement " throws an exception.\n" \
1220
+ " Actual: it doesn't.")
1221
+
1222
+
1223
+ // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
1224
+ // either a boolean expression or an AssertionResult. text is a textual
1225
+ // represenation of expression as it was passed into the EXPECT_TRUE.
1226
+ #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
1227
+ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
1228
+ if (const ::testing::AssertionResult gtest_ar_ = \
1229
+ ::testing::AssertionResult(expression)) \
1230
+ ; \
1231
+ else \
1232
+ fail(::testing::internal::GetBoolAssertionFailureMessage(\
1233
+ gtest_ar_, text, #actual, #expected).c_str())
1234
+
1235
+ #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
1236
+ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
1237
+ if (::testing::internal::AlwaysTrue()) { \
1238
+ ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
1239
+ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
1240
+ if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
1241
+ goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
1242
+ } \
1243
+ } else \
1244
+ GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
1245
+ fail("Expected: " #statement " doesn't generate new fatal " \
1246
+ "failures in the current thread.\n" \
1247
+ " Actual: it does.")
1248
+
1249
+ // Expands to the name of the class that implements the given test.
1250
+ #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
1251
+ test_case_name##_##test_name##_Test
1252
+
1253
+ // Helper macro for defining tests.
1254
+ #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
1255
+ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
1256
+ public:\
1257
+ GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
1258
+ private:\
1259
+ virtual void TestBody();\
1260
+ static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
1261
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(\
1262
+ GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
1263
+ };\
1264
+ \
1265
+ ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
1266
+ ::test_info_ =\
1267
+ ::testing::internal::MakeAndRegisterTestInfo(\
1268
+ #test_case_name, #test_name, NULL, NULL, \
1269
+ ::testing::internal::CodeLocation(__FILE__, __LINE__), \
1270
+ (parent_id), \
1271
+ parent_class::SetUpTestCase, \
1272
+ parent_class::TearDownTestCase, \
1273
+ new ::testing::internal::TestFactoryImpl<\
1274
+ GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
1275
+ void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
1276
+
1277
+ #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_