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,2427 @@
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
+ // This file is AUTOMATICALLY GENERATED on 01/02/2018 by command
31
+ // 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
32
+
33
+ // Regression test for gtest_pred_impl.h
34
+ //
35
+ // This file is generated by a script and quite long. If you intend to
36
+ // learn how Google Test works by reading its unit tests, read
37
+ // gtest_unittest.cc instead.
38
+ //
39
+ // This is intended as a regression test for the Google Test predicate
40
+ // assertions. We compile it as part of the gtest_unittest target
41
+ // only to keep the implementation tidy and compact, as it is quite
42
+ // involved to set up the stage for testing Google Test using Google
43
+ // Test itself.
44
+ //
45
+ // Currently, gtest_unittest takes ~11 seconds to run in the testing
46
+ // daemon. In the future, if it grows too large and needs much more
47
+ // time to finish, we should consider separating this file into a
48
+ // stand-alone regression test.
49
+
50
+ #include <iostream>
51
+
52
+ #include "gtest/gtest.h"
53
+ #include "gtest/gtest-spi.h"
54
+
55
+ // A user-defined data type.
56
+ struct Bool {
57
+ explicit Bool(int val) : value(val != 0) {}
58
+
59
+ bool operator>(int n) const { return value > Bool(n).value; }
60
+
61
+ Bool operator+(const Bool& rhs) const { return Bool(value + rhs.value); }
62
+
63
+ bool operator==(const Bool& rhs) const { return value == rhs.value; }
64
+
65
+ bool value;
66
+ };
67
+
68
+ // Enables Bool to be used in assertions.
69
+ std::ostream& operator<<(std::ostream& os, const Bool& x) {
70
+ return os << (x.value ? "true" : "false");
71
+ }
72
+
73
+ // Sample functions/functors for testing unary predicate assertions.
74
+
75
+ // A unary predicate function.
76
+ template <typename T1>
77
+ bool PredFunction1(T1 v1) {
78
+ return v1 > 0;
79
+ }
80
+
81
+ // The following two functions are needed to circumvent a bug in
82
+ // gcc 2.95.3, which sometimes has problem with the above template
83
+ // function.
84
+ bool PredFunction1Int(int v1) {
85
+ return v1 > 0;
86
+ }
87
+ bool PredFunction1Bool(Bool v1) {
88
+ return v1 > 0;
89
+ }
90
+
91
+ // A unary predicate functor.
92
+ struct PredFunctor1 {
93
+ template <typename T1>
94
+ bool operator()(const T1& v1) {
95
+ return v1 > 0;
96
+ }
97
+ };
98
+
99
+ // A unary predicate-formatter function.
100
+ template <typename T1>
101
+ testing::AssertionResult PredFormatFunction1(const char* e1,
102
+ const T1& v1) {
103
+ if (PredFunction1(v1))
104
+ return testing::AssertionSuccess();
105
+
106
+ return testing::AssertionFailure()
107
+ << e1
108
+ << " is expected to be positive, but evaluates to "
109
+ << v1 << ".";
110
+ }
111
+
112
+ // A unary predicate-formatter functor.
113
+ struct PredFormatFunctor1 {
114
+ template <typename T1>
115
+ testing::AssertionResult operator()(const char* e1,
116
+ const T1& v1) const {
117
+ return PredFormatFunction1(e1, v1);
118
+ }
119
+ };
120
+
121
+ // Tests for {EXPECT|ASSERT}_PRED_FORMAT1.
122
+
123
+ class Predicate1Test : public testing::Test {
124
+ protected:
125
+ virtual void SetUp() {
126
+ expected_to_finish_ = true;
127
+ finished_ = false;
128
+ n1_ = 0;
129
+ }
130
+
131
+ virtual void TearDown() {
132
+ // Verifies that each of the predicate's arguments was evaluated
133
+ // exactly once.
134
+ EXPECT_EQ(1, n1_) <<
135
+ "The predicate assertion didn't evaluate argument 2 "
136
+ "exactly once.";
137
+
138
+ // Verifies that the control flow in the test function is expected.
139
+ if (expected_to_finish_ && !finished_) {
140
+ FAIL() << "The predicate assertion unexpactedly aborted the test.";
141
+ } else if (!expected_to_finish_ && finished_) {
142
+ FAIL() << "The failed predicate assertion didn't abort the test "
143
+ "as expected.";
144
+ }
145
+ }
146
+
147
+ // true iff the test function is expected to run to finish.
148
+ static bool expected_to_finish_;
149
+
150
+ // true iff the test function did run to finish.
151
+ static bool finished_;
152
+
153
+ static int n1_;
154
+ };
155
+
156
+ bool Predicate1Test::expected_to_finish_;
157
+ bool Predicate1Test::finished_;
158
+ int Predicate1Test::n1_;
159
+
160
+ typedef Predicate1Test EXPECT_PRED_FORMAT1Test;
161
+ typedef Predicate1Test ASSERT_PRED_FORMAT1Test;
162
+ typedef Predicate1Test EXPECT_PRED1Test;
163
+ typedef Predicate1Test ASSERT_PRED1Test;
164
+
165
+ // Tests a successful EXPECT_PRED1 where the
166
+ // predicate-formatter is a function on a built-in type (int).
167
+ TEST_F(EXPECT_PRED1Test, FunctionOnBuiltInTypeSuccess) {
168
+ EXPECT_PRED1(PredFunction1Int,
169
+ ++n1_);
170
+ finished_ = true;
171
+ }
172
+
173
+ // Tests a successful EXPECT_PRED1 where the
174
+ // predicate-formatter is a function on a user-defined type (Bool).
175
+ TEST_F(EXPECT_PRED1Test, FunctionOnUserTypeSuccess) {
176
+ EXPECT_PRED1(PredFunction1Bool,
177
+ Bool(++n1_));
178
+ finished_ = true;
179
+ }
180
+
181
+ // Tests a successful EXPECT_PRED1 where the
182
+ // predicate-formatter is a functor on a built-in type (int).
183
+ TEST_F(EXPECT_PRED1Test, FunctorOnBuiltInTypeSuccess) {
184
+ EXPECT_PRED1(PredFunctor1(),
185
+ ++n1_);
186
+ finished_ = true;
187
+ }
188
+
189
+ // Tests a successful EXPECT_PRED1 where the
190
+ // predicate-formatter is a functor on a user-defined type (Bool).
191
+ TEST_F(EXPECT_PRED1Test, FunctorOnUserTypeSuccess) {
192
+ EXPECT_PRED1(PredFunctor1(),
193
+ Bool(++n1_));
194
+ finished_ = true;
195
+ }
196
+
197
+ // Tests a failed EXPECT_PRED1 where the
198
+ // predicate-formatter is a function on a built-in type (int).
199
+ TEST_F(EXPECT_PRED1Test, FunctionOnBuiltInTypeFailure) {
200
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
201
+ EXPECT_PRED1(PredFunction1Int,
202
+ n1_++);
203
+ finished_ = true;
204
+ }, "");
205
+ }
206
+
207
+ // Tests a failed EXPECT_PRED1 where the
208
+ // predicate-formatter is a function on a user-defined type (Bool).
209
+ TEST_F(EXPECT_PRED1Test, FunctionOnUserTypeFailure) {
210
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
211
+ EXPECT_PRED1(PredFunction1Bool,
212
+ Bool(n1_++));
213
+ finished_ = true;
214
+ }, "");
215
+ }
216
+
217
+ // Tests a failed EXPECT_PRED1 where the
218
+ // predicate-formatter is a functor on a built-in type (int).
219
+ TEST_F(EXPECT_PRED1Test, FunctorOnBuiltInTypeFailure) {
220
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
221
+ EXPECT_PRED1(PredFunctor1(),
222
+ n1_++);
223
+ finished_ = true;
224
+ }, "");
225
+ }
226
+
227
+ // Tests a failed EXPECT_PRED1 where the
228
+ // predicate-formatter is a functor on a user-defined type (Bool).
229
+ TEST_F(EXPECT_PRED1Test, FunctorOnUserTypeFailure) {
230
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
231
+ EXPECT_PRED1(PredFunctor1(),
232
+ Bool(n1_++));
233
+ finished_ = true;
234
+ }, "");
235
+ }
236
+
237
+ // Tests a successful ASSERT_PRED1 where the
238
+ // predicate-formatter is a function on a built-in type (int).
239
+ TEST_F(ASSERT_PRED1Test, FunctionOnBuiltInTypeSuccess) {
240
+ ASSERT_PRED1(PredFunction1Int,
241
+ ++n1_);
242
+ finished_ = true;
243
+ }
244
+
245
+ // Tests a successful ASSERT_PRED1 where the
246
+ // predicate-formatter is a function on a user-defined type (Bool).
247
+ TEST_F(ASSERT_PRED1Test, FunctionOnUserTypeSuccess) {
248
+ ASSERT_PRED1(PredFunction1Bool,
249
+ Bool(++n1_));
250
+ finished_ = true;
251
+ }
252
+
253
+ // Tests a successful ASSERT_PRED1 where the
254
+ // predicate-formatter is a functor on a built-in type (int).
255
+ TEST_F(ASSERT_PRED1Test, FunctorOnBuiltInTypeSuccess) {
256
+ ASSERT_PRED1(PredFunctor1(),
257
+ ++n1_);
258
+ finished_ = true;
259
+ }
260
+
261
+ // Tests a successful ASSERT_PRED1 where the
262
+ // predicate-formatter is a functor on a user-defined type (Bool).
263
+ TEST_F(ASSERT_PRED1Test, FunctorOnUserTypeSuccess) {
264
+ ASSERT_PRED1(PredFunctor1(),
265
+ Bool(++n1_));
266
+ finished_ = true;
267
+ }
268
+
269
+ // Tests a failed ASSERT_PRED1 where the
270
+ // predicate-formatter is a function on a built-in type (int).
271
+ TEST_F(ASSERT_PRED1Test, FunctionOnBuiltInTypeFailure) {
272
+ expected_to_finish_ = false;
273
+ EXPECT_FATAL_FAILURE({ // NOLINT
274
+ ASSERT_PRED1(PredFunction1Int,
275
+ n1_++);
276
+ finished_ = true;
277
+ }, "");
278
+ }
279
+
280
+ // Tests a failed ASSERT_PRED1 where the
281
+ // predicate-formatter is a function on a user-defined type (Bool).
282
+ TEST_F(ASSERT_PRED1Test, FunctionOnUserTypeFailure) {
283
+ expected_to_finish_ = false;
284
+ EXPECT_FATAL_FAILURE({ // NOLINT
285
+ ASSERT_PRED1(PredFunction1Bool,
286
+ Bool(n1_++));
287
+ finished_ = true;
288
+ }, "");
289
+ }
290
+
291
+ // Tests a failed ASSERT_PRED1 where the
292
+ // predicate-formatter is a functor on a built-in type (int).
293
+ TEST_F(ASSERT_PRED1Test, FunctorOnBuiltInTypeFailure) {
294
+ expected_to_finish_ = false;
295
+ EXPECT_FATAL_FAILURE({ // NOLINT
296
+ ASSERT_PRED1(PredFunctor1(),
297
+ n1_++);
298
+ finished_ = true;
299
+ }, "");
300
+ }
301
+
302
+ // Tests a failed ASSERT_PRED1 where the
303
+ // predicate-formatter is a functor on a user-defined type (Bool).
304
+ TEST_F(ASSERT_PRED1Test, FunctorOnUserTypeFailure) {
305
+ expected_to_finish_ = false;
306
+ EXPECT_FATAL_FAILURE({ // NOLINT
307
+ ASSERT_PRED1(PredFunctor1(),
308
+ Bool(n1_++));
309
+ finished_ = true;
310
+ }, "");
311
+ }
312
+
313
+ // Tests a successful EXPECT_PRED_FORMAT1 where the
314
+ // predicate-formatter is a function on a built-in type (int).
315
+ TEST_F(EXPECT_PRED_FORMAT1Test, FunctionOnBuiltInTypeSuccess) {
316
+ EXPECT_PRED_FORMAT1(PredFormatFunction1,
317
+ ++n1_);
318
+ finished_ = true;
319
+ }
320
+
321
+ // Tests a successful EXPECT_PRED_FORMAT1 where the
322
+ // predicate-formatter is a function on a user-defined type (Bool).
323
+ TEST_F(EXPECT_PRED_FORMAT1Test, FunctionOnUserTypeSuccess) {
324
+ EXPECT_PRED_FORMAT1(PredFormatFunction1,
325
+ Bool(++n1_));
326
+ finished_ = true;
327
+ }
328
+
329
+ // Tests a successful EXPECT_PRED_FORMAT1 where the
330
+ // predicate-formatter is a functor on a built-in type (int).
331
+ TEST_F(EXPECT_PRED_FORMAT1Test, FunctorOnBuiltInTypeSuccess) {
332
+ EXPECT_PRED_FORMAT1(PredFormatFunctor1(),
333
+ ++n1_);
334
+ finished_ = true;
335
+ }
336
+
337
+ // Tests a successful EXPECT_PRED_FORMAT1 where the
338
+ // predicate-formatter is a functor on a user-defined type (Bool).
339
+ TEST_F(EXPECT_PRED_FORMAT1Test, FunctorOnUserTypeSuccess) {
340
+ EXPECT_PRED_FORMAT1(PredFormatFunctor1(),
341
+ Bool(++n1_));
342
+ finished_ = true;
343
+ }
344
+
345
+ // Tests a failed EXPECT_PRED_FORMAT1 where the
346
+ // predicate-formatter is a function on a built-in type (int).
347
+ TEST_F(EXPECT_PRED_FORMAT1Test, FunctionOnBuiltInTypeFailure) {
348
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
349
+ EXPECT_PRED_FORMAT1(PredFormatFunction1,
350
+ n1_++);
351
+ finished_ = true;
352
+ }, "");
353
+ }
354
+
355
+ // Tests a failed EXPECT_PRED_FORMAT1 where the
356
+ // predicate-formatter is a function on a user-defined type (Bool).
357
+ TEST_F(EXPECT_PRED_FORMAT1Test, FunctionOnUserTypeFailure) {
358
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
359
+ EXPECT_PRED_FORMAT1(PredFormatFunction1,
360
+ Bool(n1_++));
361
+ finished_ = true;
362
+ }, "");
363
+ }
364
+
365
+ // Tests a failed EXPECT_PRED_FORMAT1 where the
366
+ // predicate-formatter is a functor on a built-in type (int).
367
+ TEST_F(EXPECT_PRED_FORMAT1Test, FunctorOnBuiltInTypeFailure) {
368
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
369
+ EXPECT_PRED_FORMAT1(PredFormatFunctor1(),
370
+ n1_++);
371
+ finished_ = true;
372
+ }, "");
373
+ }
374
+
375
+ // Tests a failed EXPECT_PRED_FORMAT1 where the
376
+ // predicate-formatter is a functor on a user-defined type (Bool).
377
+ TEST_F(EXPECT_PRED_FORMAT1Test, FunctorOnUserTypeFailure) {
378
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
379
+ EXPECT_PRED_FORMAT1(PredFormatFunctor1(),
380
+ Bool(n1_++));
381
+ finished_ = true;
382
+ }, "");
383
+ }
384
+
385
+ // Tests a successful ASSERT_PRED_FORMAT1 where the
386
+ // predicate-formatter is a function on a built-in type (int).
387
+ TEST_F(ASSERT_PRED_FORMAT1Test, FunctionOnBuiltInTypeSuccess) {
388
+ ASSERT_PRED_FORMAT1(PredFormatFunction1,
389
+ ++n1_);
390
+ finished_ = true;
391
+ }
392
+
393
+ // Tests a successful ASSERT_PRED_FORMAT1 where the
394
+ // predicate-formatter is a function on a user-defined type (Bool).
395
+ TEST_F(ASSERT_PRED_FORMAT1Test, FunctionOnUserTypeSuccess) {
396
+ ASSERT_PRED_FORMAT1(PredFormatFunction1,
397
+ Bool(++n1_));
398
+ finished_ = true;
399
+ }
400
+
401
+ // Tests a successful ASSERT_PRED_FORMAT1 where the
402
+ // predicate-formatter is a functor on a built-in type (int).
403
+ TEST_F(ASSERT_PRED_FORMAT1Test, FunctorOnBuiltInTypeSuccess) {
404
+ ASSERT_PRED_FORMAT1(PredFormatFunctor1(),
405
+ ++n1_);
406
+ finished_ = true;
407
+ }
408
+
409
+ // Tests a successful ASSERT_PRED_FORMAT1 where the
410
+ // predicate-formatter is a functor on a user-defined type (Bool).
411
+ TEST_F(ASSERT_PRED_FORMAT1Test, FunctorOnUserTypeSuccess) {
412
+ ASSERT_PRED_FORMAT1(PredFormatFunctor1(),
413
+ Bool(++n1_));
414
+ finished_ = true;
415
+ }
416
+
417
+ // Tests a failed ASSERT_PRED_FORMAT1 where the
418
+ // predicate-formatter is a function on a built-in type (int).
419
+ TEST_F(ASSERT_PRED_FORMAT1Test, FunctionOnBuiltInTypeFailure) {
420
+ expected_to_finish_ = false;
421
+ EXPECT_FATAL_FAILURE({ // NOLINT
422
+ ASSERT_PRED_FORMAT1(PredFormatFunction1,
423
+ n1_++);
424
+ finished_ = true;
425
+ }, "");
426
+ }
427
+
428
+ // Tests a failed ASSERT_PRED_FORMAT1 where the
429
+ // predicate-formatter is a function on a user-defined type (Bool).
430
+ TEST_F(ASSERT_PRED_FORMAT1Test, FunctionOnUserTypeFailure) {
431
+ expected_to_finish_ = false;
432
+ EXPECT_FATAL_FAILURE({ // NOLINT
433
+ ASSERT_PRED_FORMAT1(PredFormatFunction1,
434
+ Bool(n1_++));
435
+ finished_ = true;
436
+ }, "");
437
+ }
438
+
439
+ // Tests a failed ASSERT_PRED_FORMAT1 where the
440
+ // predicate-formatter is a functor on a built-in type (int).
441
+ TEST_F(ASSERT_PRED_FORMAT1Test, FunctorOnBuiltInTypeFailure) {
442
+ expected_to_finish_ = false;
443
+ EXPECT_FATAL_FAILURE({ // NOLINT
444
+ ASSERT_PRED_FORMAT1(PredFormatFunctor1(),
445
+ n1_++);
446
+ finished_ = true;
447
+ }, "");
448
+ }
449
+
450
+ // Tests a failed ASSERT_PRED_FORMAT1 where the
451
+ // predicate-formatter is a functor on a user-defined type (Bool).
452
+ TEST_F(ASSERT_PRED_FORMAT1Test, FunctorOnUserTypeFailure) {
453
+ expected_to_finish_ = false;
454
+ EXPECT_FATAL_FAILURE({ // NOLINT
455
+ ASSERT_PRED_FORMAT1(PredFormatFunctor1(),
456
+ Bool(n1_++));
457
+ finished_ = true;
458
+ }, "");
459
+ }
460
+ // Sample functions/functors for testing binary predicate assertions.
461
+
462
+ // A binary predicate function.
463
+ template <typename T1, typename T2>
464
+ bool PredFunction2(T1 v1, T2 v2) {
465
+ return v1 + v2 > 0;
466
+ }
467
+
468
+ // The following two functions are needed to circumvent a bug in
469
+ // gcc 2.95.3, which sometimes has problem with the above template
470
+ // function.
471
+ bool PredFunction2Int(int v1, int v2) {
472
+ return v1 + v2 > 0;
473
+ }
474
+ bool PredFunction2Bool(Bool v1, Bool v2) {
475
+ return v1 + v2 > 0;
476
+ }
477
+
478
+ // A binary predicate functor.
479
+ struct PredFunctor2 {
480
+ template <typename T1, typename T2>
481
+ bool operator()(const T1& v1,
482
+ const T2& v2) {
483
+ return v1 + v2 > 0;
484
+ }
485
+ };
486
+
487
+ // A binary predicate-formatter function.
488
+ template <typename T1, typename T2>
489
+ testing::AssertionResult PredFormatFunction2(const char* e1,
490
+ const char* e2,
491
+ const T1& v1,
492
+ const T2& v2) {
493
+ if (PredFunction2(v1, v2))
494
+ return testing::AssertionSuccess();
495
+
496
+ return testing::AssertionFailure()
497
+ << e1 << " + " << e2
498
+ << " is expected to be positive, but evaluates to "
499
+ << v1 + v2 << ".";
500
+ }
501
+
502
+ // A binary predicate-formatter functor.
503
+ struct PredFormatFunctor2 {
504
+ template <typename T1, typename T2>
505
+ testing::AssertionResult operator()(const char* e1,
506
+ const char* e2,
507
+ const T1& v1,
508
+ const T2& v2) const {
509
+ return PredFormatFunction2(e1, e2, v1, v2);
510
+ }
511
+ };
512
+
513
+ // Tests for {EXPECT|ASSERT}_PRED_FORMAT2.
514
+
515
+ class Predicate2Test : public testing::Test {
516
+ protected:
517
+ virtual void SetUp() {
518
+ expected_to_finish_ = true;
519
+ finished_ = false;
520
+ n1_ = n2_ = 0;
521
+ }
522
+
523
+ virtual void TearDown() {
524
+ // Verifies that each of the predicate's arguments was evaluated
525
+ // exactly once.
526
+ EXPECT_EQ(1, n1_) <<
527
+ "The predicate assertion didn't evaluate argument 2 "
528
+ "exactly once.";
529
+ EXPECT_EQ(1, n2_) <<
530
+ "The predicate assertion didn't evaluate argument 3 "
531
+ "exactly once.";
532
+
533
+ // Verifies that the control flow in the test function is expected.
534
+ if (expected_to_finish_ && !finished_) {
535
+ FAIL() << "The predicate assertion unexpactedly aborted the test.";
536
+ } else if (!expected_to_finish_ && finished_) {
537
+ FAIL() << "The failed predicate assertion didn't abort the test "
538
+ "as expected.";
539
+ }
540
+ }
541
+
542
+ // true iff the test function is expected to run to finish.
543
+ static bool expected_to_finish_;
544
+
545
+ // true iff the test function did run to finish.
546
+ static bool finished_;
547
+
548
+ static int n1_;
549
+ static int n2_;
550
+ };
551
+
552
+ bool Predicate2Test::expected_to_finish_;
553
+ bool Predicate2Test::finished_;
554
+ int Predicate2Test::n1_;
555
+ int Predicate2Test::n2_;
556
+
557
+ typedef Predicate2Test EXPECT_PRED_FORMAT2Test;
558
+ typedef Predicate2Test ASSERT_PRED_FORMAT2Test;
559
+ typedef Predicate2Test EXPECT_PRED2Test;
560
+ typedef Predicate2Test ASSERT_PRED2Test;
561
+
562
+ // Tests a successful EXPECT_PRED2 where the
563
+ // predicate-formatter is a function on a built-in type (int).
564
+ TEST_F(EXPECT_PRED2Test, FunctionOnBuiltInTypeSuccess) {
565
+ EXPECT_PRED2(PredFunction2Int,
566
+ ++n1_,
567
+ ++n2_);
568
+ finished_ = true;
569
+ }
570
+
571
+ // Tests a successful EXPECT_PRED2 where the
572
+ // predicate-formatter is a function on a user-defined type (Bool).
573
+ TEST_F(EXPECT_PRED2Test, FunctionOnUserTypeSuccess) {
574
+ EXPECT_PRED2(PredFunction2Bool,
575
+ Bool(++n1_),
576
+ Bool(++n2_));
577
+ finished_ = true;
578
+ }
579
+
580
+ // Tests a successful EXPECT_PRED2 where the
581
+ // predicate-formatter is a functor on a built-in type (int).
582
+ TEST_F(EXPECT_PRED2Test, FunctorOnBuiltInTypeSuccess) {
583
+ EXPECT_PRED2(PredFunctor2(),
584
+ ++n1_,
585
+ ++n2_);
586
+ finished_ = true;
587
+ }
588
+
589
+ // Tests a successful EXPECT_PRED2 where the
590
+ // predicate-formatter is a functor on a user-defined type (Bool).
591
+ TEST_F(EXPECT_PRED2Test, FunctorOnUserTypeSuccess) {
592
+ EXPECT_PRED2(PredFunctor2(),
593
+ Bool(++n1_),
594
+ Bool(++n2_));
595
+ finished_ = true;
596
+ }
597
+
598
+ // Tests a failed EXPECT_PRED2 where the
599
+ // predicate-formatter is a function on a built-in type (int).
600
+ TEST_F(EXPECT_PRED2Test, FunctionOnBuiltInTypeFailure) {
601
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
602
+ EXPECT_PRED2(PredFunction2Int,
603
+ n1_++,
604
+ n2_++);
605
+ finished_ = true;
606
+ }, "");
607
+ }
608
+
609
+ // Tests a failed EXPECT_PRED2 where the
610
+ // predicate-formatter is a function on a user-defined type (Bool).
611
+ TEST_F(EXPECT_PRED2Test, FunctionOnUserTypeFailure) {
612
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
613
+ EXPECT_PRED2(PredFunction2Bool,
614
+ Bool(n1_++),
615
+ Bool(n2_++));
616
+ finished_ = true;
617
+ }, "");
618
+ }
619
+
620
+ // Tests a failed EXPECT_PRED2 where the
621
+ // predicate-formatter is a functor on a built-in type (int).
622
+ TEST_F(EXPECT_PRED2Test, FunctorOnBuiltInTypeFailure) {
623
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
624
+ EXPECT_PRED2(PredFunctor2(),
625
+ n1_++,
626
+ n2_++);
627
+ finished_ = true;
628
+ }, "");
629
+ }
630
+
631
+ // Tests a failed EXPECT_PRED2 where the
632
+ // predicate-formatter is a functor on a user-defined type (Bool).
633
+ TEST_F(EXPECT_PRED2Test, FunctorOnUserTypeFailure) {
634
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
635
+ EXPECT_PRED2(PredFunctor2(),
636
+ Bool(n1_++),
637
+ Bool(n2_++));
638
+ finished_ = true;
639
+ }, "");
640
+ }
641
+
642
+ // Tests a successful ASSERT_PRED2 where the
643
+ // predicate-formatter is a function on a built-in type (int).
644
+ TEST_F(ASSERT_PRED2Test, FunctionOnBuiltInTypeSuccess) {
645
+ ASSERT_PRED2(PredFunction2Int,
646
+ ++n1_,
647
+ ++n2_);
648
+ finished_ = true;
649
+ }
650
+
651
+ // Tests a successful ASSERT_PRED2 where the
652
+ // predicate-formatter is a function on a user-defined type (Bool).
653
+ TEST_F(ASSERT_PRED2Test, FunctionOnUserTypeSuccess) {
654
+ ASSERT_PRED2(PredFunction2Bool,
655
+ Bool(++n1_),
656
+ Bool(++n2_));
657
+ finished_ = true;
658
+ }
659
+
660
+ // Tests a successful ASSERT_PRED2 where the
661
+ // predicate-formatter is a functor on a built-in type (int).
662
+ TEST_F(ASSERT_PRED2Test, FunctorOnBuiltInTypeSuccess) {
663
+ ASSERT_PRED2(PredFunctor2(),
664
+ ++n1_,
665
+ ++n2_);
666
+ finished_ = true;
667
+ }
668
+
669
+ // Tests a successful ASSERT_PRED2 where the
670
+ // predicate-formatter is a functor on a user-defined type (Bool).
671
+ TEST_F(ASSERT_PRED2Test, FunctorOnUserTypeSuccess) {
672
+ ASSERT_PRED2(PredFunctor2(),
673
+ Bool(++n1_),
674
+ Bool(++n2_));
675
+ finished_ = true;
676
+ }
677
+
678
+ // Tests a failed ASSERT_PRED2 where the
679
+ // predicate-formatter is a function on a built-in type (int).
680
+ TEST_F(ASSERT_PRED2Test, FunctionOnBuiltInTypeFailure) {
681
+ expected_to_finish_ = false;
682
+ EXPECT_FATAL_FAILURE({ // NOLINT
683
+ ASSERT_PRED2(PredFunction2Int,
684
+ n1_++,
685
+ n2_++);
686
+ finished_ = true;
687
+ }, "");
688
+ }
689
+
690
+ // Tests a failed ASSERT_PRED2 where the
691
+ // predicate-formatter is a function on a user-defined type (Bool).
692
+ TEST_F(ASSERT_PRED2Test, FunctionOnUserTypeFailure) {
693
+ expected_to_finish_ = false;
694
+ EXPECT_FATAL_FAILURE({ // NOLINT
695
+ ASSERT_PRED2(PredFunction2Bool,
696
+ Bool(n1_++),
697
+ Bool(n2_++));
698
+ finished_ = true;
699
+ }, "");
700
+ }
701
+
702
+ // Tests a failed ASSERT_PRED2 where the
703
+ // predicate-formatter is a functor on a built-in type (int).
704
+ TEST_F(ASSERT_PRED2Test, FunctorOnBuiltInTypeFailure) {
705
+ expected_to_finish_ = false;
706
+ EXPECT_FATAL_FAILURE({ // NOLINT
707
+ ASSERT_PRED2(PredFunctor2(),
708
+ n1_++,
709
+ n2_++);
710
+ finished_ = true;
711
+ }, "");
712
+ }
713
+
714
+ // Tests a failed ASSERT_PRED2 where the
715
+ // predicate-formatter is a functor on a user-defined type (Bool).
716
+ TEST_F(ASSERT_PRED2Test, FunctorOnUserTypeFailure) {
717
+ expected_to_finish_ = false;
718
+ EXPECT_FATAL_FAILURE({ // NOLINT
719
+ ASSERT_PRED2(PredFunctor2(),
720
+ Bool(n1_++),
721
+ Bool(n2_++));
722
+ finished_ = true;
723
+ }, "");
724
+ }
725
+
726
+ // Tests a successful EXPECT_PRED_FORMAT2 where the
727
+ // predicate-formatter is a function on a built-in type (int).
728
+ TEST_F(EXPECT_PRED_FORMAT2Test, FunctionOnBuiltInTypeSuccess) {
729
+ EXPECT_PRED_FORMAT2(PredFormatFunction2,
730
+ ++n1_,
731
+ ++n2_);
732
+ finished_ = true;
733
+ }
734
+
735
+ // Tests a successful EXPECT_PRED_FORMAT2 where the
736
+ // predicate-formatter is a function on a user-defined type (Bool).
737
+ TEST_F(EXPECT_PRED_FORMAT2Test, FunctionOnUserTypeSuccess) {
738
+ EXPECT_PRED_FORMAT2(PredFormatFunction2,
739
+ Bool(++n1_),
740
+ Bool(++n2_));
741
+ finished_ = true;
742
+ }
743
+
744
+ // Tests a successful EXPECT_PRED_FORMAT2 where the
745
+ // predicate-formatter is a functor on a built-in type (int).
746
+ TEST_F(EXPECT_PRED_FORMAT2Test, FunctorOnBuiltInTypeSuccess) {
747
+ EXPECT_PRED_FORMAT2(PredFormatFunctor2(),
748
+ ++n1_,
749
+ ++n2_);
750
+ finished_ = true;
751
+ }
752
+
753
+ // Tests a successful EXPECT_PRED_FORMAT2 where the
754
+ // predicate-formatter is a functor on a user-defined type (Bool).
755
+ TEST_F(EXPECT_PRED_FORMAT2Test, FunctorOnUserTypeSuccess) {
756
+ EXPECT_PRED_FORMAT2(PredFormatFunctor2(),
757
+ Bool(++n1_),
758
+ Bool(++n2_));
759
+ finished_ = true;
760
+ }
761
+
762
+ // Tests a failed EXPECT_PRED_FORMAT2 where the
763
+ // predicate-formatter is a function on a built-in type (int).
764
+ TEST_F(EXPECT_PRED_FORMAT2Test, FunctionOnBuiltInTypeFailure) {
765
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
766
+ EXPECT_PRED_FORMAT2(PredFormatFunction2,
767
+ n1_++,
768
+ n2_++);
769
+ finished_ = true;
770
+ }, "");
771
+ }
772
+
773
+ // Tests a failed EXPECT_PRED_FORMAT2 where the
774
+ // predicate-formatter is a function on a user-defined type (Bool).
775
+ TEST_F(EXPECT_PRED_FORMAT2Test, FunctionOnUserTypeFailure) {
776
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
777
+ EXPECT_PRED_FORMAT2(PredFormatFunction2,
778
+ Bool(n1_++),
779
+ Bool(n2_++));
780
+ finished_ = true;
781
+ }, "");
782
+ }
783
+
784
+ // Tests a failed EXPECT_PRED_FORMAT2 where the
785
+ // predicate-formatter is a functor on a built-in type (int).
786
+ TEST_F(EXPECT_PRED_FORMAT2Test, FunctorOnBuiltInTypeFailure) {
787
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
788
+ EXPECT_PRED_FORMAT2(PredFormatFunctor2(),
789
+ n1_++,
790
+ n2_++);
791
+ finished_ = true;
792
+ }, "");
793
+ }
794
+
795
+ // Tests a failed EXPECT_PRED_FORMAT2 where the
796
+ // predicate-formatter is a functor on a user-defined type (Bool).
797
+ TEST_F(EXPECT_PRED_FORMAT2Test, FunctorOnUserTypeFailure) {
798
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
799
+ EXPECT_PRED_FORMAT2(PredFormatFunctor2(),
800
+ Bool(n1_++),
801
+ Bool(n2_++));
802
+ finished_ = true;
803
+ }, "");
804
+ }
805
+
806
+ // Tests a successful ASSERT_PRED_FORMAT2 where the
807
+ // predicate-formatter is a function on a built-in type (int).
808
+ TEST_F(ASSERT_PRED_FORMAT2Test, FunctionOnBuiltInTypeSuccess) {
809
+ ASSERT_PRED_FORMAT2(PredFormatFunction2,
810
+ ++n1_,
811
+ ++n2_);
812
+ finished_ = true;
813
+ }
814
+
815
+ // Tests a successful ASSERT_PRED_FORMAT2 where the
816
+ // predicate-formatter is a function on a user-defined type (Bool).
817
+ TEST_F(ASSERT_PRED_FORMAT2Test, FunctionOnUserTypeSuccess) {
818
+ ASSERT_PRED_FORMAT2(PredFormatFunction2,
819
+ Bool(++n1_),
820
+ Bool(++n2_));
821
+ finished_ = true;
822
+ }
823
+
824
+ // Tests a successful ASSERT_PRED_FORMAT2 where the
825
+ // predicate-formatter is a functor on a built-in type (int).
826
+ TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnBuiltInTypeSuccess) {
827
+ ASSERT_PRED_FORMAT2(PredFormatFunctor2(),
828
+ ++n1_,
829
+ ++n2_);
830
+ finished_ = true;
831
+ }
832
+
833
+ // Tests a successful ASSERT_PRED_FORMAT2 where the
834
+ // predicate-formatter is a functor on a user-defined type (Bool).
835
+ TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnUserTypeSuccess) {
836
+ ASSERT_PRED_FORMAT2(PredFormatFunctor2(),
837
+ Bool(++n1_),
838
+ Bool(++n2_));
839
+ finished_ = true;
840
+ }
841
+
842
+ // Tests a failed ASSERT_PRED_FORMAT2 where the
843
+ // predicate-formatter is a function on a built-in type (int).
844
+ TEST_F(ASSERT_PRED_FORMAT2Test, FunctionOnBuiltInTypeFailure) {
845
+ expected_to_finish_ = false;
846
+ EXPECT_FATAL_FAILURE({ // NOLINT
847
+ ASSERT_PRED_FORMAT2(PredFormatFunction2,
848
+ n1_++,
849
+ n2_++);
850
+ finished_ = true;
851
+ }, "");
852
+ }
853
+
854
+ // Tests a failed ASSERT_PRED_FORMAT2 where the
855
+ // predicate-formatter is a function on a user-defined type (Bool).
856
+ TEST_F(ASSERT_PRED_FORMAT2Test, FunctionOnUserTypeFailure) {
857
+ expected_to_finish_ = false;
858
+ EXPECT_FATAL_FAILURE({ // NOLINT
859
+ ASSERT_PRED_FORMAT2(PredFormatFunction2,
860
+ Bool(n1_++),
861
+ Bool(n2_++));
862
+ finished_ = true;
863
+ }, "");
864
+ }
865
+
866
+ // Tests a failed ASSERT_PRED_FORMAT2 where the
867
+ // predicate-formatter is a functor on a built-in type (int).
868
+ TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnBuiltInTypeFailure) {
869
+ expected_to_finish_ = false;
870
+ EXPECT_FATAL_FAILURE({ // NOLINT
871
+ ASSERT_PRED_FORMAT2(PredFormatFunctor2(),
872
+ n1_++,
873
+ n2_++);
874
+ finished_ = true;
875
+ }, "");
876
+ }
877
+
878
+ // Tests a failed ASSERT_PRED_FORMAT2 where the
879
+ // predicate-formatter is a functor on a user-defined type (Bool).
880
+ TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnUserTypeFailure) {
881
+ expected_to_finish_ = false;
882
+ EXPECT_FATAL_FAILURE({ // NOLINT
883
+ ASSERT_PRED_FORMAT2(PredFormatFunctor2(),
884
+ Bool(n1_++),
885
+ Bool(n2_++));
886
+ finished_ = true;
887
+ }, "");
888
+ }
889
+ // Sample functions/functors for testing ternary predicate assertions.
890
+
891
+ // A ternary predicate function.
892
+ template <typename T1, typename T2, typename T3>
893
+ bool PredFunction3(T1 v1, T2 v2, T3 v3) {
894
+ return v1 + v2 + v3 > 0;
895
+ }
896
+
897
+ // The following two functions are needed to circumvent a bug in
898
+ // gcc 2.95.3, which sometimes has problem with the above template
899
+ // function.
900
+ bool PredFunction3Int(int v1, int v2, int v3) {
901
+ return v1 + v2 + v3 > 0;
902
+ }
903
+ bool PredFunction3Bool(Bool v1, Bool v2, Bool v3) {
904
+ return v1 + v2 + v3 > 0;
905
+ }
906
+
907
+ // A ternary predicate functor.
908
+ struct PredFunctor3 {
909
+ template <typename T1, typename T2, typename T3>
910
+ bool operator()(const T1& v1,
911
+ const T2& v2,
912
+ const T3& v3) {
913
+ return v1 + v2 + v3 > 0;
914
+ }
915
+ };
916
+
917
+ // A ternary predicate-formatter function.
918
+ template <typename T1, typename T2, typename T3>
919
+ testing::AssertionResult PredFormatFunction3(const char* e1,
920
+ const char* e2,
921
+ const char* e3,
922
+ const T1& v1,
923
+ const T2& v2,
924
+ const T3& v3) {
925
+ if (PredFunction3(v1, v2, v3))
926
+ return testing::AssertionSuccess();
927
+
928
+ return testing::AssertionFailure()
929
+ << e1 << " + " << e2 << " + " << e3
930
+ << " is expected to be positive, but evaluates to "
931
+ << v1 + v2 + v3 << ".";
932
+ }
933
+
934
+ // A ternary predicate-formatter functor.
935
+ struct PredFormatFunctor3 {
936
+ template <typename T1, typename T2, typename T3>
937
+ testing::AssertionResult operator()(const char* e1,
938
+ const char* e2,
939
+ const char* e3,
940
+ const T1& v1,
941
+ const T2& v2,
942
+ const T3& v3) const {
943
+ return PredFormatFunction3(e1, e2, e3, v1, v2, v3);
944
+ }
945
+ };
946
+
947
+ // Tests for {EXPECT|ASSERT}_PRED_FORMAT3.
948
+
949
+ class Predicate3Test : public testing::Test {
950
+ protected:
951
+ virtual void SetUp() {
952
+ expected_to_finish_ = true;
953
+ finished_ = false;
954
+ n1_ = n2_ = n3_ = 0;
955
+ }
956
+
957
+ virtual void TearDown() {
958
+ // Verifies that each of the predicate's arguments was evaluated
959
+ // exactly once.
960
+ EXPECT_EQ(1, n1_) <<
961
+ "The predicate assertion didn't evaluate argument 2 "
962
+ "exactly once.";
963
+ EXPECT_EQ(1, n2_) <<
964
+ "The predicate assertion didn't evaluate argument 3 "
965
+ "exactly once.";
966
+ EXPECT_EQ(1, n3_) <<
967
+ "The predicate assertion didn't evaluate argument 4 "
968
+ "exactly once.";
969
+
970
+ // Verifies that the control flow in the test function is expected.
971
+ if (expected_to_finish_ && !finished_) {
972
+ FAIL() << "The predicate assertion unexpactedly aborted the test.";
973
+ } else if (!expected_to_finish_ && finished_) {
974
+ FAIL() << "The failed predicate assertion didn't abort the test "
975
+ "as expected.";
976
+ }
977
+ }
978
+
979
+ // true iff the test function is expected to run to finish.
980
+ static bool expected_to_finish_;
981
+
982
+ // true iff the test function did run to finish.
983
+ static bool finished_;
984
+
985
+ static int n1_;
986
+ static int n2_;
987
+ static int n3_;
988
+ };
989
+
990
+ bool Predicate3Test::expected_to_finish_;
991
+ bool Predicate3Test::finished_;
992
+ int Predicate3Test::n1_;
993
+ int Predicate3Test::n2_;
994
+ int Predicate3Test::n3_;
995
+
996
+ typedef Predicate3Test EXPECT_PRED_FORMAT3Test;
997
+ typedef Predicate3Test ASSERT_PRED_FORMAT3Test;
998
+ typedef Predicate3Test EXPECT_PRED3Test;
999
+ typedef Predicate3Test ASSERT_PRED3Test;
1000
+
1001
+ // Tests a successful EXPECT_PRED3 where the
1002
+ // predicate-formatter is a function on a built-in type (int).
1003
+ TEST_F(EXPECT_PRED3Test, FunctionOnBuiltInTypeSuccess) {
1004
+ EXPECT_PRED3(PredFunction3Int,
1005
+ ++n1_,
1006
+ ++n2_,
1007
+ ++n3_);
1008
+ finished_ = true;
1009
+ }
1010
+
1011
+ // Tests a successful EXPECT_PRED3 where the
1012
+ // predicate-formatter is a function on a user-defined type (Bool).
1013
+ TEST_F(EXPECT_PRED3Test, FunctionOnUserTypeSuccess) {
1014
+ EXPECT_PRED3(PredFunction3Bool,
1015
+ Bool(++n1_),
1016
+ Bool(++n2_),
1017
+ Bool(++n3_));
1018
+ finished_ = true;
1019
+ }
1020
+
1021
+ // Tests a successful EXPECT_PRED3 where the
1022
+ // predicate-formatter is a functor on a built-in type (int).
1023
+ TEST_F(EXPECT_PRED3Test, FunctorOnBuiltInTypeSuccess) {
1024
+ EXPECT_PRED3(PredFunctor3(),
1025
+ ++n1_,
1026
+ ++n2_,
1027
+ ++n3_);
1028
+ finished_ = true;
1029
+ }
1030
+
1031
+ // Tests a successful EXPECT_PRED3 where the
1032
+ // predicate-formatter is a functor on a user-defined type (Bool).
1033
+ TEST_F(EXPECT_PRED3Test, FunctorOnUserTypeSuccess) {
1034
+ EXPECT_PRED3(PredFunctor3(),
1035
+ Bool(++n1_),
1036
+ Bool(++n2_),
1037
+ Bool(++n3_));
1038
+ finished_ = true;
1039
+ }
1040
+
1041
+ // Tests a failed EXPECT_PRED3 where the
1042
+ // predicate-formatter is a function on a built-in type (int).
1043
+ TEST_F(EXPECT_PRED3Test, FunctionOnBuiltInTypeFailure) {
1044
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1045
+ EXPECT_PRED3(PredFunction3Int,
1046
+ n1_++,
1047
+ n2_++,
1048
+ n3_++);
1049
+ finished_ = true;
1050
+ }, "");
1051
+ }
1052
+
1053
+ // Tests a failed EXPECT_PRED3 where the
1054
+ // predicate-formatter is a function on a user-defined type (Bool).
1055
+ TEST_F(EXPECT_PRED3Test, FunctionOnUserTypeFailure) {
1056
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1057
+ EXPECT_PRED3(PredFunction3Bool,
1058
+ Bool(n1_++),
1059
+ Bool(n2_++),
1060
+ Bool(n3_++));
1061
+ finished_ = true;
1062
+ }, "");
1063
+ }
1064
+
1065
+ // Tests a failed EXPECT_PRED3 where the
1066
+ // predicate-formatter is a functor on a built-in type (int).
1067
+ TEST_F(EXPECT_PRED3Test, FunctorOnBuiltInTypeFailure) {
1068
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1069
+ EXPECT_PRED3(PredFunctor3(),
1070
+ n1_++,
1071
+ n2_++,
1072
+ n3_++);
1073
+ finished_ = true;
1074
+ }, "");
1075
+ }
1076
+
1077
+ // Tests a failed EXPECT_PRED3 where the
1078
+ // predicate-formatter is a functor on a user-defined type (Bool).
1079
+ TEST_F(EXPECT_PRED3Test, FunctorOnUserTypeFailure) {
1080
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1081
+ EXPECT_PRED3(PredFunctor3(),
1082
+ Bool(n1_++),
1083
+ Bool(n2_++),
1084
+ Bool(n3_++));
1085
+ finished_ = true;
1086
+ }, "");
1087
+ }
1088
+
1089
+ // Tests a successful ASSERT_PRED3 where the
1090
+ // predicate-formatter is a function on a built-in type (int).
1091
+ TEST_F(ASSERT_PRED3Test, FunctionOnBuiltInTypeSuccess) {
1092
+ ASSERT_PRED3(PredFunction3Int,
1093
+ ++n1_,
1094
+ ++n2_,
1095
+ ++n3_);
1096
+ finished_ = true;
1097
+ }
1098
+
1099
+ // Tests a successful ASSERT_PRED3 where the
1100
+ // predicate-formatter is a function on a user-defined type (Bool).
1101
+ TEST_F(ASSERT_PRED3Test, FunctionOnUserTypeSuccess) {
1102
+ ASSERT_PRED3(PredFunction3Bool,
1103
+ Bool(++n1_),
1104
+ Bool(++n2_),
1105
+ Bool(++n3_));
1106
+ finished_ = true;
1107
+ }
1108
+
1109
+ // Tests a successful ASSERT_PRED3 where the
1110
+ // predicate-formatter is a functor on a built-in type (int).
1111
+ TEST_F(ASSERT_PRED3Test, FunctorOnBuiltInTypeSuccess) {
1112
+ ASSERT_PRED3(PredFunctor3(),
1113
+ ++n1_,
1114
+ ++n2_,
1115
+ ++n3_);
1116
+ finished_ = true;
1117
+ }
1118
+
1119
+ // Tests a successful ASSERT_PRED3 where the
1120
+ // predicate-formatter is a functor on a user-defined type (Bool).
1121
+ TEST_F(ASSERT_PRED3Test, FunctorOnUserTypeSuccess) {
1122
+ ASSERT_PRED3(PredFunctor3(),
1123
+ Bool(++n1_),
1124
+ Bool(++n2_),
1125
+ Bool(++n3_));
1126
+ finished_ = true;
1127
+ }
1128
+
1129
+ // Tests a failed ASSERT_PRED3 where the
1130
+ // predicate-formatter is a function on a built-in type (int).
1131
+ TEST_F(ASSERT_PRED3Test, FunctionOnBuiltInTypeFailure) {
1132
+ expected_to_finish_ = false;
1133
+ EXPECT_FATAL_FAILURE({ // NOLINT
1134
+ ASSERT_PRED3(PredFunction3Int,
1135
+ n1_++,
1136
+ n2_++,
1137
+ n3_++);
1138
+ finished_ = true;
1139
+ }, "");
1140
+ }
1141
+
1142
+ // Tests a failed ASSERT_PRED3 where the
1143
+ // predicate-formatter is a function on a user-defined type (Bool).
1144
+ TEST_F(ASSERT_PRED3Test, FunctionOnUserTypeFailure) {
1145
+ expected_to_finish_ = false;
1146
+ EXPECT_FATAL_FAILURE({ // NOLINT
1147
+ ASSERT_PRED3(PredFunction3Bool,
1148
+ Bool(n1_++),
1149
+ Bool(n2_++),
1150
+ Bool(n3_++));
1151
+ finished_ = true;
1152
+ }, "");
1153
+ }
1154
+
1155
+ // Tests a failed ASSERT_PRED3 where the
1156
+ // predicate-formatter is a functor on a built-in type (int).
1157
+ TEST_F(ASSERT_PRED3Test, FunctorOnBuiltInTypeFailure) {
1158
+ expected_to_finish_ = false;
1159
+ EXPECT_FATAL_FAILURE({ // NOLINT
1160
+ ASSERT_PRED3(PredFunctor3(),
1161
+ n1_++,
1162
+ n2_++,
1163
+ n3_++);
1164
+ finished_ = true;
1165
+ }, "");
1166
+ }
1167
+
1168
+ // Tests a failed ASSERT_PRED3 where the
1169
+ // predicate-formatter is a functor on a user-defined type (Bool).
1170
+ TEST_F(ASSERT_PRED3Test, FunctorOnUserTypeFailure) {
1171
+ expected_to_finish_ = false;
1172
+ EXPECT_FATAL_FAILURE({ // NOLINT
1173
+ ASSERT_PRED3(PredFunctor3(),
1174
+ Bool(n1_++),
1175
+ Bool(n2_++),
1176
+ Bool(n3_++));
1177
+ finished_ = true;
1178
+ }, "");
1179
+ }
1180
+
1181
+ // Tests a successful EXPECT_PRED_FORMAT3 where the
1182
+ // predicate-formatter is a function on a built-in type (int).
1183
+ TEST_F(EXPECT_PRED_FORMAT3Test, FunctionOnBuiltInTypeSuccess) {
1184
+ EXPECT_PRED_FORMAT3(PredFormatFunction3,
1185
+ ++n1_,
1186
+ ++n2_,
1187
+ ++n3_);
1188
+ finished_ = true;
1189
+ }
1190
+
1191
+ // Tests a successful EXPECT_PRED_FORMAT3 where the
1192
+ // predicate-formatter is a function on a user-defined type (Bool).
1193
+ TEST_F(EXPECT_PRED_FORMAT3Test, FunctionOnUserTypeSuccess) {
1194
+ EXPECT_PRED_FORMAT3(PredFormatFunction3,
1195
+ Bool(++n1_),
1196
+ Bool(++n2_),
1197
+ Bool(++n3_));
1198
+ finished_ = true;
1199
+ }
1200
+
1201
+ // Tests a successful EXPECT_PRED_FORMAT3 where the
1202
+ // predicate-formatter is a functor on a built-in type (int).
1203
+ TEST_F(EXPECT_PRED_FORMAT3Test, FunctorOnBuiltInTypeSuccess) {
1204
+ EXPECT_PRED_FORMAT3(PredFormatFunctor3(),
1205
+ ++n1_,
1206
+ ++n2_,
1207
+ ++n3_);
1208
+ finished_ = true;
1209
+ }
1210
+
1211
+ // Tests a successful EXPECT_PRED_FORMAT3 where the
1212
+ // predicate-formatter is a functor on a user-defined type (Bool).
1213
+ TEST_F(EXPECT_PRED_FORMAT3Test, FunctorOnUserTypeSuccess) {
1214
+ EXPECT_PRED_FORMAT3(PredFormatFunctor3(),
1215
+ Bool(++n1_),
1216
+ Bool(++n2_),
1217
+ Bool(++n3_));
1218
+ finished_ = true;
1219
+ }
1220
+
1221
+ // Tests a failed EXPECT_PRED_FORMAT3 where the
1222
+ // predicate-formatter is a function on a built-in type (int).
1223
+ TEST_F(EXPECT_PRED_FORMAT3Test, FunctionOnBuiltInTypeFailure) {
1224
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1225
+ EXPECT_PRED_FORMAT3(PredFormatFunction3,
1226
+ n1_++,
1227
+ n2_++,
1228
+ n3_++);
1229
+ finished_ = true;
1230
+ }, "");
1231
+ }
1232
+
1233
+ // Tests a failed EXPECT_PRED_FORMAT3 where the
1234
+ // predicate-formatter is a function on a user-defined type (Bool).
1235
+ TEST_F(EXPECT_PRED_FORMAT3Test, FunctionOnUserTypeFailure) {
1236
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1237
+ EXPECT_PRED_FORMAT3(PredFormatFunction3,
1238
+ Bool(n1_++),
1239
+ Bool(n2_++),
1240
+ Bool(n3_++));
1241
+ finished_ = true;
1242
+ }, "");
1243
+ }
1244
+
1245
+ // Tests a failed EXPECT_PRED_FORMAT3 where the
1246
+ // predicate-formatter is a functor on a built-in type (int).
1247
+ TEST_F(EXPECT_PRED_FORMAT3Test, FunctorOnBuiltInTypeFailure) {
1248
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1249
+ EXPECT_PRED_FORMAT3(PredFormatFunctor3(),
1250
+ n1_++,
1251
+ n2_++,
1252
+ n3_++);
1253
+ finished_ = true;
1254
+ }, "");
1255
+ }
1256
+
1257
+ // Tests a failed EXPECT_PRED_FORMAT3 where the
1258
+ // predicate-formatter is a functor on a user-defined type (Bool).
1259
+ TEST_F(EXPECT_PRED_FORMAT3Test, FunctorOnUserTypeFailure) {
1260
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1261
+ EXPECT_PRED_FORMAT3(PredFormatFunctor3(),
1262
+ Bool(n1_++),
1263
+ Bool(n2_++),
1264
+ Bool(n3_++));
1265
+ finished_ = true;
1266
+ }, "");
1267
+ }
1268
+
1269
+ // Tests a successful ASSERT_PRED_FORMAT3 where the
1270
+ // predicate-formatter is a function on a built-in type (int).
1271
+ TEST_F(ASSERT_PRED_FORMAT3Test, FunctionOnBuiltInTypeSuccess) {
1272
+ ASSERT_PRED_FORMAT3(PredFormatFunction3,
1273
+ ++n1_,
1274
+ ++n2_,
1275
+ ++n3_);
1276
+ finished_ = true;
1277
+ }
1278
+
1279
+ // Tests a successful ASSERT_PRED_FORMAT3 where the
1280
+ // predicate-formatter is a function on a user-defined type (Bool).
1281
+ TEST_F(ASSERT_PRED_FORMAT3Test, FunctionOnUserTypeSuccess) {
1282
+ ASSERT_PRED_FORMAT3(PredFormatFunction3,
1283
+ Bool(++n1_),
1284
+ Bool(++n2_),
1285
+ Bool(++n3_));
1286
+ finished_ = true;
1287
+ }
1288
+
1289
+ // Tests a successful ASSERT_PRED_FORMAT3 where the
1290
+ // predicate-formatter is a functor on a built-in type (int).
1291
+ TEST_F(ASSERT_PRED_FORMAT3Test, FunctorOnBuiltInTypeSuccess) {
1292
+ ASSERT_PRED_FORMAT3(PredFormatFunctor3(),
1293
+ ++n1_,
1294
+ ++n2_,
1295
+ ++n3_);
1296
+ finished_ = true;
1297
+ }
1298
+
1299
+ // Tests a successful ASSERT_PRED_FORMAT3 where the
1300
+ // predicate-formatter is a functor on a user-defined type (Bool).
1301
+ TEST_F(ASSERT_PRED_FORMAT3Test, FunctorOnUserTypeSuccess) {
1302
+ ASSERT_PRED_FORMAT3(PredFormatFunctor3(),
1303
+ Bool(++n1_),
1304
+ Bool(++n2_),
1305
+ Bool(++n3_));
1306
+ finished_ = true;
1307
+ }
1308
+
1309
+ // Tests a failed ASSERT_PRED_FORMAT3 where the
1310
+ // predicate-formatter is a function on a built-in type (int).
1311
+ TEST_F(ASSERT_PRED_FORMAT3Test, FunctionOnBuiltInTypeFailure) {
1312
+ expected_to_finish_ = false;
1313
+ EXPECT_FATAL_FAILURE({ // NOLINT
1314
+ ASSERT_PRED_FORMAT3(PredFormatFunction3,
1315
+ n1_++,
1316
+ n2_++,
1317
+ n3_++);
1318
+ finished_ = true;
1319
+ }, "");
1320
+ }
1321
+
1322
+ // Tests a failed ASSERT_PRED_FORMAT3 where the
1323
+ // predicate-formatter is a function on a user-defined type (Bool).
1324
+ TEST_F(ASSERT_PRED_FORMAT3Test, FunctionOnUserTypeFailure) {
1325
+ expected_to_finish_ = false;
1326
+ EXPECT_FATAL_FAILURE({ // NOLINT
1327
+ ASSERT_PRED_FORMAT3(PredFormatFunction3,
1328
+ Bool(n1_++),
1329
+ Bool(n2_++),
1330
+ Bool(n3_++));
1331
+ finished_ = true;
1332
+ }, "");
1333
+ }
1334
+
1335
+ // Tests a failed ASSERT_PRED_FORMAT3 where the
1336
+ // predicate-formatter is a functor on a built-in type (int).
1337
+ TEST_F(ASSERT_PRED_FORMAT3Test, FunctorOnBuiltInTypeFailure) {
1338
+ expected_to_finish_ = false;
1339
+ EXPECT_FATAL_FAILURE({ // NOLINT
1340
+ ASSERT_PRED_FORMAT3(PredFormatFunctor3(),
1341
+ n1_++,
1342
+ n2_++,
1343
+ n3_++);
1344
+ finished_ = true;
1345
+ }, "");
1346
+ }
1347
+
1348
+ // Tests a failed ASSERT_PRED_FORMAT3 where the
1349
+ // predicate-formatter is a functor on a user-defined type (Bool).
1350
+ TEST_F(ASSERT_PRED_FORMAT3Test, FunctorOnUserTypeFailure) {
1351
+ expected_to_finish_ = false;
1352
+ EXPECT_FATAL_FAILURE({ // NOLINT
1353
+ ASSERT_PRED_FORMAT3(PredFormatFunctor3(),
1354
+ Bool(n1_++),
1355
+ Bool(n2_++),
1356
+ Bool(n3_++));
1357
+ finished_ = true;
1358
+ }, "");
1359
+ }
1360
+ // Sample functions/functors for testing 4-ary predicate assertions.
1361
+
1362
+ // A 4-ary predicate function.
1363
+ template <typename T1, typename T2, typename T3, typename T4>
1364
+ bool PredFunction4(T1 v1, T2 v2, T3 v3, T4 v4) {
1365
+ return v1 + v2 + v3 + v4 > 0;
1366
+ }
1367
+
1368
+ // The following two functions are needed to circumvent a bug in
1369
+ // gcc 2.95.3, which sometimes has problem with the above template
1370
+ // function.
1371
+ bool PredFunction4Int(int v1, int v2, int v3, int v4) {
1372
+ return v1 + v2 + v3 + v4 > 0;
1373
+ }
1374
+ bool PredFunction4Bool(Bool v1, Bool v2, Bool v3, Bool v4) {
1375
+ return v1 + v2 + v3 + v4 > 0;
1376
+ }
1377
+
1378
+ // A 4-ary predicate functor.
1379
+ struct PredFunctor4 {
1380
+ template <typename T1, typename T2, typename T3, typename T4>
1381
+ bool operator()(const T1& v1,
1382
+ const T2& v2,
1383
+ const T3& v3,
1384
+ const T4& v4) {
1385
+ return v1 + v2 + v3 + v4 > 0;
1386
+ }
1387
+ };
1388
+
1389
+ // A 4-ary predicate-formatter function.
1390
+ template <typename T1, typename T2, typename T3, typename T4>
1391
+ testing::AssertionResult PredFormatFunction4(const char* e1,
1392
+ const char* e2,
1393
+ const char* e3,
1394
+ const char* e4,
1395
+ const T1& v1,
1396
+ const T2& v2,
1397
+ const T3& v3,
1398
+ const T4& v4) {
1399
+ if (PredFunction4(v1, v2, v3, v4))
1400
+ return testing::AssertionSuccess();
1401
+
1402
+ return testing::AssertionFailure()
1403
+ << e1 << " + " << e2 << " + " << e3 << " + " << e4
1404
+ << " is expected to be positive, but evaluates to "
1405
+ << v1 + v2 + v3 + v4 << ".";
1406
+ }
1407
+
1408
+ // A 4-ary predicate-formatter functor.
1409
+ struct PredFormatFunctor4 {
1410
+ template <typename T1, typename T2, typename T3, typename T4>
1411
+ testing::AssertionResult operator()(const char* e1,
1412
+ const char* e2,
1413
+ const char* e3,
1414
+ const char* e4,
1415
+ const T1& v1,
1416
+ const T2& v2,
1417
+ const T3& v3,
1418
+ const T4& v4) const {
1419
+ return PredFormatFunction4(e1, e2, e3, e4, v1, v2, v3, v4);
1420
+ }
1421
+ };
1422
+
1423
+ // Tests for {EXPECT|ASSERT}_PRED_FORMAT4.
1424
+
1425
+ class Predicate4Test : public testing::Test {
1426
+ protected:
1427
+ virtual void SetUp() {
1428
+ expected_to_finish_ = true;
1429
+ finished_ = false;
1430
+ n1_ = n2_ = n3_ = n4_ = 0;
1431
+ }
1432
+
1433
+ virtual void TearDown() {
1434
+ // Verifies that each of the predicate's arguments was evaluated
1435
+ // exactly once.
1436
+ EXPECT_EQ(1, n1_) <<
1437
+ "The predicate assertion didn't evaluate argument 2 "
1438
+ "exactly once.";
1439
+ EXPECT_EQ(1, n2_) <<
1440
+ "The predicate assertion didn't evaluate argument 3 "
1441
+ "exactly once.";
1442
+ EXPECT_EQ(1, n3_) <<
1443
+ "The predicate assertion didn't evaluate argument 4 "
1444
+ "exactly once.";
1445
+ EXPECT_EQ(1, n4_) <<
1446
+ "The predicate assertion didn't evaluate argument 5 "
1447
+ "exactly once.";
1448
+
1449
+ // Verifies that the control flow in the test function is expected.
1450
+ if (expected_to_finish_ && !finished_) {
1451
+ FAIL() << "The predicate assertion unexpactedly aborted the test.";
1452
+ } else if (!expected_to_finish_ && finished_) {
1453
+ FAIL() << "The failed predicate assertion didn't abort the test "
1454
+ "as expected.";
1455
+ }
1456
+ }
1457
+
1458
+ // true iff the test function is expected to run to finish.
1459
+ static bool expected_to_finish_;
1460
+
1461
+ // true iff the test function did run to finish.
1462
+ static bool finished_;
1463
+
1464
+ static int n1_;
1465
+ static int n2_;
1466
+ static int n3_;
1467
+ static int n4_;
1468
+ };
1469
+
1470
+ bool Predicate4Test::expected_to_finish_;
1471
+ bool Predicate4Test::finished_;
1472
+ int Predicate4Test::n1_;
1473
+ int Predicate4Test::n2_;
1474
+ int Predicate4Test::n3_;
1475
+ int Predicate4Test::n4_;
1476
+
1477
+ typedef Predicate4Test EXPECT_PRED_FORMAT4Test;
1478
+ typedef Predicate4Test ASSERT_PRED_FORMAT4Test;
1479
+ typedef Predicate4Test EXPECT_PRED4Test;
1480
+ typedef Predicate4Test ASSERT_PRED4Test;
1481
+
1482
+ // Tests a successful EXPECT_PRED4 where the
1483
+ // predicate-formatter is a function on a built-in type (int).
1484
+ TEST_F(EXPECT_PRED4Test, FunctionOnBuiltInTypeSuccess) {
1485
+ EXPECT_PRED4(PredFunction4Int,
1486
+ ++n1_,
1487
+ ++n2_,
1488
+ ++n3_,
1489
+ ++n4_);
1490
+ finished_ = true;
1491
+ }
1492
+
1493
+ // Tests a successful EXPECT_PRED4 where the
1494
+ // predicate-formatter is a function on a user-defined type (Bool).
1495
+ TEST_F(EXPECT_PRED4Test, FunctionOnUserTypeSuccess) {
1496
+ EXPECT_PRED4(PredFunction4Bool,
1497
+ Bool(++n1_),
1498
+ Bool(++n2_),
1499
+ Bool(++n3_),
1500
+ Bool(++n4_));
1501
+ finished_ = true;
1502
+ }
1503
+
1504
+ // Tests a successful EXPECT_PRED4 where the
1505
+ // predicate-formatter is a functor on a built-in type (int).
1506
+ TEST_F(EXPECT_PRED4Test, FunctorOnBuiltInTypeSuccess) {
1507
+ EXPECT_PRED4(PredFunctor4(),
1508
+ ++n1_,
1509
+ ++n2_,
1510
+ ++n3_,
1511
+ ++n4_);
1512
+ finished_ = true;
1513
+ }
1514
+
1515
+ // Tests a successful EXPECT_PRED4 where the
1516
+ // predicate-formatter is a functor on a user-defined type (Bool).
1517
+ TEST_F(EXPECT_PRED4Test, FunctorOnUserTypeSuccess) {
1518
+ EXPECT_PRED4(PredFunctor4(),
1519
+ Bool(++n1_),
1520
+ Bool(++n2_),
1521
+ Bool(++n3_),
1522
+ Bool(++n4_));
1523
+ finished_ = true;
1524
+ }
1525
+
1526
+ // Tests a failed EXPECT_PRED4 where the
1527
+ // predicate-formatter is a function on a built-in type (int).
1528
+ TEST_F(EXPECT_PRED4Test, FunctionOnBuiltInTypeFailure) {
1529
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1530
+ EXPECT_PRED4(PredFunction4Int,
1531
+ n1_++,
1532
+ n2_++,
1533
+ n3_++,
1534
+ n4_++);
1535
+ finished_ = true;
1536
+ }, "");
1537
+ }
1538
+
1539
+ // Tests a failed EXPECT_PRED4 where the
1540
+ // predicate-formatter is a function on a user-defined type (Bool).
1541
+ TEST_F(EXPECT_PRED4Test, FunctionOnUserTypeFailure) {
1542
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1543
+ EXPECT_PRED4(PredFunction4Bool,
1544
+ Bool(n1_++),
1545
+ Bool(n2_++),
1546
+ Bool(n3_++),
1547
+ Bool(n4_++));
1548
+ finished_ = true;
1549
+ }, "");
1550
+ }
1551
+
1552
+ // Tests a failed EXPECT_PRED4 where the
1553
+ // predicate-formatter is a functor on a built-in type (int).
1554
+ TEST_F(EXPECT_PRED4Test, FunctorOnBuiltInTypeFailure) {
1555
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1556
+ EXPECT_PRED4(PredFunctor4(),
1557
+ n1_++,
1558
+ n2_++,
1559
+ n3_++,
1560
+ n4_++);
1561
+ finished_ = true;
1562
+ }, "");
1563
+ }
1564
+
1565
+ // Tests a failed EXPECT_PRED4 where the
1566
+ // predicate-formatter is a functor on a user-defined type (Bool).
1567
+ TEST_F(EXPECT_PRED4Test, FunctorOnUserTypeFailure) {
1568
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1569
+ EXPECT_PRED4(PredFunctor4(),
1570
+ Bool(n1_++),
1571
+ Bool(n2_++),
1572
+ Bool(n3_++),
1573
+ Bool(n4_++));
1574
+ finished_ = true;
1575
+ }, "");
1576
+ }
1577
+
1578
+ // Tests a successful ASSERT_PRED4 where the
1579
+ // predicate-formatter is a function on a built-in type (int).
1580
+ TEST_F(ASSERT_PRED4Test, FunctionOnBuiltInTypeSuccess) {
1581
+ ASSERT_PRED4(PredFunction4Int,
1582
+ ++n1_,
1583
+ ++n2_,
1584
+ ++n3_,
1585
+ ++n4_);
1586
+ finished_ = true;
1587
+ }
1588
+
1589
+ // Tests a successful ASSERT_PRED4 where the
1590
+ // predicate-formatter is a function on a user-defined type (Bool).
1591
+ TEST_F(ASSERT_PRED4Test, FunctionOnUserTypeSuccess) {
1592
+ ASSERT_PRED4(PredFunction4Bool,
1593
+ Bool(++n1_),
1594
+ Bool(++n2_),
1595
+ Bool(++n3_),
1596
+ Bool(++n4_));
1597
+ finished_ = true;
1598
+ }
1599
+
1600
+ // Tests a successful ASSERT_PRED4 where the
1601
+ // predicate-formatter is a functor on a built-in type (int).
1602
+ TEST_F(ASSERT_PRED4Test, FunctorOnBuiltInTypeSuccess) {
1603
+ ASSERT_PRED4(PredFunctor4(),
1604
+ ++n1_,
1605
+ ++n2_,
1606
+ ++n3_,
1607
+ ++n4_);
1608
+ finished_ = true;
1609
+ }
1610
+
1611
+ // Tests a successful ASSERT_PRED4 where the
1612
+ // predicate-formatter is a functor on a user-defined type (Bool).
1613
+ TEST_F(ASSERT_PRED4Test, FunctorOnUserTypeSuccess) {
1614
+ ASSERT_PRED4(PredFunctor4(),
1615
+ Bool(++n1_),
1616
+ Bool(++n2_),
1617
+ Bool(++n3_),
1618
+ Bool(++n4_));
1619
+ finished_ = true;
1620
+ }
1621
+
1622
+ // Tests a failed ASSERT_PRED4 where the
1623
+ // predicate-formatter is a function on a built-in type (int).
1624
+ TEST_F(ASSERT_PRED4Test, FunctionOnBuiltInTypeFailure) {
1625
+ expected_to_finish_ = false;
1626
+ EXPECT_FATAL_FAILURE({ // NOLINT
1627
+ ASSERT_PRED4(PredFunction4Int,
1628
+ n1_++,
1629
+ n2_++,
1630
+ n3_++,
1631
+ n4_++);
1632
+ finished_ = true;
1633
+ }, "");
1634
+ }
1635
+
1636
+ // Tests a failed ASSERT_PRED4 where the
1637
+ // predicate-formatter is a function on a user-defined type (Bool).
1638
+ TEST_F(ASSERT_PRED4Test, FunctionOnUserTypeFailure) {
1639
+ expected_to_finish_ = false;
1640
+ EXPECT_FATAL_FAILURE({ // NOLINT
1641
+ ASSERT_PRED4(PredFunction4Bool,
1642
+ Bool(n1_++),
1643
+ Bool(n2_++),
1644
+ Bool(n3_++),
1645
+ Bool(n4_++));
1646
+ finished_ = true;
1647
+ }, "");
1648
+ }
1649
+
1650
+ // Tests a failed ASSERT_PRED4 where the
1651
+ // predicate-formatter is a functor on a built-in type (int).
1652
+ TEST_F(ASSERT_PRED4Test, FunctorOnBuiltInTypeFailure) {
1653
+ expected_to_finish_ = false;
1654
+ EXPECT_FATAL_FAILURE({ // NOLINT
1655
+ ASSERT_PRED4(PredFunctor4(),
1656
+ n1_++,
1657
+ n2_++,
1658
+ n3_++,
1659
+ n4_++);
1660
+ finished_ = true;
1661
+ }, "");
1662
+ }
1663
+
1664
+ // Tests a failed ASSERT_PRED4 where the
1665
+ // predicate-formatter is a functor on a user-defined type (Bool).
1666
+ TEST_F(ASSERT_PRED4Test, FunctorOnUserTypeFailure) {
1667
+ expected_to_finish_ = false;
1668
+ EXPECT_FATAL_FAILURE({ // NOLINT
1669
+ ASSERT_PRED4(PredFunctor4(),
1670
+ Bool(n1_++),
1671
+ Bool(n2_++),
1672
+ Bool(n3_++),
1673
+ Bool(n4_++));
1674
+ finished_ = true;
1675
+ }, "");
1676
+ }
1677
+
1678
+ // Tests a successful EXPECT_PRED_FORMAT4 where the
1679
+ // predicate-formatter is a function on a built-in type (int).
1680
+ TEST_F(EXPECT_PRED_FORMAT4Test, FunctionOnBuiltInTypeSuccess) {
1681
+ EXPECT_PRED_FORMAT4(PredFormatFunction4,
1682
+ ++n1_,
1683
+ ++n2_,
1684
+ ++n3_,
1685
+ ++n4_);
1686
+ finished_ = true;
1687
+ }
1688
+
1689
+ // Tests a successful EXPECT_PRED_FORMAT4 where the
1690
+ // predicate-formatter is a function on a user-defined type (Bool).
1691
+ TEST_F(EXPECT_PRED_FORMAT4Test, FunctionOnUserTypeSuccess) {
1692
+ EXPECT_PRED_FORMAT4(PredFormatFunction4,
1693
+ Bool(++n1_),
1694
+ Bool(++n2_),
1695
+ Bool(++n3_),
1696
+ Bool(++n4_));
1697
+ finished_ = true;
1698
+ }
1699
+
1700
+ // Tests a successful EXPECT_PRED_FORMAT4 where the
1701
+ // predicate-formatter is a functor on a built-in type (int).
1702
+ TEST_F(EXPECT_PRED_FORMAT4Test, FunctorOnBuiltInTypeSuccess) {
1703
+ EXPECT_PRED_FORMAT4(PredFormatFunctor4(),
1704
+ ++n1_,
1705
+ ++n2_,
1706
+ ++n3_,
1707
+ ++n4_);
1708
+ finished_ = true;
1709
+ }
1710
+
1711
+ // Tests a successful EXPECT_PRED_FORMAT4 where the
1712
+ // predicate-formatter is a functor on a user-defined type (Bool).
1713
+ TEST_F(EXPECT_PRED_FORMAT4Test, FunctorOnUserTypeSuccess) {
1714
+ EXPECT_PRED_FORMAT4(PredFormatFunctor4(),
1715
+ Bool(++n1_),
1716
+ Bool(++n2_),
1717
+ Bool(++n3_),
1718
+ Bool(++n4_));
1719
+ finished_ = true;
1720
+ }
1721
+
1722
+ // Tests a failed EXPECT_PRED_FORMAT4 where the
1723
+ // predicate-formatter is a function on a built-in type (int).
1724
+ TEST_F(EXPECT_PRED_FORMAT4Test, FunctionOnBuiltInTypeFailure) {
1725
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1726
+ EXPECT_PRED_FORMAT4(PredFormatFunction4,
1727
+ n1_++,
1728
+ n2_++,
1729
+ n3_++,
1730
+ n4_++);
1731
+ finished_ = true;
1732
+ }, "");
1733
+ }
1734
+
1735
+ // Tests a failed EXPECT_PRED_FORMAT4 where the
1736
+ // predicate-formatter is a function on a user-defined type (Bool).
1737
+ TEST_F(EXPECT_PRED_FORMAT4Test, FunctionOnUserTypeFailure) {
1738
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1739
+ EXPECT_PRED_FORMAT4(PredFormatFunction4,
1740
+ Bool(n1_++),
1741
+ Bool(n2_++),
1742
+ Bool(n3_++),
1743
+ Bool(n4_++));
1744
+ finished_ = true;
1745
+ }, "");
1746
+ }
1747
+
1748
+ // Tests a failed EXPECT_PRED_FORMAT4 where the
1749
+ // predicate-formatter is a functor on a built-in type (int).
1750
+ TEST_F(EXPECT_PRED_FORMAT4Test, FunctorOnBuiltInTypeFailure) {
1751
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1752
+ EXPECT_PRED_FORMAT4(PredFormatFunctor4(),
1753
+ n1_++,
1754
+ n2_++,
1755
+ n3_++,
1756
+ n4_++);
1757
+ finished_ = true;
1758
+ }, "");
1759
+ }
1760
+
1761
+ // Tests a failed EXPECT_PRED_FORMAT4 where the
1762
+ // predicate-formatter is a functor on a user-defined type (Bool).
1763
+ TEST_F(EXPECT_PRED_FORMAT4Test, FunctorOnUserTypeFailure) {
1764
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
1765
+ EXPECT_PRED_FORMAT4(PredFormatFunctor4(),
1766
+ Bool(n1_++),
1767
+ Bool(n2_++),
1768
+ Bool(n3_++),
1769
+ Bool(n4_++));
1770
+ finished_ = true;
1771
+ }, "");
1772
+ }
1773
+
1774
+ // Tests a successful ASSERT_PRED_FORMAT4 where the
1775
+ // predicate-formatter is a function on a built-in type (int).
1776
+ TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnBuiltInTypeSuccess) {
1777
+ ASSERT_PRED_FORMAT4(PredFormatFunction4,
1778
+ ++n1_,
1779
+ ++n2_,
1780
+ ++n3_,
1781
+ ++n4_);
1782
+ finished_ = true;
1783
+ }
1784
+
1785
+ // Tests a successful ASSERT_PRED_FORMAT4 where the
1786
+ // predicate-formatter is a function on a user-defined type (Bool).
1787
+ TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnUserTypeSuccess) {
1788
+ ASSERT_PRED_FORMAT4(PredFormatFunction4,
1789
+ Bool(++n1_),
1790
+ Bool(++n2_),
1791
+ Bool(++n3_),
1792
+ Bool(++n4_));
1793
+ finished_ = true;
1794
+ }
1795
+
1796
+ // Tests a successful ASSERT_PRED_FORMAT4 where the
1797
+ // predicate-formatter is a functor on a built-in type (int).
1798
+ TEST_F(ASSERT_PRED_FORMAT4Test, FunctorOnBuiltInTypeSuccess) {
1799
+ ASSERT_PRED_FORMAT4(PredFormatFunctor4(),
1800
+ ++n1_,
1801
+ ++n2_,
1802
+ ++n3_,
1803
+ ++n4_);
1804
+ finished_ = true;
1805
+ }
1806
+
1807
+ // Tests a successful ASSERT_PRED_FORMAT4 where the
1808
+ // predicate-formatter is a functor on a user-defined type (Bool).
1809
+ TEST_F(ASSERT_PRED_FORMAT4Test, FunctorOnUserTypeSuccess) {
1810
+ ASSERT_PRED_FORMAT4(PredFormatFunctor4(),
1811
+ Bool(++n1_),
1812
+ Bool(++n2_),
1813
+ Bool(++n3_),
1814
+ Bool(++n4_));
1815
+ finished_ = true;
1816
+ }
1817
+
1818
+ // Tests a failed ASSERT_PRED_FORMAT4 where the
1819
+ // predicate-formatter is a function on a built-in type (int).
1820
+ TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnBuiltInTypeFailure) {
1821
+ expected_to_finish_ = false;
1822
+ EXPECT_FATAL_FAILURE({ // NOLINT
1823
+ ASSERT_PRED_FORMAT4(PredFormatFunction4,
1824
+ n1_++,
1825
+ n2_++,
1826
+ n3_++,
1827
+ n4_++);
1828
+ finished_ = true;
1829
+ }, "");
1830
+ }
1831
+
1832
+ // Tests a failed ASSERT_PRED_FORMAT4 where the
1833
+ // predicate-formatter is a function on a user-defined type (Bool).
1834
+ TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnUserTypeFailure) {
1835
+ expected_to_finish_ = false;
1836
+ EXPECT_FATAL_FAILURE({ // NOLINT
1837
+ ASSERT_PRED_FORMAT4(PredFormatFunction4,
1838
+ Bool(n1_++),
1839
+ Bool(n2_++),
1840
+ Bool(n3_++),
1841
+ Bool(n4_++));
1842
+ finished_ = true;
1843
+ }, "");
1844
+ }
1845
+
1846
+ // Tests a failed ASSERT_PRED_FORMAT4 where the
1847
+ // predicate-formatter is a functor on a built-in type (int).
1848
+ TEST_F(ASSERT_PRED_FORMAT4Test, FunctorOnBuiltInTypeFailure) {
1849
+ expected_to_finish_ = false;
1850
+ EXPECT_FATAL_FAILURE({ // NOLINT
1851
+ ASSERT_PRED_FORMAT4(PredFormatFunctor4(),
1852
+ n1_++,
1853
+ n2_++,
1854
+ n3_++,
1855
+ n4_++);
1856
+ finished_ = true;
1857
+ }, "");
1858
+ }
1859
+
1860
+ // Tests a failed ASSERT_PRED_FORMAT4 where the
1861
+ // predicate-formatter is a functor on a user-defined type (Bool).
1862
+ TEST_F(ASSERT_PRED_FORMAT4Test, FunctorOnUserTypeFailure) {
1863
+ expected_to_finish_ = false;
1864
+ EXPECT_FATAL_FAILURE({ // NOLINT
1865
+ ASSERT_PRED_FORMAT4(PredFormatFunctor4(),
1866
+ Bool(n1_++),
1867
+ Bool(n2_++),
1868
+ Bool(n3_++),
1869
+ Bool(n4_++));
1870
+ finished_ = true;
1871
+ }, "");
1872
+ }
1873
+ // Sample functions/functors for testing 5-ary predicate assertions.
1874
+
1875
+ // A 5-ary predicate function.
1876
+ template <typename T1, typename T2, typename T3, typename T4, typename T5>
1877
+ bool PredFunction5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) {
1878
+ return v1 + v2 + v3 + v4 + v5 > 0;
1879
+ }
1880
+
1881
+ // The following two functions are needed to circumvent a bug in
1882
+ // gcc 2.95.3, which sometimes has problem with the above template
1883
+ // function.
1884
+ bool PredFunction5Int(int v1, int v2, int v3, int v4, int v5) {
1885
+ return v1 + v2 + v3 + v4 + v5 > 0;
1886
+ }
1887
+ bool PredFunction5Bool(Bool v1, Bool v2, Bool v3, Bool v4, Bool v5) {
1888
+ return v1 + v2 + v3 + v4 + v5 > 0;
1889
+ }
1890
+
1891
+ // A 5-ary predicate functor.
1892
+ struct PredFunctor5 {
1893
+ template <typename T1, typename T2, typename T3, typename T4, typename T5>
1894
+ bool operator()(const T1& v1,
1895
+ const T2& v2,
1896
+ const T3& v3,
1897
+ const T4& v4,
1898
+ const T5& v5) {
1899
+ return v1 + v2 + v3 + v4 + v5 > 0;
1900
+ }
1901
+ };
1902
+
1903
+ // A 5-ary predicate-formatter function.
1904
+ template <typename T1, typename T2, typename T3, typename T4, typename T5>
1905
+ testing::AssertionResult PredFormatFunction5(const char* e1,
1906
+ const char* e2,
1907
+ const char* e3,
1908
+ const char* e4,
1909
+ const char* e5,
1910
+ const T1& v1,
1911
+ const T2& v2,
1912
+ const T3& v3,
1913
+ const T4& v4,
1914
+ const T5& v5) {
1915
+ if (PredFunction5(v1, v2, v3, v4, v5))
1916
+ return testing::AssertionSuccess();
1917
+
1918
+ return testing::AssertionFailure()
1919
+ << e1 << " + " << e2 << " + " << e3 << " + " << e4 << " + " << e5
1920
+ << " is expected to be positive, but evaluates to "
1921
+ << v1 + v2 + v3 + v4 + v5 << ".";
1922
+ }
1923
+
1924
+ // A 5-ary predicate-formatter functor.
1925
+ struct PredFormatFunctor5 {
1926
+ template <typename T1, typename T2, typename T3, typename T4, typename T5>
1927
+ testing::AssertionResult operator()(const char* e1,
1928
+ const char* e2,
1929
+ const char* e3,
1930
+ const char* e4,
1931
+ const char* e5,
1932
+ const T1& v1,
1933
+ const T2& v2,
1934
+ const T3& v3,
1935
+ const T4& v4,
1936
+ const T5& v5) const {
1937
+ return PredFormatFunction5(e1, e2, e3, e4, e5, v1, v2, v3, v4, v5);
1938
+ }
1939
+ };
1940
+
1941
+ // Tests for {EXPECT|ASSERT}_PRED_FORMAT5.
1942
+
1943
+ class Predicate5Test : public testing::Test {
1944
+ protected:
1945
+ virtual void SetUp() {
1946
+ expected_to_finish_ = true;
1947
+ finished_ = false;
1948
+ n1_ = n2_ = n3_ = n4_ = n5_ = 0;
1949
+ }
1950
+
1951
+ virtual void TearDown() {
1952
+ // Verifies that each of the predicate's arguments was evaluated
1953
+ // exactly once.
1954
+ EXPECT_EQ(1, n1_) <<
1955
+ "The predicate assertion didn't evaluate argument 2 "
1956
+ "exactly once.";
1957
+ EXPECT_EQ(1, n2_) <<
1958
+ "The predicate assertion didn't evaluate argument 3 "
1959
+ "exactly once.";
1960
+ EXPECT_EQ(1, n3_) <<
1961
+ "The predicate assertion didn't evaluate argument 4 "
1962
+ "exactly once.";
1963
+ EXPECT_EQ(1, n4_) <<
1964
+ "The predicate assertion didn't evaluate argument 5 "
1965
+ "exactly once.";
1966
+ EXPECT_EQ(1, n5_) <<
1967
+ "The predicate assertion didn't evaluate argument 6 "
1968
+ "exactly once.";
1969
+
1970
+ // Verifies that the control flow in the test function is expected.
1971
+ if (expected_to_finish_ && !finished_) {
1972
+ FAIL() << "The predicate assertion unexpactedly aborted the test.";
1973
+ } else if (!expected_to_finish_ && finished_) {
1974
+ FAIL() << "The failed predicate assertion didn't abort the test "
1975
+ "as expected.";
1976
+ }
1977
+ }
1978
+
1979
+ // true iff the test function is expected to run to finish.
1980
+ static bool expected_to_finish_;
1981
+
1982
+ // true iff the test function did run to finish.
1983
+ static bool finished_;
1984
+
1985
+ static int n1_;
1986
+ static int n2_;
1987
+ static int n3_;
1988
+ static int n4_;
1989
+ static int n5_;
1990
+ };
1991
+
1992
+ bool Predicate5Test::expected_to_finish_;
1993
+ bool Predicate5Test::finished_;
1994
+ int Predicate5Test::n1_;
1995
+ int Predicate5Test::n2_;
1996
+ int Predicate5Test::n3_;
1997
+ int Predicate5Test::n4_;
1998
+ int Predicate5Test::n5_;
1999
+
2000
+ typedef Predicate5Test EXPECT_PRED_FORMAT5Test;
2001
+ typedef Predicate5Test ASSERT_PRED_FORMAT5Test;
2002
+ typedef Predicate5Test EXPECT_PRED5Test;
2003
+ typedef Predicate5Test ASSERT_PRED5Test;
2004
+
2005
+ // Tests a successful EXPECT_PRED5 where the
2006
+ // predicate-formatter is a function on a built-in type (int).
2007
+ TEST_F(EXPECT_PRED5Test, FunctionOnBuiltInTypeSuccess) {
2008
+ EXPECT_PRED5(PredFunction5Int,
2009
+ ++n1_,
2010
+ ++n2_,
2011
+ ++n3_,
2012
+ ++n4_,
2013
+ ++n5_);
2014
+ finished_ = true;
2015
+ }
2016
+
2017
+ // Tests a successful EXPECT_PRED5 where the
2018
+ // predicate-formatter is a function on a user-defined type (Bool).
2019
+ TEST_F(EXPECT_PRED5Test, FunctionOnUserTypeSuccess) {
2020
+ EXPECT_PRED5(PredFunction5Bool,
2021
+ Bool(++n1_),
2022
+ Bool(++n2_),
2023
+ Bool(++n3_),
2024
+ Bool(++n4_),
2025
+ Bool(++n5_));
2026
+ finished_ = true;
2027
+ }
2028
+
2029
+ // Tests a successful EXPECT_PRED5 where the
2030
+ // predicate-formatter is a functor on a built-in type (int).
2031
+ TEST_F(EXPECT_PRED5Test, FunctorOnBuiltInTypeSuccess) {
2032
+ EXPECT_PRED5(PredFunctor5(),
2033
+ ++n1_,
2034
+ ++n2_,
2035
+ ++n3_,
2036
+ ++n4_,
2037
+ ++n5_);
2038
+ finished_ = true;
2039
+ }
2040
+
2041
+ // Tests a successful EXPECT_PRED5 where the
2042
+ // predicate-formatter is a functor on a user-defined type (Bool).
2043
+ TEST_F(EXPECT_PRED5Test, FunctorOnUserTypeSuccess) {
2044
+ EXPECT_PRED5(PredFunctor5(),
2045
+ Bool(++n1_),
2046
+ Bool(++n2_),
2047
+ Bool(++n3_),
2048
+ Bool(++n4_),
2049
+ Bool(++n5_));
2050
+ finished_ = true;
2051
+ }
2052
+
2053
+ // Tests a failed EXPECT_PRED5 where the
2054
+ // predicate-formatter is a function on a built-in type (int).
2055
+ TEST_F(EXPECT_PRED5Test, FunctionOnBuiltInTypeFailure) {
2056
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
2057
+ EXPECT_PRED5(PredFunction5Int,
2058
+ n1_++,
2059
+ n2_++,
2060
+ n3_++,
2061
+ n4_++,
2062
+ n5_++);
2063
+ finished_ = true;
2064
+ }, "");
2065
+ }
2066
+
2067
+ // Tests a failed EXPECT_PRED5 where the
2068
+ // predicate-formatter is a function on a user-defined type (Bool).
2069
+ TEST_F(EXPECT_PRED5Test, FunctionOnUserTypeFailure) {
2070
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
2071
+ EXPECT_PRED5(PredFunction5Bool,
2072
+ Bool(n1_++),
2073
+ Bool(n2_++),
2074
+ Bool(n3_++),
2075
+ Bool(n4_++),
2076
+ Bool(n5_++));
2077
+ finished_ = true;
2078
+ }, "");
2079
+ }
2080
+
2081
+ // Tests a failed EXPECT_PRED5 where the
2082
+ // predicate-formatter is a functor on a built-in type (int).
2083
+ TEST_F(EXPECT_PRED5Test, FunctorOnBuiltInTypeFailure) {
2084
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
2085
+ EXPECT_PRED5(PredFunctor5(),
2086
+ n1_++,
2087
+ n2_++,
2088
+ n3_++,
2089
+ n4_++,
2090
+ n5_++);
2091
+ finished_ = true;
2092
+ }, "");
2093
+ }
2094
+
2095
+ // Tests a failed EXPECT_PRED5 where the
2096
+ // predicate-formatter is a functor on a user-defined type (Bool).
2097
+ TEST_F(EXPECT_PRED5Test, FunctorOnUserTypeFailure) {
2098
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
2099
+ EXPECT_PRED5(PredFunctor5(),
2100
+ Bool(n1_++),
2101
+ Bool(n2_++),
2102
+ Bool(n3_++),
2103
+ Bool(n4_++),
2104
+ Bool(n5_++));
2105
+ finished_ = true;
2106
+ }, "");
2107
+ }
2108
+
2109
+ // Tests a successful ASSERT_PRED5 where the
2110
+ // predicate-formatter is a function on a built-in type (int).
2111
+ TEST_F(ASSERT_PRED5Test, FunctionOnBuiltInTypeSuccess) {
2112
+ ASSERT_PRED5(PredFunction5Int,
2113
+ ++n1_,
2114
+ ++n2_,
2115
+ ++n3_,
2116
+ ++n4_,
2117
+ ++n5_);
2118
+ finished_ = true;
2119
+ }
2120
+
2121
+ // Tests a successful ASSERT_PRED5 where the
2122
+ // predicate-formatter is a function on a user-defined type (Bool).
2123
+ TEST_F(ASSERT_PRED5Test, FunctionOnUserTypeSuccess) {
2124
+ ASSERT_PRED5(PredFunction5Bool,
2125
+ Bool(++n1_),
2126
+ Bool(++n2_),
2127
+ Bool(++n3_),
2128
+ Bool(++n4_),
2129
+ Bool(++n5_));
2130
+ finished_ = true;
2131
+ }
2132
+
2133
+ // Tests a successful ASSERT_PRED5 where the
2134
+ // predicate-formatter is a functor on a built-in type (int).
2135
+ TEST_F(ASSERT_PRED5Test, FunctorOnBuiltInTypeSuccess) {
2136
+ ASSERT_PRED5(PredFunctor5(),
2137
+ ++n1_,
2138
+ ++n2_,
2139
+ ++n3_,
2140
+ ++n4_,
2141
+ ++n5_);
2142
+ finished_ = true;
2143
+ }
2144
+
2145
+ // Tests a successful ASSERT_PRED5 where the
2146
+ // predicate-formatter is a functor on a user-defined type (Bool).
2147
+ TEST_F(ASSERT_PRED5Test, FunctorOnUserTypeSuccess) {
2148
+ ASSERT_PRED5(PredFunctor5(),
2149
+ Bool(++n1_),
2150
+ Bool(++n2_),
2151
+ Bool(++n3_),
2152
+ Bool(++n4_),
2153
+ Bool(++n5_));
2154
+ finished_ = true;
2155
+ }
2156
+
2157
+ // Tests a failed ASSERT_PRED5 where the
2158
+ // predicate-formatter is a function on a built-in type (int).
2159
+ TEST_F(ASSERT_PRED5Test, FunctionOnBuiltInTypeFailure) {
2160
+ expected_to_finish_ = false;
2161
+ EXPECT_FATAL_FAILURE({ // NOLINT
2162
+ ASSERT_PRED5(PredFunction5Int,
2163
+ n1_++,
2164
+ n2_++,
2165
+ n3_++,
2166
+ n4_++,
2167
+ n5_++);
2168
+ finished_ = true;
2169
+ }, "");
2170
+ }
2171
+
2172
+ // Tests a failed ASSERT_PRED5 where the
2173
+ // predicate-formatter is a function on a user-defined type (Bool).
2174
+ TEST_F(ASSERT_PRED5Test, FunctionOnUserTypeFailure) {
2175
+ expected_to_finish_ = false;
2176
+ EXPECT_FATAL_FAILURE({ // NOLINT
2177
+ ASSERT_PRED5(PredFunction5Bool,
2178
+ Bool(n1_++),
2179
+ Bool(n2_++),
2180
+ Bool(n3_++),
2181
+ Bool(n4_++),
2182
+ Bool(n5_++));
2183
+ finished_ = true;
2184
+ }, "");
2185
+ }
2186
+
2187
+ // Tests a failed ASSERT_PRED5 where the
2188
+ // predicate-formatter is a functor on a built-in type (int).
2189
+ TEST_F(ASSERT_PRED5Test, FunctorOnBuiltInTypeFailure) {
2190
+ expected_to_finish_ = false;
2191
+ EXPECT_FATAL_FAILURE({ // NOLINT
2192
+ ASSERT_PRED5(PredFunctor5(),
2193
+ n1_++,
2194
+ n2_++,
2195
+ n3_++,
2196
+ n4_++,
2197
+ n5_++);
2198
+ finished_ = true;
2199
+ }, "");
2200
+ }
2201
+
2202
+ // Tests a failed ASSERT_PRED5 where the
2203
+ // predicate-formatter is a functor on a user-defined type (Bool).
2204
+ TEST_F(ASSERT_PRED5Test, FunctorOnUserTypeFailure) {
2205
+ expected_to_finish_ = false;
2206
+ EXPECT_FATAL_FAILURE({ // NOLINT
2207
+ ASSERT_PRED5(PredFunctor5(),
2208
+ Bool(n1_++),
2209
+ Bool(n2_++),
2210
+ Bool(n3_++),
2211
+ Bool(n4_++),
2212
+ Bool(n5_++));
2213
+ finished_ = true;
2214
+ }, "");
2215
+ }
2216
+
2217
+ // Tests a successful EXPECT_PRED_FORMAT5 where the
2218
+ // predicate-formatter is a function on a built-in type (int).
2219
+ TEST_F(EXPECT_PRED_FORMAT5Test, FunctionOnBuiltInTypeSuccess) {
2220
+ EXPECT_PRED_FORMAT5(PredFormatFunction5,
2221
+ ++n1_,
2222
+ ++n2_,
2223
+ ++n3_,
2224
+ ++n4_,
2225
+ ++n5_);
2226
+ finished_ = true;
2227
+ }
2228
+
2229
+ // Tests a successful EXPECT_PRED_FORMAT5 where the
2230
+ // predicate-formatter is a function on a user-defined type (Bool).
2231
+ TEST_F(EXPECT_PRED_FORMAT5Test, FunctionOnUserTypeSuccess) {
2232
+ EXPECT_PRED_FORMAT5(PredFormatFunction5,
2233
+ Bool(++n1_),
2234
+ Bool(++n2_),
2235
+ Bool(++n3_),
2236
+ Bool(++n4_),
2237
+ Bool(++n5_));
2238
+ finished_ = true;
2239
+ }
2240
+
2241
+ // Tests a successful EXPECT_PRED_FORMAT5 where the
2242
+ // predicate-formatter is a functor on a built-in type (int).
2243
+ TEST_F(EXPECT_PRED_FORMAT5Test, FunctorOnBuiltInTypeSuccess) {
2244
+ EXPECT_PRED_FORMAT5(PredFormatFunctor5(),
2245
+ ++n1_,
2246
+ ++n2_,
2247
+ ++n3_,
2248
+ ++n4_,
2249
+ ++n5_);
2250
+ finished_ = true;
2251
+ }
2252
+
2253
+ // Tests a successful EXPECT_PRED_FORMAT5 where the
2254
+ // predicate-formatter is a functor on a user-defined type (Bool).
2255
+ TEST_F(EXPECT_PRED_FORMAT5Test, FunctorOnUserTypeSuccess) {
2256
+ EXPECT_PRED_FORMAT5(PredFormatFunctor5(),
2257
+ Bool(++n1_),
2258
+ Bool(++n2_),
2259
+ Bool(++n3_),
2260
+ Bool(++n4_),
2261
+ Bool(++n5_));
2262
+ finished_ = true;
2263
+ }
2264
+
2265
+ // Tests a failed EXPECT_PRED_FORMAT5 where the
2266
+ // predicate-formatter is a function on a built-in type (int).
2267
+ TEST_F(EXPECT_PRED_FORMAT5Test, FunctionOnBuiltInTypeFailure) {
2268
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
2269
+ EXPECT_PRED_FORMAT5(PredFormatFunction5,
2270
+ n1_++,
2271
+ n2_++,
2272
+ n3_++,
2273
+ n4_++,
2274
+ n5_++);
2275
+ finished_ = true;
2276
+ }, "");
2277
+ }
2278
+
2279
+ // Tests a failed EXPECT_PRED_FORMAT5 where the
2280
+ // predicate-formatter is a function on a user-defined type (Bool).
2281
+ TEST_F(EXPECT_PRED_FORMAT5Test, FunctionOnUserTypeFailure) {
2282
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
2283
+ EXPECT_PRED_FORMAT5(PredFormatFunction5,
2284
+ Bool(n1_++),
2285
+ Bool(n2_++),
2286
+ Bool(n3_++),
2287
+ Bool(n4_++),
2288
+ Bool(n5_++));
2289
+ finished_ = true;
2290
+ }, "");
2291
+ }
2292
+
2293
+ // Tests a failed EXPECT_PRED_FORMAT5 where the
2294
+ // predicate-formatter is a functor on a built-in type (int).
2295
+ TEST_F(EXPECT_PRED_FORMAT5Test, FunctorOnBuiltInTypeFailure) {
2296
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
2297
+ EXPECT_PRED_FORMAT5(PredFormatFunctor5(),
2298
+ n1_++,
2299
+ n2_++,
2300
+ n3_++,
2301
+ n4_++,
2302
+ n5_++);
2303
+ finished_ = true;
2304
+ }, "");
2305
+ }
2306
+
2307
+ // Tests a failed EXPECT_PRED_FORMAT5 where the
2308
+ // predicate-formatter is a functor on a user-defined type (Bool).
2309
+ TEST_F(EXPECT_PRED_FORMAT5Test, FunctorOnUserTypeFailure) {
2310
+ EXPECT_NONFATAL_FAILURE({ // NOLINT
2311
+ EXPECT_PRED_FORMAT5(PredFormatFunctor5(),
2312
+ Bool(n1_++),
2313
+ Bool(n2_++),
2314
+ Bool(n3_++),
2315
+ Bool(n4_++),
2316
+ Bool(n5_++));
2317
+ finished_ = true;
2318
+ }, "");
2319
+ }
2320
+
2321
+ // Tests a successful ASSERT_PRED_FORMAT5 where the
2322
+ // predicate-formatter is a function on a built-in type (int).
2323
+ TEST_F(ASSERT_PRED_FORMAT5Test, FunctionOnBuiltInTypeSuccess) {
2324
+ ASSERT_PRED_FORMAT5(PredFormatFunction5,
2325
+ ++n1_,
2326
+ ++n2_,
2327
+ ++n3_,
2328
+ ++n4_,
2329
+ ++n5_);
2330
+ finished_ = true;
2331
+ }
2332
+
2333
+ // Tests a successful ASSERT_PRED_FORMAT5 where the
2334
+ // predicate-formatter is a function on a user-defined type (Bool).
2335
+ TEST_F(ASSERT_PRED_FORMAT5Test, FunctionOnUserTypeSuccess) {
2336
+ ASSERT_PRED_FORMAT5(PredFormatFunction5,
2337
+ Bool(++n1_),
2338
+ Bool(++n2_),
2339
+ Bool(++n3_),
2340
+ Bool(++n4_),
2341
+ Bool(++n5_));
2342
+ finished_ = true;
2343
+ }
2344
+
2345
+ // Tests a successful ASSERT_PRED_FORMAT5 where the
2346
+ // predicate-formatter is a functor on a built-in type (int).
2347
+ TEST_F(ASSERT_PRED_FORMAT5Test, FunctorOnBuiltInTypeSuccess) {
2348
+ ASSERT_PRED_FORMAT5(PredFormatFunctor5(),
2349
+ ++n1_,
2350
+ ++n2_,
2351
+ ++n3_,
2352
+ ++n4_,
2353
+ ++n5_);
2354
+ finished_ = true;
2355
+ }
2356
+
2357
+ // Tests a successful ASSERT_PRED_FORMAT5 where the
2358
+ // predicate-formatter is a functor on a user-defined type (Bool).
2359
+ TEST_F(ASSERT_PRED_FORMAT5Test, FunctorOnUserTypeSuccess) {
2360
+ ASSERT_PRED_FORMAT5(PredFormatFunctor5(),
2361
+ Bool(++n1_),
2362
+ Bool(++n2_),
2363
+ Bool(++n3_),
2364
+ Bool(++n4_),
2365
+ Bool(++n5_));
2366
+ finished_ = true;
2367
+ }
2368
+
2369
+ // Tests a failed ASSERT_PRED_FORMAT5 where the
2370
+ // predicate-formatter is a function on a built-in type (int).
2371
+ TEST_F(ASSERT_PRED_FORMAT5Test, FunctionOnBuiltInTypeFailure) {
2372
+ expected_to_finish_ = false;
2373
+ EXPECT_FATAL_FAILURE({ // NOLINT
2374
+ ASSERT_PRED_FORMAT5(PredFormatFunction5,
2375
+ n1_++,
2376
+ n2_++,
2377
+ n3_++,
2378
+ n4_++,
2379
+ n5_++);
2380
+ finished_ = true;
2381
+ }, "");
2382
+ }
2383
+
2384
+ // Tests a failed ASSERT_PRED_FORMAT5 where the
2385
+ // predicate-formatter is a function on a user-defined type (Bool).
2386
+ TEST_F(ASSERT_PRED_FORMAT5Test, FunctionOnUserTypeFailure) {
2387
+ expected_to_finish_ = false;
2388
+ EXPECT_FATAL_FAILURE({ // NOLINT
2389
+ ASSERT_PRED_FORMAT5(PredFormatFunction5,
2390
+ Bool(n1_++),
2391
+ Bool(n2_++),
2392
+ Bool(n3_++),
2393
+ Bool(n4_++),
2394
+ Bool(n5_++));
2395
+ finished_ = true;
2396
+ }, "");
2397
+ }
2398
+
2399
+ // Tests a failed ASSERT_PRED_FORMAT5 where the
2400
+ // predicate-formatter is a functor on a built-in type (int).
2401
+ TEST_F(ASSERT_PRED_FORMAT5Test, FunctorOnBuiltInTypeFailure) {
2402
+ expected_to_finish_ = false;
2403
+ EXPECT_FATAL_FAILURE({ // NOLINT
2404
+ ASSERT_PRED_FORMAT5(PredFormatFunctor5(),
2405
+ n1_++,
2406
+ n2_++,
2407
+ n3_++,
2408
+ n4_++,
2409
+ n5_++);
2410
+ finished_ = true;
2411
+ }, "");
2412
+ }
2413
+
2414
+ // Tests a failed ASSERT_PRED_FORMAT5 where the
2415
+ // predicate-formatter is a functor on a user-defined type (Bool).
2416
+ TEST_F(ASSERT_PRED_FORMAT5Test, FunctorOnUserTypeFailure) {
2417
+ expected_to_finish_ = false;
2418
+ EXPECT_FATAL_FAILURE({ // NOLINT
2419
+ ASSERT_PRED_FORMAT5(PredFormatFunctor5(),
2420
+ Bool(n1_++),
2421
+ Bool(n2_++),
2422
+ Bool(n3_++),
2423
+ Bool(n4_++),
2424
+ Bool(n5_++));
2425
+ finished_ = true;
2426
+ }, "");
2427
+ }