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,56 @@
1
+ // Copyright 2006, 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
+ // Tests that a Google Test program that has no test defined can run
31
+ // successfully.
32
+ //
33
+ // Author: wan@google.com (Zhanyong Wan)
34
+
35
+ #include "gtest/gtest.h"
36
+
37
+ int main(int argc, char **argv) {
38
+ testing::InitGoogleTest(&argc, argv);
39
+
40
+ // An ad-hoc assertion outside of all tests.
41
+ //
42
+ // This serves three purposes:
43
+ //
44
+ // 1. It verifies that an ad-hoc assertion can be executed even if
45
+ // no test is defined.
46
+ // 2. It verifies that a failed ad-hoc assertion causes the test
47
+ // program to fail.
48
+ // 3. We had a bug where the XML output won't be generated if an
49
+ // assertion is executed before RUN_ALL_TESTS() is called, even
50
+ // though --gtest_output=xml is specified. This makes sure the
51
+ // bug is fixed and doesn't regress.
52
+ EXPECT_EQ(1, 2);
53
+
54
+ // The above EXPECT_EQ() should cause RUN_ALL_TESTS() to return non-zero.
55
+ return RUN_ALL_TESTS() ? 0 : 1;
56
+ }
@@ -0,0 +1,344 @@
1
+ #!/usr/bin/env python
2
+ #
3
+ # Copyright 2008, Google Inc.
4
+ # All rights reserved.
5
+ #
6
+ # Redistribution and use in source and binary forms, with or without
7
+ # modification, are permitted provided that the following conditions are
8
+ # met:
9
+ #
10
+ # * Redistributions of source code must retain the above copyright
11
+ # notice, this list of conditions and the following disclaimer.
12
+ # * Redistributions in binary form must reproduce the above
13
+ # copyright notice, this list of conditions and the following disclaimer
14
+ # in the documentation and/or other materials provided with the
15
+ # distribution.
16
+ # * Neither the name of Google Inc. nor the names of its
17
+ # contributors may be used to endorse or promote products derived from
18
+ # this software without specific prior written permission.
19
+ #
20
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+
32
+ """Tests the text output of Google C++ Testing and Mocking Framework.
33
+
34
+
35
+ SYNOPSIS
36
+ gtest_output_test.py --build_dir=BUILD/DIR --gengolden
37
+ # where BUILD/DIR contains the built gtest_output_test_ file.
38
+ gtest_output_test.py --gengolden
39
+ gtest_output_test.py
40
+ """
41
+
42
+ __author__ = 'wan@google.com (Zhanyong Wan)'
43
+
44
+ import difflib
45
+ import os
46
+ import re
47
+ import sys
48
+ import gtest_test_utils
49
+
50
+
51
+ # The flag for generating the golden file
52
+ GENGOLDEN_FLAG = '--gengolden'
53
+ CATCH_EXCEPTIONS_ENV_VAR_NAME = 'GTEST_CATCH_EXCEPTIONS'
54
+
55
+ IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
56
+ IS_WINDOWS = os.name == 'nt'
57
+
58
+ # TODO(vladl@google.com): remove the _lin suffix.
59
+ GOLDEN_NAME = 'gtest_output_test_golden_lin.txt'
60
+
61
+ PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_output_test_')
62
+
63
+ # At least one command we exercise must not have the
64
+ # 'internal_skip_environment_and_ad_hoc_tests' argument.
65
+ COMMAND_LIST_TESTS = ({}, [PROGRAM_PATH, '--gtest_list_tests'])
66
+ COMMAND_WITH_COLOR = ({}, [PROGRAM_PATH, '--gtest_color=yes'])
67
+ COMMAND_WITH_TIME = ({}, [PROGRAM_PATH,
68
+ '--gtest_print_time',
69
+ 'internal_skip_environment_and_ad_hoc_tests',
70
+ '--gtest_filter=FatalFailureTest.*:LoggingTest.*'])
71
+ COMMAND_WITH_DISABLED = (
72
+ {}, [PROGRAM_PATH,
73
+ '--gtest_also_run_disabled_tests',
74
+ 'internal_skip_environment_and_ad_hoc_tests',
75
+ '--gtest_filter=*DISABLED_*'])
76
+ COMMAND_WITH_SHARDING = (
77
+ {'GTEST_SHARD_INDEX': '1', 'GTEST_TOTAL_SHARDS': '2'},
78
+ [PROGRAM_PATH,
79
+ 'internal_skip_environment_and_ad_hoc_tests',
80
+ '--gtest_filter=PassingTest.*'])
81
+
82
+ GOLDEN_PATH = os.path.join(gtest_test_utils.GetSourceDir(), GOLDEN_NAME)
83
+
84
+
85
+ def ToUnixLineEnding(s):
86
+ """Changes all Windows/Mac line endings in s to UNIX line endings."""
87
+
88
+ return s.replace('\r\n', '\n').replace('\r', '\n')
89
+
90
+
91
+ def RemoveLocations(test_output):
92
+ """Removes all file location info from a Google Test program's output.
93
+
94
+ Args:
95
+ test_output: the output of a Google Test program.
96
+
97
+ Returns:
98
+ output with all file location info (in the form of
99
+ 'DIRECTORY/FILE_NAME:LINE_NUMBER: 'or
100
+ 'DIRECTORY\\FILE_NAME(LINE_NUMBER): ') replaced by
101
+ 'FILE_NAME:#: '.
102
+ """
103
+
104
+ return re.sub(r'.*[/\\]((gtest_output_test_|gtest).cc)(\:\d+|\(\d+\))\: ',
105
+ r'\1:#: ', test_output)
106
+
107
+
108
+ def RemoveStackTraceDetails(output):
109
+ """Removes all stack traces from a Google Test program's output."""
110
+
111
+ # *? means "find the shortest string that matches".
112
+ return re.sub(r'Stack trace:(.|\n)*?\n\n',
113
+ 'Stack trace: (omitted)\n\n', output)
114
+
115
+
116
+ def RemoveStackTraces(output):
117
+ """Removes all traces of stack traces from a Google Test program's output."""
118
+
119
+ # *? means "find the shortest string that matches".
120
+ return re.sub(r'Stack trace:(.|\n)*?\n\n', '', output)
121
+
122
+
123
+ def RemoveTime(output):
124
+ """Removes all time information from a Google Test program's output."""
125
+
126
+ return re.sub(r'\(\d+ ms', '(? ms', output)
127
+
128
+
129
+ def RemoveTypeInfoDetails(test_output):
130
+ """Removes compiler-specific type info from Google Test program's output.
131
+
132
+ Args:
133
+ test_output: the output of a Google Test program.
134
+
135
+ Returns:
136
+ output with type information normalized to canonical form.
137
+ """
138
+
139
+ # some compilers output the name of type 'unsigned int' as 'unsigned'
140
+ return re.sub(r'unsigned int', 'unsigned', test_output)
141
+
142
+
143
+ def NormalizeToCurrentPlatform(test_output):
144
+ """Normalizes platform specific output details for easier comparison."""
145
+
146
+ if IS_WINDOWS:
147
+ # Removes the color information that is not present on Windows.
148
+ test_output = re.sub('\x1b\\[(0;3\d)?m', '', test_output)
149
+ # Changes failure message headers into the Windows format.
150
+ test_output = re.sub(r': Failure\n', r': error: ', test_output)
151
+ # Changes file(line_number) to file:line_number.
152
+ test_output = re.sub(r'((\w|\.)+)\((\d+)\):', r'\1:\3:', test_output)
153
+
154
+ return test_output
155
+
156
+
157
+ def RemoveTestCounts(output):
158
+ """Removes test counts from a Google Test program's output."""
159
+
160
+ output = re.sub(r'\d+ tests?, listed below',
161
+ '? tests, listed below', output)
162
+ output = re.sub(r'\d+ FAILED TESTS',
163
+ '? FAILED TESTS', output)
164
+ output = re.sub(r'\d+ tests? from \d+ test cases?',
165
+ '? tests from ? test cases', output)
166
+ output = re.sub(r'\d+ tests? from ([a-zA-Z_])',
167
+ r'? tests from \1', output)
168
+ return re.sub(r'\d+ tests?\.', '? tests.', output)
169
+
170
+
171
+ def RemoveMatchingTests(test_output, pattern):
172
+ """Removes output of specified tests from a Google Test program's output.
173
+
174
+ This function strips not only the beginning and the end of a test but also
175
+ all output in between.
176
+
177
+ Args:
178
+ test_output: A string containing the test output.
179
+ pattern: A regex string that matches names of test cases or
180
+ tests to remove.
181
+
182
+ Returns:
183
+ Contents of test_output with tests whose names match pattern removed.
184
+ """
185
+
186
+ test_output = re.sub(
187
+ r'.*\[ RUN \] .*%s(.|\n)*?\[( FAILED | OK )\] .*%s.*\n' % (
188
+ pattern, pattern),
189
+ '',
190
+ test_output)
191
+ return re.sub(r'.*%s.*\n' % pattern, '', test_output)
192
+
193
+
194
+ def NormalizeOutput(output):
195
+ """Normalizes output (the output of gtest_output_test_.exe)."""
196
+
197
+ output = ToUnixLineEnding(output)
198
+ output = RemoveLocations(output)
199
+ output = RemoveStackTraceDetails(output)
200
+ output = RemoveTime(output)
201
+ return output
202
+
203
+
204
+ def GetShellCommandOutput(env_cmd):
205
+ """Runs a command in a sub-process, and returns its output in a string.
206
+
207
+ Args:
208
+ env_cmd: The shell command. A 2-tuple where element 0 is a dict of extra
209
+ environment variables to set, and element 1 is a string with
210
+ the command and any flags.
211
+
212
+ Returns:
213
+ A string with the command's combined standard and diagnostic output.
214
+ """
215
+
216
+ # Spawns cmd in a sub-process, and gets its standard I/O file objects.
217
+ # Set and save the environment properly.
218
+ environ = os.environ.copy()
219
+ environ.update(env_cmd[0])
220
+ p = gtest_test_utils.Subprocess(env_cmd[1], env=environ)
221
+
222
+ return p.output
223
+
224
+
225
+ def GetCommandOutput(env_cmd):
226
+ """Runs a command and returns its output with all file location
227
+ info stripped off.
228
+
229
+ Args:
230
+ env_cmd: The shell command. A 2-tuple where element 0 is a dict of extra
231
+ environment variables to set, and element 1 is a string with
232
+ the command and any flags.
233
+ """
234
+
235
+ # Disables exception pop-ups on Windows.
236
+ environ, cmdline = env_cmd
237
+ environ = dict(environ) # Ensures we are modifying a copy.
238
+ environ[CATCH_EXCEPTIONS_ENV_VAR_NAME] = '1'
239
+ return NormalizeOutput(GetShellCommandOutput((environ, cmdline)))
240
+
241
+
242
+ def GetOutputOfAllCommands():
243
+ """Returns concatenated output from several representative commands."""
244
+
245
+ return (GetCommandOutput(COMMAND_WITH_COLOR) +
246
+ GetCommandOutput(COMMAND_WITH_TIME) +
247
+ GetCommandOutput(COMMAND_WITH_DISABLED) +
248
+ GetCommandOutput(COMMAND_WITH_SHARDING))
249
+
250
+
251
+ test_list = GetShellCommandOutput(COMMAND_LIST_TESTS)
252
+ SUPPORTS_DEATH_TESTS = 'DeathTest' in test_list
253
+ SUPPORTS_TYPED_TESTS = 'TypedTest' in test_list
254
+ SUPPORTS_THREADS = 'ExpectFailureWithThreadsTest' in test_list
255
+ SUPPORTS_STACK_TRACES = IS_LINUX
256
+
257
+ CAN_GENERATE_GOLDEN_FILE = (SUPPORTS_DEATH_TESTS and
258
+ SUPPORTS_TYPED_TESTS and
259
+ SUPPORTS_THREADS and
260
+ SUPPORTS_STACK_TRACES and
261
+ not IS_WINDOWS)
262
+
263
+ class GTestOutputTest(gtest_test_utils.TestCase):
264
+ def RemoveUnsupportedTests(self, test_output):
265
+ if not SUPPORTS_DEATH_TESTS:
266
+ test_output = RemoveMatchingTests(test_output, 'DeathTest')
267
+ if not SUPPORTS_TYPED_TESTS:
268
+ test_output = RemoveMatchingTests(test_output, 'TypedTest')
269
+ test_output = RemoveMatchingTests(test_output, 'TypedDeathTest')
270
+ test_output = RemoveMatchingTests(test_output, 'TypeParamDeathTest')
271
+ if not SUPPORTS_THREADS:
272
+ test_output = RemoveMatchingTests(test_output,
273
+ 'ExpectFailureWithThreadsTest')
274
+ test_output = RemoveMatchingTests(test_output,
275
+ 'ScopedFakeTestPartResultReporterTest')
276
+ test_output = RemoveMatchingTests(test_output,
277
+ 'WorksConcurrently')
278
+ if not SUPPORTS_STACK_TRACES:
279
+ test_output = RemoveStackTraces(test_output)
280
+
281
+ return test_output
282
+
283
+ def testOutput(self):
284
+ output = GetOutputOfAllCommands()
285
+
286
+ golden_file = open(GOLDEN_PATH, 'rb')
287
+ # A mis-configured source control system can cause \r appear in EOL
288
+ # sequences when we read the golden file irrespective of an operating
289
+ # system used. Therefore, we need to strip those \r's from newlines
290
+ # unconditionally.
291
+ golden = ToUnixLineEnding(golden_file.read())
292
+ golden_file.close()
293
+
294
+ # We want the test to pass regardless of certain features being
295
+ # supported or not.
296
+
297
+ # We still have to remove type name specifics in all cases.
298
+ normalized_actual = RemoveTypeInfoDetails(output)
299
+ normalized_golden = RemoveTypeInfoDetails(golden)
300
+
301
+ if CAN_GENERATE_GOLDEN_FILE:
302
+ self.assertEqual(normalized_golden, normalized_actual,
303
+ '\n'.join(difflib.unified_diff(
304
+ normalized_golden.split('\n'),
305
+ normalized_actual.split('\n'),
306
+ 'golden', 'actual')))
307
+ else:
308
+ normalized_actual = NormalizeToCurrentPlatform(
309
+ RemoveTestCounts(normalized_actual))
310
+ normalized_golden = NormalizeToCurrentPlatform(
311
+ RemoveTestCounts(self.RemoveUnsupportedTests(normalized_golden)))
312
+
313
+ # This code is very handy when debugging golden file differences:
314
+ if os.getenv('DEBUG_GTEST_OUTPUT_TEST'):
315
+ open(os.path.join(
316
+ gtest_test_utils.GetSourceDir(),
317
+ '_gtest_output_test_normalized_actual.txt'), 'wb').write(
318
+ normalized_actual)
319
+ open(os.path.join(
320
+ gtest_test_utils.GetSourceDir(),
321
+ '_gtest_output_test_normalized_golden.txt'), 'wb').write(
322
+ normalized_golden)
323
+
324
+ self.assertEqual(normalized_golden, normalized_actual)
325
+
326
+
327
+ if __name__ == '__main__':
328
+ if sys.argv[1:] == [GENGOLDEN_FLAG]:
329
+ if CAN_GENERATE_GOLDEN_FILE:
330
+ output = GetOutputOfAllCommands()
331
+ golden_file = open(GOLDEN_PATH, 'wb')
332
+ golden_file.write(output)
333
+ golden_file.close()
334
+ else:
335
+ message = (
336
+ """Unable to write a golden file when compiled in an environment
337
+ that does not support all the required features (death tests,
338
+ typed tests, stack traces, and multiple threads).
339
+ Please build this test and generate the golden file using Blaze on Linux.""")
340
+
341
+ sys.stderr.write(message)
342
+ sys.exit(1)
343
+ else:
344
+ gtest_test_utils.Main()
@@ -0,0 +1,1067 @@
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
+ // The purpose of this file is to generate Google Test output under
31
+ // various conditions. The output will then be verified by
32
+ // gtest_output_test.py to ensure that Google Test generates the
33
+ // desired messages. Therefore, most tests in this file are MEANT TO
34
+ // FAIL.
35
+ //
36
+ // Author: wan@google.com (Zhanyong Wan)
37
+
38
+ #include "gtest/gtest-spi.h"
39
+ #include "gtest/gtest.h"
40
+ #include "src/gtest-internal-inl.h"
41
+
42
+ #include <stdlib.h>
43
+
44
+ #if GTEST_IS_THREADSAFE
45
+ using testing::ScopedFakeTestPartResultReporter;
46
+ using testing::TestPartResultArray;
47
+
48
+ using testing::internal::Notification;
49
+ using testing::internal::ThreadWithParam;
50
+ #endif
51
+
52
+ namespace posix = ::testing::internal::posix;
53
+
54
+ // Tests catching fatal failures.
55
+
56
+ // A subroutine used by the following test.
57
+ void TestEq1(int x) {
58
+ ASSERT_EQ(1, x);
59
+ }
60
+
61
+ // This function calls a test subroutine, catches the fatal failure it
62
+ // generates, and then returns early.
63
+ void TryTestSubroutine() {
64
+ // Calls a subrountine that yields a fatal failure.
65
+ TestEq1(2);
66
+
67
+ // Catches the fatal failure and aborts the test.
68
+ //
69
+ // The testing::Test:: prefix is necessary when calling
70
+ // HasFatalFailure() outside of a TEST, TEST_F, or test fixture.
71
+ if (testing::Test::HasFatalFailure()) return;
72
+
73
+ // If we get here, something is wrong.
74
+ FAIL() << "This should never be reached.";
75
+ }
76
+
77
+ TEST(PassingTest, PassingTest1) {
78
+ }
79
+
80
+ TEST(PassingTest, PassingTest2) {
81
+ }
82
+
83
+ // Tests that parameters of failing parameterized tests are printed in the
84
+ // failing test summary.
85
+ class FailingParamTest : public testing::TestWithParam<int> {};
86
+
87
+ TEST_P(FailingParamTest, Fails) {
88
+ EXPECT_EQ(1, GetParam());
89
+ }
90
+
91
+ // This generates a test which will fail. Google Test is expected to print
92
+ // its parameter when it outputs the list of all failed tests.
93
+ INSTANTIATE_TEST_CASE_P(PrintingFailingParams,
94
+ FailingParamTest,
95
+ testing::Values(2));
96
+
97
+ static const char kGoldenString[] = "\"Line\0 1\"\nLine 2";
98
+
99
+ TEST(NonfatalFailureTest, EscapesStringOperands) {
100
+ std::string actual = "actual \"string\"";
101
+ EXPECT_EQ(kGoldenString, actual);
102
+
103
+ const char* golden = kGoldenString;
104
+ EXPECT_EQ(golden, actual);
105
+ }
106
+
107
+ TEST(NonfatalFailureTest, DiffForLongStrings) {
108
+ std::string golden_str(kGoldenString, sizeof(kGoldenString) - 1);
109
+ EXPECT_EQ(golden_str, "Line 2");
110
+ }
111
+
112
+ // Tests catching a fatal failure in a subroutine.
113
+ TEST(FatalFailureTest, FatalFailureInSubroutine) {
114
+ printf("(expecting a failure that x should be 1)\n");
115
+
116
+ TryTestSubroutine();
117
+ }
118
+
119
+ // Tests catching a fatal failure in a nested subroutine.
120
+ TEST(FatalFailureTest, FatalFailureInNestedSubroutine) {
121
+ printf("(expecting a failure that x should be 1)\n");
122
+
123
+ // Calls a subrountine that yields a fatal failure.
124
+ TryTestSubroutine();
125
+
126
+ // Catches the fatal failure and aborts the test.
127
+ //
128
+ // When calling HasFatalFailure() inside a TEST, TEST_F, or test
129
+ // fixture, the testing::Test:: prefix is not needed.
130
+ if (HasFatalFailure()) return;
131
+
132
+ // If we get here, something is wrong.
133
+ FAIL() << "This should never be reached.";
134
+ }
135
+
136
+ // Tests HasFatalFailure() after a failed EXPECT check.
137
+ TEST(FatalFailureTest, NonfatalFailureInSubroutine) {
138
+ printf("(expecting a failure on false)\n");
139
+ EXPECT_TRUE(false); // Generates a nonfatal failure
140
+ ASSERT_FALSE(HasFatalFailure()); // This should succeed.
141
+ }
142
+
143
+ // Tests interleaving user logging and Google Test assertions.
144
+ TEST(LoggingTest, InterleavingLoggingAndAssertions) {
145
+ static const int a[4] = {
146
+ 3, 9, 2, 6
147
+ };
148
+
149
+ printf("(expecting 2 failures on (3) >= (a[i]))\n");
150
+ for (int i = 0; i < static_cast<int>(sizeof(a)/sizeof(*a)); i++) {
151
+ printf("i == %d\n", i);
152
+ EXPECT_GE(3, a[i]);
153
+ }
154
+ }
155
+
156
+ // Tests the SCOPED_TRACE macro.
157
+
158
+ // A helper function for testing SCOPED_TRACE.
159
+ void SubWithoutTrace(int n) {
160
+ EXPECT_EQ(1, n);
161
+ ASSERT_EQ(2, n);
162
+ }
163
+
164
+ // Another helper function for testing SCOPED_TRACE.
165
+ void SubWithTrace(int n) {
166
+ SCOPED_TRACE(testing::Message() << "n = " << n);
167
+
168
+ SubWithoutTrace(n);
169
+ }
170
+
171
+ TEST(SCOPED_TRACETest, AcceptedValues) {
172
+ SCOPED_TRACE("literal string");
173
+ SCOPED_TRACE(std::string("std::string"));
174
+ SCOPED_TRACE(1337); // streamable type
175
+ const char* null_value = NULL;
176
+ SCOPED_TRACE(null_value);
177
+
178
+ ADD_FAILURE() << "Just checking that all these values work fine.";
179
+ }
180
+
181
+ // Tests that SCOPED_TRACE() obeys lexical scopes.
182
+ TEST(SCOPED_TRACETest, ObeysScopes) {
183
+ printf("(expected to fail)\n");
184
+
185
+ // There should be no trace before SCOPED_TRACE() is invoked.
186
+ ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
187
+
188
+ {
189
+ SCOPED_TRACE("Expected trace");
190
+ // After SCOPED_TRACE(), a failure in the current scope should contain
191
+ // the trace.
192
+ ADD_FAILURE() << "This failure is expected, and should have a trace.";
193
+ }
194
+
195
+ // Once the control leaves the scope of the SCOPED_TRACE(), there
196
+ // should be no trace again.
197
+ ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
198
+ }
199
+
200
+ // Tests that SCOPED_TRACE works inside a loop.
201
+ TEST(SCOPED_TRACETest, WorksInLoop) {
202
+ printf("(expected to fail)\n");
203
+
204
+ for (int i = 1; i <= 2; i++) {
205
+ SCOPED_TRACE(testing::Message() << "i = " << i);
206
+
207
+ SubWithoutTrace(i);
208
+ }
209
+ }
210
+
211
+ // Tests that SCOPED_TRACE works in a subroutine.
212
+ TEST(SCOPED_TRACETest, WorksInSubroutine) {
213
+ printf("(expected to fail)\n");
214
+
215
+ SubWithTrace(1);
216
+ SubWithTrace(2);
217
+ }
218
+
219
+ // Tests that SCOPED_TRACE can be nested.
220
+ TEST(SCOPED_TRACETest, CanBeNested) {
221
+ printf("(expected to fail)\n");
222
+
223
+ SCOPED_TRACE(""); // A trace without a message.
224
+
225
+ SubWithTrace(2);
226
+ }
227
+
228
+ // Tests that multiple SCOPED_TRACEs can be used in the same scope.
229
+ TEST(SCOPED_TRACETest, CanBeRepeated) {
230
+ printf("(expected to fail)\n");
231
+
232
+ SCOPED_TRACE("A");
233
+ ADD_FAILURE()
234
+ << "This failure is expected, and should contain trace point A.";
235
+
236
+ SCOPED_TRACE("B");
237
+ ADD_FAILURE()
238
+ << "This failure is expected, and should contain trace point A and B.";
239
+
240
+ {
241
+ SCOPED_TRACE("C");
242
+ ADD_FAILURE() << "This failure is expected, and should "
243
+ << "contain trace point A, B, and C.";
244
+ }
245
+
246
+ SCOPED_TRACE("D");
247
+ ADD_FAILURE() << "This failure is expected, and should "
248
+ << "contain trace point A, B, and D.";
249
+ }
250
+
251
+ #if GTEST_IS_THREADSAFE
252
+ // Tests that SCOPED_TRACE()s can be used concurrently from multiple
253
+ // threads. Namely, an assertion should be affected by
254
+ // SCOPED_TRACE()s in its own thread only.
255
+
256
+ // Here's the sequence of actions that happen in the test:
257
+ //
258
+ // Thread A (main) | Thread B (spawned)
259
+ // ===============================|================================
260
+ // spawns thread B |
261
+ // -------------------------------+--------------------------------
262
+ // waits for n1 | SCOPED_TRACE("Trace B");
263
+ // | generates failure #1
264
+ // | notifies n1
265
+ // -------------------------------+--------------------------------
266
+ // SCOPED_TRACE("Trace A"); | waits for n2
267
+ // generates failure #2 |
268
+ // notifies n2 |
269
+ // -------------------------------|--------------------------------
270
+ // waits for n3 | generates failure #3
271
+ // | trace B dies
272
+ // | generates failure #4
273
+ // | notifies n3
274
+ // -------------------------------|--------------------------------
275
+ // generates failure #5 | finishes
276
+ // trace A dies |
277
+ // generates failure #6 |
278
+ // -------------------------------|--------------------------------
279
+ // waits for thread B to finish |
280
+
281
+ struct CheckPoints {
282
+ Notification n1;
283
+ Notification n2;
284
+ Notification n3;
285
+ };
286
+
287
+ static void ThreadWithScopedTrace(CheckPoints* check_points) {
288
+ {
289
+ SCOPED_TRACE("Trace B");
290
+ ADD_FAILURE()
291
+ << "Expected failure #1 (in thread B, only trace B alive).";
292
+ check_points->n1.Notify();
293
+ check_points->n2.WaitForNotification();
294
+
295
+ ADD_FAILURE()
296
+ << "Expected failure #3 (in thread B, trace A & B both alive).";
297
+ } // Trace B dies here.
298
+ ADD_FAILURE()
299
+ << "Expected failure #4 (in thread B, only trace A alive).";
300
+ check_points->n3.Notify();
301
+ }
302
+
303
+ TEST(SCOPED_TRACETest, WorksConcurrently) {
304
+ printf("(expecting 6 failures)\n");
305
+
306
+ CheckPoints check_points;
307
+ ThreadWithParam<CheckPoints*> thread(&ThreadWithScopedTrace,
308
+ &check_points,
309
+ NULL);
310
+ check_points.n1.WaitForNotification();
311
+
312
+ {
313
+ SCOPED_TRACE("Trace A");
314
+ ADD_FAILURE()
315
+ << "Expected failure #2 (in thread A, trace A & B both alive).";
316
+ check_points.n2.Notify();
317
+ check_points.n3.WaitForNotification();
318
+
319
+ ADD_FAILURE()
320
+ << "Expected failure #5 (in thread A, only trace A alive).";
321
+ } // Trace A dies here.
322
+ ADD_FAILURE()
323
+ << "Expected failure #6 (in thread A, no trace alive).";
324
+ thread.Join();
325
+ }
326
+ #endif // GTEST_IS_THREADSAFE
327
+
328
+ // Tests basic functionality of the ScopedTrace utility (most of its features
329
+ // are already tested in SCOPED_TRACETest).
330
+ TEST(ScopedTraceTest, WithExplicitFileAndLine) {
331
+ testing::ScopedTrace trace("explicit_file.cc", 123, "expected trace message");
332
+ ADD_FAILURE() << "Check that the trace is attached to a particular location.";
333
+ }
334
+
335
+ TEST(DisabledTestsWarningTest,
336
+ DISABLED_AlsoRunDisabledTestsFlagSuppressesWarning) {
337
+ // This test body is intentionally empty. Its sole purpose is for
338
+ // verifying that the --gtest_also_run_disabled_tests flag
339
+ // suppresses the "YOU HAVE 12 DISABLED TESTS" warning at the end of
340
+ // the test output.
341
+ }
342
+
343
+ // Tests using assertions outside of TEST and TEST_F.
344
+ //
345
+ // This function creates two failures intentionally.
346
+ void AdHocTest() {
347
+ printf("The non-test part of the code is expected to have 2 failures.\n\n");
348
+ EXPECT_TRUE(false);
349
+ EXPECT_EQ(2, 3);
350
+ }
351
+
352
+ // Runs all TESTs, all TEST_Fs, and the ad hoc test.
353
+ int RunAllTests() {
354
+ AdHocTest();
355
+ return RUN_ALL_TESTS();
356
+ }
357
+
358
+ // Tests non-fatal failures in the fixture constructor.
359
+ class NonFatalFailureInFixtureConstructorTest : public testing::Test {
360
+ protected:
361
+ NonFatalFailureInFixtureConstructorTest() {
362
+ printf("(expecting 5 failures)\n");
363
+ ADD_FAILURE() << "Expected failure #1, in the test fixture c'tor.";
364
+ }
365
+
366
+ ~NonFatalFailureInFixtureConstructorTest() {
367
+ ADD_FAILURE() << "Expected failure #5, in the test fixture d'tor.";
368
+ }
369
+
370
+ virtual void SetUp() {
371
+ ADD_FAILURE() << "Expected failure #2, in SetUp().";
372
+ }
373
+
374
+ virtual void TearDown() {
375
+ ADD_FAILURE() << "Expected failure #4, in TearDown.";
376
+ }
377
+ };
378
+
379
+ TEST_F(NonFatalFailureInFixtureConstructorTest, FailureInConstructor) {
380
+ ADD_FAILURE() << "Expected failure #3, in the test body.";
381
+ }
382
+
383
+ // Tests fatal failures in the fixture constructor.
384
+ class FatalFailureInFixtureConstructorTest : public testing::Test {
385
+ protected:
386
+ FatalFailureInFixtureConstructorTest() {
387
+ printf("(expecting 2 failures)\n");
388
+ Init();
389
+ }
390
+
391
+ ~FatalFailureInFixtureConstructorTest() {
392
+ ADD_FAILURE() << "Expected failure #2, in the test fixture d'tor.";
393
+ }
394
+
395
+ virtual void SetUp() {
396
+ ADD_FAILURE() << "UNEXPECTED failure in SetUp(). "
397
+ << "We should never get here, as the test fixture c'tor "
398
+ << "had a fatal failure.";
399
+ }
400
+
401
+ virtual void TearDown() {
402
+ ADD_FAILURE() << "UNEXPECTED failure in TearDown(). "
403
+ << "We should never get here, as the test fixture c'tor "
404
+ << "had a fatal failure.";
405
+ }
406
+
407
+ private:
408
+ void Init() {
409
+ FAIL() << "Expected failure #1, in the test fixture c'tor.";
410
+ }
411
+ };
412
+
413
+ TEST_F(FatalFailureInFixtureConstructorTest, FailureInConstructor) {
414
+ ADD_FAILURE() << "UNEXPECTED failure in the test body. "
415
+ << "We should never get here, as the test fixture c'tor "
416
+ << "had a fatal failure.";
417
+ }
418
+
419
+ // Tests non-fatal failures in SetUp().
420
+ class NonFatalFailureInSetUpTest : public testing::Test {
421
+ protected:
422
+ virtual ~NonFatalFailureInSetUpTest() {
423
+ Deinit();
424
+ }
425
+
426
+ virtual void SetUp() {
427
+ printf("(expecting 4 failures)\n");
428
+ ADD_FAILURE() << "Expected failure #1, in SetUp().";
429
+ }
430
+
431
+ virtual void TearDown() {
432
+ FAIL() << "Expected failure #3, in TearDown().";
433
+ }
434
+ private:
435
+ void Deinit() {
436
+ FAIL() << "Expected failure #4, in the test fixture d'tor.";
437
+ }
438
+ };
439
+
440
+ TEST_F(NonFatalFailureInSetUpTest, FailureInSetUp) {
441
+ FAIL() << "Expected failure #2, in the test function.";
442
+ }
443
+
444
+ // Tests fatal failures in SetUp().
445
+ class FatalFailureInSetUpTest : public testing::Test {
446
+ protected:
447
+ virtual ~FatalFailureInSetUpTest() {
448
+ Deinit();
449
+ }
450
+
451
+ virtual void SetUp() {
452
+ printf("(expecting 3 failures)\n");
453
+ FAIL() << "Expected failure #1, in SetUp().";
454
+ }
455
+
456
+ virtual void TearDown() {
457
+ FAIL() << "Expected failure #2, in TearDown().";
458
+ }
459
+ private:
460
+ void Deinit() {
461
+ FAIL() << "Expected failure #3, in the test fixture d'tor.";
462
+ }
463
+ };
464
+
465
+ TEST_F(FatalFailureInSetUpTest, FailureInSetUp) {
466
+ FAIL() << "UNEXPECTED failure in the test function. "
467
+ << "We should never get here, as SetUp() failed.";
468
+ }
469
+
470
+ TEST(AddFailureAtTest, MessageContainsSpecifiedFileAndLineNumber) {
471
+ ADD_FAILURE_AT("foo.cc", 42) << "Expected failure in foo.cc";
472
+ }
473
+
474
+ #if GTEST_IS_THREADSAFE
475
+
476
+ // A unary function that may die.
477
+ void DieIf(bool should_die) {
478
+ GTEST_CHECK_(!should_die) << " - death inside DieIf().";
479
+ }
480
+
481
+ // Tests running death tests in a multi-threaded context.
482
+
483
+ // Used for coordination between the main and the spawn thread.
484
+ struct SpawnThreadNotifications {
485
+ SpawnThreadNotifications() {}
486
+
487
+ Notification spawn_thread_started;
488
+ Notification spawn_thread_ok_to_terminate;
489
+
490
+ private:
491
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(SpawnThreadNotifications);
492
+ };
493
+
494
+ // The function to be executed in the thread spawn by the
495
+ // MultipleThreads test (below).
496
+ static void ThreadRoutine(SpawnThreadNotifications* notifications) {
497
+ // Signals the main thread that this thread has started.
498
+ notifications->spawn_thread_started.Notify();
499
+
500
+ // Waits for permission to finish from the main thread.
501
+ notifications->spawn_thread_ok_to_terminate.WaitForNotification();
502
+ }
503
+
504
+ // This is a death-test test, but it's not named with a DeathTest
505
+ // suffix. It starts threads which might interfere with later
506
+ // death tests, so it must run after all other death tests.
507
+ class DeathTestAndMultiThreadsTest : public testing::Test {
508
+ protected:
509
+ // Starts a thread and waits for it to begin.
510
+ virtual void SetUp() {
511
+ thread_.reset(new ThreadWithParam<SpawnThreadNotifications*>(
512
+ &ThreadRoutine, &notifications_, NULL));
513
+ notifications_.spawn_thread_started.WaitForNotification();
514
+ }
515
+ // Tells the thread to finish, and reaps it.
516
+ // Depending on the version of the thread library in use,
517
+ // a manager thread might still be left running that will interfere
518
+ // with later death tests. This is unfortunate, but this class
519
+ // cleans up after itself as best it can.
520
+ virtual void TearDown() {
521
+ notifications_.spawn_thread_ok_to_terminate.Notify();
522
+ }
523
+
524
+ private:
525
+ SpawnThreadNotifications notifications_;
526
+ testing::internal::scoped_ptr<ThreadWithParam<SpawnThreadNotifications*> >
527
+ thread_;
528
+ };
529
+
530
+ #endif // GTEST_IS_THREADSAFE
531
+
532
+ // The MixedUpTestCaseTest test case verifies that Google Test will fail a
533
+ // test if it uses a different fixture class than what other tests in
534
+ // the same test case use. It deliberately contains two fixture
535
+ // classes with the same name but defined in different namespaces.
536
+
537
+ // The MixedUpTestCaseWithSameTestNameTest test case verifies that
538
+ // when the user defines two tests with the same test case name AND
539
+ // same test name (but in different namespaces), the second test will
540
+ // fail.
541
+
542
+ namespace foo {
543
+
544
+ class MixedUpTestCaseTest : public testing::Test {
545
+ };
546
+
547
+ TEST_F(MixedUpTestCaseTest, FirstTestFromNamespaceFoo) {}
548
+ TEST_F(MixedUpTestCaseTest, SecondTestFromNamespaceFoo) {}
549
+
550
+ class MixedUpTestCaseWithSameTestNameTest : public testing::Test {
551
+ };
552
+
553
+ TEST_F(MixedUpTestCaseWithSameTestNameTest,
554
+ TheSecondTestWithThisNameShouldFail) {}
555
+
556
+ } // namespace foo
557
+
558
+ namespace bar {
559
+
560
+ class MixedUpTestCaseTest : public testing::Test {
561
+ };
562
+
563
+ // The following two tests are expected to fail. We rely on the
564
+ // golden file to check that Google Test generates the right error message.
565
+ TEST_F(MixedUpTestCaseTest, ThisShouldFail) {}
566
+ TEST_F(MixedUpTestCaseTest, ThisShouldFailToo) {}
567
+
568
+ class MixedUpTestCaseWithSameTestNameTest : public testing::Test {
569
+ };
570
+
571
+ // Expected to fail. We rely on the golden file to check that Google Test
572
+ // generates the right error message.
573
+ TEST_F(MixedUpTestCaseWithSameTestNameTest,
574
+ TheSecondTestWithThisNameShouldFail) {}
575
+
576
+ } // namespace bar
577
+
578
+ // The following two test cases verify that Google Test catches the user
579
+ // error of mixing TEST and TEST_F in the same test case. The first
580
+ // test case checks the scenario where TEST_F appears before TEST, and
581
+ // the second one checks where TEST appears before TEST_F.
582
+
583
+ class TEST_F_before_TEST_in_same_test_case : public testing::Test {
584
+ };
585
+
586
+ TEST_F(TEST_F_before_TEST_in_same_test_case, DefinedUsingTEST_F) {}
587
+
588
+ // Expected to fail. We rely on the golden file to check that Google Test
589
+ // generates the right error message.
590
+ TEST(TEST_F_before_TEST_in_same_test_case, DefinedUsingTESTAndShouldFail) {}
591
+
592
+ class TEST_before_TEST_F_in_same_test_case : public testing::Test {
593
+ };
594
+
595
+ TEST(TEST_before_TEST_F_in_same_test_case, DefinedUsingTEST) {}
596
+
597
+ // Expected to fail. We rely on the golden file to check that Google Test
598
+ // generates the right error message.
599
+ TEST_F(TEST_before_TEST_F_in_same_test_case, DefinedUsingTEST_FAndShouldFail) {
600
+ }
601
+
602
+ // Used for testing EXPECT_NONFATAL_FAILURE() and EXPECT_FATAL_FAILURE().
603
+ int global_integer = 0;
604
+
605
+ // Tests that EXPECT_NONFATAL_FAILURE() can reference global variables.
606
+ TEST(ExpectNonfatalFailureTest, CanReferenceGlobalVariables) {
607
+ global_integer = 0;
608
+ EXPECT_NONFATAL_FAILURE({
609
+ EXPECT_EQ(1, global_integer) << "Expected non-fatal failure.";
610
+ }, "Expected non-fatal failure.");
611
+ }
612
+
613
+ // Tests that EXPECT_NONFATAL_FAILURE() can reference local variables
614
+ // (static or not).
615
+ TEST(ExpectNonfatalFailureTest, CanReferenceLocalVariables) {
616
+ int m = 0;
617
+ static int n;
618
+ n = 1;
619
+ EXPECT_NONFATAL_FAILURE({
620
+ EXPECT_EQ(m, n) << "Expected non-fatal failure.";
621
+ }, "Expected non-fatal failure.");
622
+ }
623
+
624
+ // Tests that EXPECT_NONFATAL_FAILURE() succeeds when there is exactly
625
+ // one non-fatal failure and no fatal failure.
626
+ TEST(ExpectNonfatalFailureTest, SucceedsWhenThereIsOneNonfatalFailure) {
627
+ EXPECT_NONFATAL_FAILURE({
628
+ ADD_FAILURE() << "Expected non-fatal failure.";
629
+ }, "Expected non-fatal failure.");
630
+ }
631
+
632
+ // Tests that EXPECT_NONFATAL_FAILURE() fails when there is no
633
+ // non-fatal failure.
634
+ TEST(ExpectNonfatalFailureTest, FailsWhenThereIsNoNonfatalFailure) {
635
+ printf("(expecting a failure)\n");
636
+ EXPECT_NONFATAL_FAILURE({
637
+ }, "");
638
+ }
639
+
640
+ // Tests that EXPECT_NONFATAL_FAILURE() fails when there are two
641
+ // non-fatal failures.
642
+ TEST(ExpectNonfatalFailureTest, FailsWhenThereAreTwoNonfatalFailures) {
643
+ printf("(expecting a failure)\n");
644
+ EXPECT_NONFATAL_FAILURE({
645
+ ADD_FAILURE() << "Expected non-fatal failure 1.";
646
+ ADD_FAILURE() << "Expected non-fatal failure 2.";
647
+ }, "");
648
+ }
649
+
650
+ // Tests that EXPECT_NONFATAL_FAILURE() fails when there is one fatal
651
+ // failure.
652
+ TEST(ExpectNonfatalFailureTest, FailsWhenThereIsOneFatalFailure) {
653
+ printf("(expecting a failure)\n");
654
+ EXPECT_NONFATAL_FAILURE({
655
+ FAIL() << "Expected fatal failure.";
656
+ }, "");
657
+ }
658
+
659
+ // Tests that EXPECT_NONFATAL_FAILURE() fails when the statement being
660
+ // tested returns.
661
+ TEST(ExpectNonfatalFailureTest, FailsWhenStatementReturns) {
662
+ printf("(expecting a failure)\n");
663
+ EXPECT_NONFATAL_FAILURE({
664
+ return;
665
+ }, "");
666
+ }
667
+
668
+ #if GTEST_HAS_EXCEPTIONS
669
+
670
+ // Tests that EXPECT_NONFATAL_FAILURE() fails when the statement being
671
+ // tested throws.
672
+ TEST(ExpectNonfatalFailureTest, FailsWhenStatementThrows) {
673
+ printf("(expecting a failure)\n");
674
+ try {
675
+ EXPECT_NONFATAL_FAILURE({
676
+ throw 0;
677
+ }, "");
678
+ } catch(int) { // NOLINT
679
+ }
680
+ }
681
+
682
+ #endif // GTEST_HAS_EXCEPTIONS
683
+
684
+ // Tests that EXPECT_FATAL_FAILURE() can reference global variables.
685
+ TEST(ExpectFatalFailureTest, CanReferenceGlobalVariables) {
686
+ global_integer = 0;
687
+ EXPECT_FATAL_FAILURE({
688
+ ASSERT_EQ(1, global_integer) << "Expected fatal failure.";
689
+ }, "Expected fatal failure.");
690
+ }
691
+
692
+ // Tests that EXPECT_FATAL_FAILURE() can reference local static
693
+ // variables.
694
+ TEST(ExpectFatalFailureTest, CanReferenceLocalStaticVariables) {
695
+ static int n;
696
+ n = 1;
697
+ EXPECT_FATAL_FAILURE({
698
+ ASSERT_EQ(0, n) << "Expected fatal failure.";
699
+ }, "Expected fatal failure.");
700
+ }
701
+
702
+ // Tests that EXPECT_FATAL_FAILURE() succeeds when there is exactly
703
+ // one fatal failure and no non-fatal failure.
704
+ TEST(ExpectFatalFailureTest, SucceedsWhenThereIsOneFatalFailure) {
705
+ EXPECT_FATAL_FAILURE({
706
+ FAIL() << "Expected fatal failure.";
707
+ }, "Expected fatal failure.");
708
+ }
709
+
710
+ // Tests that EXPECT_FATAL_FAILURE() fails when there is no fatal
711
+ // failure.
712
+ TEST(ExpectFatalFailureTest, FailsWhenThereIsNoFatalFailure) {
713
+ printf("(expecting a failure)\n");
714
+ EXPECT_FATAL_FAILURE({
715
+ }, "");
716
+ }
717
+
718
+ // A helper for generating a fatal failure.
719
+ void FatalFailure() {
720
+ FAIL() << "Expected fatal failure.";
721
+ }
722
+
723
+ // Tests that EXPECT_FATAL_FAILURE() fails when there are two
724
+ // fatal failures.
725
+ TEST(ExpectFatalFailureTest, FailsWhenThereAreTwoFatalFailures) {
726
+ printf("(expecting a failure)\n");
727
+ EXPECT_FATAL_FAILURE({
728
+ FatalFailure();
729
+ FatalFailure();
730
+ }, "");
731
+ }
732
+
733
+ // Tests that EXPECT_FATAL_FAILURE() fails when there is one non-fatal
734
+ // failure.
735
+ TEST(ExpectFatalFailureTest, FailsWhenThereIsOneNonfatalFailure) {
736
+ printf("(expecting a failure)\n");
737
+ EXPECT_FATAL_FAILURE({
738
+ ADD_FAILURE() << "Expected non-fatal failure.";
739
+ }, "");
740
+ }
741
+
742
+ // Tests that EXPECT_FATAL_FAILURE() fails when the statement being
743
+ // tested returns.
744
+ TEST(ExpectFatalFailureTest, FailsWhenStatementReturns) {
745
+ printf("(expecting a failure)\n");
746
+ EXPECT_FATAL_FAILURE({
747
+ return;
748
+ }, "");
749
+ }
750
+
751
+ #if GTEST_HAS_EXCEPTIONS
752
+
753
+ // Tests that EXPECT_FATAL_FAILURE() fails when the statement being
754
+ // tested throws.
755
+ TEST(ExpectFatalFailureTest, FailsWhenStatementThrows) {
756
+ printf("(expecting a failure)\n");
757
+ try {
758
+ EXPECT_FATAL_FAILURE({
759
+ throw 0;
760
+ }, "");
761
+ } catch(int) { // NOLINT
762
+ }
763
+ }
764
+
765
+ #endif // GTEST_HAS_EXCEPTIONS
766
+
767
+ // This #ifdef block tests the output of value-parameterized tests.
768
+
769
+ std::string ParamNameFunc(const testing::TestParamInfo<std::string>& info) {
770
+ return info.param;
771
+ }
772
+
773
+ class ParamTest : public testing::TestWithParam<std::string> {
774
+ };
775
+
776
+ TEST_P(ParamTest, Success) {
777
+ EXPECT_EQ("a", GetParam());
778
+ }
779
+
780
+ TEST_P(ParamTest, Failure) {
781
+ EXPECT_EQ("b", GetParam()) << "Expected failure";
782
+ }
783
+
784
+ INSTANTIATE_TEST_CASE_P(PrintingStrings,
785
+ ParamTest,
786
+ testing::Values(std::string("a")),
787
+ ParamNameFunc);
788
+
789
+ // This #ifdef block tests the output of typed tests.
790
+ #if GTEST_HAS_TYPED_TEST
791
+
792
+ template <typename T>
793
+ class TypedTest : public testing::Test {
794
+ };
795
+
796
+ TYPED_TEST_CASE(TypedTest, testing::Types<int>);
797
+
798
+ TYPED_TEST(TypedTest, Success) {
799
+ EXPECT_EQ(0, TypeParam());
800
+ }
801
+
802
+ TYPED_TEST(TypedTest, Failure) {
803
+ EXPECT_EQ(1, TypeParam()) << "Expected failure";
804
+ }
805
+
806
+ #endif // GTEST_HAS_TYPED_TEST
807
+
808
+ // This #ifdef block tests the output of type-parameterized tests.
809
+ #if GTEST_HAS_TYPED_TEST_P
810
+
811
+ template <typename T>
812
+ class TypedTestP : public testing::Test {
813
+ };
814
+
815
+ TYPED_TEST_CASE_P(TypedTestP);
816
+
817
+ TYPED_TEST_P(TypedTestP, Success) {
818
+ EXPECT_EQ(0U, TypeParam());
819
+ }
820
+
821
+ TYPED_TEST_P(TypedTestP, Failure) {
822
+ EXPECT_EQ(1U, TypeParam()) << "Expected failure";
823
+ }
824
+
825
+ REGISTER_TYPED_TEST_CASE_P(TypedTestP, Success, Failure);
826
+
827
+ typedef testing::Types<unsigned char, unsigned int> UnsignedTypes;
828
+ INSTANTIATE_TYPED_TEST_CASE_P(Unsigned, TypedTestP, UnsignedTypes);
829
+
830
+ #endif // GTEST_HAS_TYPED_TEST_P
831
+
832
+ #if GTEST_HAS_DEATH_TEST
833
+
834
+ // We rely on the golden file to verify that tests whose test case
835
+ // name ends with DeathTest are run first.
836
+
837
+ TEST(ADeathTest, ShouldRunFirst) {
838
+ }
839
+
840
+ # if GTEST_HAS_TYPED_TEST
841
+
842
+ // We rely on the golden file to verify that typed tests whose test
843
+ // case name ends with DeathTest are run first.
844
+
845
+ template <typename T>
846
+ class ATypedDeathTest : public testing::Test {
847
+ };
848
+
849
+ typedef testing::Types<int, double> NumericTypes;
850
+ TYPED_TEST_CASE(ATypedDeathTest, NumericTypes);
851
+
852
+ TYPED_TEST(ATypedDeathTest, ShouldRunFirst) {
853
+ }
854
+
855
+ # endif // GTEST_HAS_TYPED_TEST
856
+
857
+ # if GTEST_HAS_TYPED_TEST_P
858
+
859
+
860
+ // We rely on the golden file to verify that type-parameterized tests
861
+ // whose test case name ends with DeathTest are run first.
862
+
863
+ template <typename T>
864
+ class ATypeParamDeathTest : public testing::Test {
865
+ };
866
+
867
+ TYPED_TEST_CASE_P(ATypeParamDeathTest);
868
+
869
+ TYPED_TEST_P(ATypeParamDeathTest, ShouldRunFirst) {
870
+ }
871
+
872
+ REGISTER_TYPED_TEST_CASE_P(ATypeParamDeathTest, ShouldRunFirst);
873
+
874
+ INSTANTIATE_TYPED_TEST_CASE_P(My, ATypeParamDeathTest, NumericTypes);
875
+
876
+ # endif // GTEST_HAS_TYPED_TEST_P
877
+
878
+ #endif // GTEST_HAS_DEATH_TEST
879
+
880
+ // Tests various failure conditions of
881
+ // EXPECT_{,NON}FATAL_FAILURE{,_ON_ALL_THREADS}.
882
+ class ExpectFailureTest : public testing::Test {
883
+ public: // Must be public and not protected due to a bug in g++ 3.4.2.
884
+ enum FailureMode {
885
+ FATAL_FAILURE,
886
+ NONFATAL_FAILURE
887
+ };
888
+ static void AddFailure(FailureMode failure) {
889
+ if (failure == FATAL_FAILURE) {
890
+ FAIL() << "Expected fatal failure.";
891
+ } else {
892
+ ADD_FAILURE() << "Expected non-fatal failure.";
893
+ }
894
+ }
895
+ };
896
+
897
+ TEST_F(ExpectFailureTest, ExpectFatalFailure) {
898
+ // Expected fatal failure, but succeeds.
899
+ printf("(expecting 1 failure)\n");
900
+ EXPECT_FATAL_FAILURE(SUCCEED(), "Expected fatal failure.");
901
+ // Expected fatal failure, but got a non-fatal failure.
902
+ printf("(expecting 1 failure)\n");
903
+ EXPECT_FATAL_FAILURE(AddFailure(NONFATAL_FAILURE), "Expected non-fatal "
904
+ "failure.");
905
+ // Wrong message.
906
+ printf("(expecting 1 failure)\n");
907
+ EXPECT_FATAL_FAILURE(AddFailure(FATAL_FAILURE), "Some other fatal failure "
908
+ "expected.");
909
+ }
910
+
911
+ TEST_F(ExpectFailureTest, ExpectNonFatalFailure) {
912
+ // Expected non-fatal failure, but succeeds.
913
+ printf("(expecting 1 failure)\n");
914
+ EXPECT_NONFATAL_FAILURE(SUCCEED(), "Expected non-fatal failure.");
915
+ // Expected non-fatal failure, but got a fatal failure.
916
+ printf("(expecting 1 failure)\n");
917
+ EXPECT_NONFATAL_FAILURE(AddFailure(FATAL_FAILURE), "Expected fatal failure.");
918
+ // Wrong message.
919
+ printf("(expecting 1 failure)\n");
920
+ EXPECT_NONFATAL_FAILURE(AddFailure(NONFATAL_FAILURE), "Some other non-fatal "
921
+ "failure.");
922
+ }
923
+
924
+ #if GTEST_IS_THREADSAFE
925
+
926
+ class ExpectFailureWithThreadsTest : public ExpectFailureTest {
927
+ protected:
928
+ static void AddFailureInOtherThread(FailureMode failure) {
929
+ ThreadWithParam<FailureMode> thread(&AddFailure, failure, NULL);
930
+ thread.Join();
931
+ }
932
+ };
933
+
934
+ TEST_F(ExpectFailureWithThreadsTest, ExpectFatalFailure) {
935
+ // We only intercept the current thread.
936
+ printf("(expecting 2 failures)\n");
937
+ EXPECT_FATAL_FAILURE(AddFailureInOtherThread(FATAL_FAILURE),
938
+ "Expected fatal failure.");
939
+ }
940
+
941
+ TEST_F(ExpectFailureWithThreadsTest, ExpectNonFatalFailure) {
942
+ // We only intercept the current thread.
943
+ printf("(expecting 2 failures)\n");
944
+ EXPECT_NONFATAL_FAILURE(AddFailureInOtherThread(NONFATAL_FAILURE),
945
+ "Expected non-fatal failure.");
946
+ }
947
+
948
+ typedef ExpectFailureWithThreadsTest ScopedFakeTestPartResultReporterTest;
949
+
950
+ // Tests that the ScopedFakeTestPartResultReporter only catches failures from
951
+ // the current thread if it is instantiated with INTERCEPT_ONLY_CURRENT_THREAD.
952
+ TEST_F(ScopedFakeTestPartResultReporterTest, InterceptOnlyCurrentThread) {
953
+ printf("(expecting 2 failures)\n");
954
+ TestPartResultArray results;
955
+ {
956
+ ScopedFakeTestPartResultReporter reporter(
957
+ ScopedFakeTestPartResultReporter::INTERCEPT_ONLY_CURRENT_THREAD,
958
+ &results);
959
+ AddFailureInOtherThread(FATAL_FAILURE);
960
+ AddFailureInOtherThread(NONFATAL_FAILURE);
961
+ }
962
+ // The two failures should not have been intercepted.
963
+ EXPECT_EQ(0, results.size()) << "This shouldn't fail.";
964
+ }
965
+
966
+ #endif // GTEST_IS_THREADSAFE
967
+
968
+ TEST_F(ExpectFailureTest, ExpectFatalFailureOnAllThreads) {
969
+ // Expected fatal failure, but succeeds.
970
+ printf("(expecting 1 failure)\n");
971
+ EXPECT_FATAL_FAILURE_ON_ALL_THREADS(SUCCEED(), "Expected fatal failure.");
972
+ // Expected fatal failure, but got a non-fatal failure.
973
+ printf("(expecting 1 failure)\n");
974
+ EXPECT_FATAL_FAILURE_ON_ALL_THREADS(AddFailure(NONFATAL_FAILURE),
975
+ "Expected non-fatal failure.");
976
+ // Wrong message.
977
+ printf("(expecting 1 failure)\n");
978
+ EXPECT_FATAL_FAILURE_ON_ALL_THREADS(AddFailure(FATAL_FAILURE),
979
+ "Some other fatal failure expected.");
980
+ }
981
+
982
+ TEST_F(ExpectFailureTest, ExpectNonFatalFailureOnAllThreads) {
983
+ // Expected non-fatal failure, but succeeds.
984
+ printf("(expecting 1 failure)\n");
985
+ EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(SUCCEED(), "Expected non-fatal "
986
+ "failure.");
987
+ // Expected non-fatal failure, but got a fatal failure.
988
+ printf("(expecting 1 failure)\n");
989
+ EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(AddFailure(FATAL_FAILURE),
990
+ "Expected fatal failure.");
991
+ // Wrong message.
992
+ printf("(expecting 1 failure)\n");
993
+ EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(AddFailure(NONFATAL_FAILURE),
994
+ "Some other non-fatal failure.");
995
+ }
996
+
997
+
998
+ // Two test environments for testing testing::AddGlobalTestEnvironment().
999
+
1000
+ class FooEnvironment : public testing::Environment {
1001
+ public:
1002
+ virtual void SetUp() {
1003
+ printf("%s", "FooEnvironment::SetUp() called.\n");
1004
+ }
1005
+
1006
+ virtual void TearDown() {
1007
+ printf("%s", "FooEnvironment::TearDown() called.\n");
1008
+ FAIL() << "Expected fatal failure.";
1009
+ }
1010
+ };
1011
+
1012
+ class BarEnvironment : public testing::Environment {
1013
+ public:
1014
+ virtual void SetUp() {
1015
+ printf("%s", "BarEnvironment::SetUp() called.\n");
1016
+ }
1017
+
1018
+ virtual void TearDown() {
1019
+ printf("%s", "BarEnvironment::TearDown() called.\n");
1020
+ ADD_FAILURE() << "Expected non-fatal failure.";
1021
+ }
1022
+ };
1023
+
1024
+ // The main function.
1025
+ //
1026
+ // The idea is to use Google Test to run all the tests we have defined (some
1027
+ // of them are intended to fail), and then compare the test results
1028
+ // with the "golden" file.
1029
+ int main(int argc, char **argv) {
1030
+ testing::GTEST_FLAG(print_time) = false;
1031
+
1032
+ // We just run the tests, knowing some of them are intended to fail.
1033
+ // We will use a separate Python script to compare the output of
1034
+ // this program with the golden file.
1035
+
1036
+ // It's hard to test InitGoogleTest() directly, as it has many
1037
+ // global side effects. The following line serves as a sanity test
1038
+ // for it.
1039
+ testing::InitGoogleTest(&argc, argv);
1040
+ bool internal_skip_environment_and_ad_hoc_tests =
1041
+ std::count(argv, argv + argc,
1042
+ std::string("internal_skip_environment_and_ad_hoc_tests")) > 0;
1043
+
1044
+ #if GTEST_HAS_DEATH_TEST
1045
+ if (testing::internal::GTEST_FLAG(internal_run_death_test) != "") {
1046
+ // Skip the usual output capturing if we're running as the child
1047
+ // process of an threadsafe-style death test.
1048
+ # if GTEST_OS_WINDOWS
1049
+ posix::FReopen("nul:", "w", stdout);
1050
+ # else
1051
+ posix::FReopen("/dev/null", "w", stdout);
1052
+ # endif // GTEST_OS_WINDOWS
1053
+ return RUN_ALL_TESTS();
1054
+ }
1055
+ #endif // GTEST_HAS_DEATH_TEST
1056
+
1057
+ if (internal_skip_environment_and_ad_hoc_tests)
1058
+ return RUN_ALL_TESTS();
1059
+
1060
+ // Registers two global test environments.
1061
+ // The golden file verifies that they are set up in the order they
1062
+ // are registered, and torn down in the reverse order.
1063
+ testing::AddGlobalTestEnvironment(new FooEnvironment);
1064
+ testing::AddGlobalTestEnvironment(new BarEnvironment);
1065
+
1066
+ return RunAllTests();
1067
+ }