@eosrio/node-abieos 2.1.0-beta.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (740) hide show
  1. package/README.md +4 -1
  2. package/dist/abieos.node +0 -0
  3. package/lib/abieos.d.ts +19 -0
  4. package/lib/abieos.d.ts.map +1 -0
  5. package/lib/abieos.js +100 -0
  6. package/lib/abieos.ts +107 -0
  7. package/package.json +13 -8
  8. package/.gitmodules +0 -6
  9. package/.idea/misc.xml +0 -6
  10. package/.idea/modules.xml +0 -8
  11. package/.idea/node-abieos.iml +0 -12
  12. package/.idea/vcs.xml +0 -9
  13. package/.idea/workspace.xml +0 -266
  14. package/CMakeLists.txt +0 -35
  15. package/abieos.d.ts +0 -21
  16. package/abieos.js +0 -59
  17. package/eosio.json +0 -1596
  18. package/external/date/CMakeLists.txt +0 -175
  19. package/external/date/LICENSE.txt +0 -31
  20. package/external/date/README.md +0 -61
  21. package/external/date/compile_fail.sh +0 -16
  22. package/external/date/include/date/chrono_io.h +0 -34
  23. package/external/date/include/date/date.h +0 -8335
  24. package/external/date/include/date/ios.h +0 -50
  25. package/external/date/include/date/islamic.h +0 -3031
  26. package/external/date/include/date/iso_week.h +0 -1745
  27. package/external/date/include/date/julian.h +0 -3046
  28. package/external/date/include/date/ptz.h +0 -592
  29. package/external/date/include/date/tz.h +0 -2760
  30. package/external/date/include/date/tz_private.h +0 -318
  31. package/external/date/src/ios.mm +0 -337
  32. package/external/date/src/tz.cpp +0 -3801
  33. package/external/date/test/clock_cast_test/custom_clock.pass.cpp +0 -213
  34. package/external/date/test/clock_cast_test/deprecated.pass.cpp +0 -90
  35. package/external/date/test/clock_cast_test/local_t.pass.cpp +0 -132
  36. package/external/date/test/clock_cast_test/noncastable.pass.cpp +0 -251
  37. package/external/date/test/clock_cast_test/normal_clocks.pass.cpp +0 -102
  38. package/external/date/test/clock_cast_test/to_sys_return_int.fail.cpp +0 -49
  39. package/external/date/test/clock_cast_test/to_sys_return_reference.fail.cpp +0 -51
  40. package/external/date/test/clock_cast_test/to_sys_return_utc_time.fail.cpp +0 -49
  41. package/external/date/test/date_test/day.pass.cpp +0 -143
  42. package/external/date/test/date_test/daypday.fail.cpp +0 -32
  43. package/external/date/test/date_test/daysmday.fail.cpp +0 -32
  44. package/external/date/test/date_test/daysmweekday.fail.cpp +0 -32
  45. package/external/date/test/date_test/detail/decimal_format_seconds.pass.cpp +0 -145
  46. package/external/date/test/date_test/detail/make_precision.pass.cpp +0 -63
  47. package/external/date/test/date_test/detail/static_pow10.pass.cpp +0 -50
  48. package/external/date/test/date_test/detail/width.pass.cpp +0 -64
  49. package/external/date/test/date_test/durations.pass.cpp +0 -62
  50. package/external/date/test/date_test/durations_output.pass.cpp +0 -328
  51. package/external/date/test/date_test/format/century.pass.cpp +0 -117
  52. package/external/date/test/date_test/format/misc.pass.cpp +0 -52
  53. package/external/date/test/date_test/format/range.pass.cpp +0 -78
  54. package/external/date/test/date_test/format/two_dight_year.pass.cpp +0 -121
  55. package/external/date/test/date_test/last.pass.cpp +0 -34
  56. package/external/date/test/date_test/make_time.pass.cpp +0 -164
  57. package/external/date/test/date_test/month.pass.cpp +0 -181
  58. package/external/date/test/date_test/month_day.pass.cpp +0 -82
  59. package/external/date/test/date_test/month_day_last.pass.cpp +0 -75
  60. package/external/date/test/date_test/month_weekday.pass.cpp +0 -77
  61. package/external/date/test/date_test/month_weekday_last.pass.cpp +0 -77
  62. package/external/date/test/date_test/month_weekday_last_less.fail.cpp +0 -34
  63. package/external/date/test/date_test/month_weekday_less.fail.cpp +0 -34
  64. package/external/date/test/date_test/monthpmonth.fail.cpp +0 -32
  65. package/external/date/test/date_test/months_m_year_month.fail.cpp +0 -33
  66. package/external/date/test/date_test/months_m_year_month_day.fail.cpp +0 -33
  67. package/external/date/test/date_test/monthsmmonth.fail.cpp +0 -32
  68. package/external/date/test/date_test/multi_year_duration_addition.pass.cpp +0 -297
  69. package/external/date/test/date_test/op_div_day_day.fail.cpp +0 -33
  70. package/external/date/test/date_test/op_div_int_month.fail.cpp +0 -33
  71. package/external/date/test/date_test/op_div_int_year.fail.cpp +0 -33
  72. package/external/date/test/date_test/op_div_last_last.fail.cpp +0 -33
  73. package/external/date/test/date_test/op_div_month_day.pass.cpp +0 -41
  74. package/external/date/test/date_test/op_div_month_day_last.pass.cpp +0 -39
  75. package/external/date/test/date_test/op_div_month_day_month_day.fail.cpp +0 -33
  76. package/external/date/test/date_test/op_div_month_month.fail.cpp +0 -33
  77. package/external/date/test/date_test/op_div_month_weekday.pass.cpp +0 -39
  78. package/external/date/test/date_test/op_div_month_weekday_last.pass.cpp +0 -39
  79. package/external/date/test/date_test/op_div_month_year.fail.cpp +0 -33
  80. package/external/date/test/date_test/op_div_survey.pass.cpp +0 -437
  81. package/external/date/test/date_test/op_div_weekday_indexed_weekday_indexed.fail.cpp +0 -33
  82. package/external/date/test/date_test/op_div_weekday_last_weekday_last.fail.cpp +0 -33
  83. package/external/date/test/date_test/op_div_year_month.pass.cpp +0 -35
  84. package/external/date/test/date_test/op_div_year_month_day.pass.cpp +0 -43
  85. package/external/date/test/date_test/op_div_year_month_day_last.pass.cpp +0 -41
  86. package/external/date/test/date_test/op_div_year_month_weekday.pass.cpp +0 -41
  87. package/external/date/test/date_test/op_div_year_month_weekday_last.pass.cpp +0 -41
  88. package/external/date/test/date_test/op_div_year_month_year_month.fail.cpp +0 -33
  89. package/external/date/test/date_test/op_div_year_year.fail.cpp +0 -33
  90. package/external/date/test/date_test/parse.pass.cpp +0 -904
  91. package/external/date/test/date_test/sizeof.pass.cpp +0 -62
  92. package/external/date/test/date_test/time_of_day_hours.pass.cpp +0 -104
  93. package/external/date/test/date_test/time_of_day_microfortnights.pass.cpp +0 -119
  94. package/external/date/test/date_test/time_of_day_milliseconds.pass.cpp +0 -126
  95. package/external/date/test/date_test/time_of_day_minutes.pass.cpp +0 -110
  96. package/external/date/test/date_test/time_of_day_nanoseconds.pass.cpp +0 -126
  97. package/external/date/test/date_test/time_of_day_seconds.pass.cpp +0 -116
  98. package/external/date/test/date_test/weekday.pass.cpp +0 -201
  99. package/external/date/test/date_test/weekday_indexed.pass.cpp +0 -70
  100. package/external/date/test/date_test/weekday_last.pass.cpp +0 -66
  101. package/external/date/test/date_test/weekday_lessthan.fail.cpp +0 -32
  102. package/external/date/test/date_test/weekday_sum.fail.cpp +0 -32
  103. package/external/date/test/date_test/year.pass.cpp +0 -146
  104. package/external/date/test/date_test/year_month.pass.cpp +0 -142
  105. package/external/date/test/date_test/year_month_day.pass.cpp +0 -244
  106. package/external/date/test/date_test/year_month_day_last.pass.cpp +0 -177
  107. package/external/date/test/date_test/year_month_day_m_year_month_day.fail.cpp +0 -33
  108. package/external/date/test/date_test/year_month_day_p_year_month_day.fail.cpp +0 -33
  109. package/external/date/test/date_test/year_month_p_year_month.fail.cpp +0 -33
  110. package/external/date/test/date_test/year_month_weekday.pass.cpp +0 -178
  111. package/external/date/test/date_test/year_month_weekday_last.pass.cpp +0 -169
  112. package/external/date/test/date_test/year_p_year.fail.cpp +0 -32
  113. package/external/date/test/date_test/years_m_year.fail.cpp +0 -32
  114. package/external/date/test/date_test/years_m_year_month.fail.cpp +0 -33
  115. package/external/date/test/date_test/years_m_year_month_day.fail.cpp +0 -33
  116. package/external/date/test/iso_week/last.pass.cpp +0 -34
  117. package/external/date/test/iso_week/lastweek_weekday.pass.cpp +0 -82
  118. package/external/date/test/iso_week/op_div_survey.pass.cpp +0 -196
  119. package/external/date/test/iso_week/weekday.pass.cpp +0 -227
  120. package/external/date/test/iso_week/weekday_lessthan.fail.cpp +0 -32
  121. package/external/date/test/iso_week/weekday_sum.fail.cpp +0 -32
  122. package/external/date/test/iso_week/weeknum.pass.cpp +0 -121
  123. package/external/date/test/iso_week/weeknum_p_weeknum.fail.cpp +0 -32
  124. package/external/date/test/iso_week/weeknum_weekday.pass.cpp +0 -86
  125. package/external/date/test/iso_week/year.pass.cpp +0 -120
  126. package/external/date/test/iso_week/year_lastweek.pass.cpp +0 -97
  127. package/external/date/test/iso_week/year_lastweek_weekday.pass.cpp +0 -129
  128. package/external/date/test/iso_week/year_p_year.fail.cpp +0 -32
  129. package/external/date/test/iso_week/year_weeknum.pass.cpp +0 -97
  130. package/external/date/test/iso_week/year_weeknum_weekday.pass.cpp +0 -139
  131. package/external/date/test/iso_week/years_m_year.fail.cpp +0 -32
  132. package/external/date/test/just.pass.cpp +0 -26
  133. package/external/date/test/testit +0 -177
  134. package/external/date/test/tz_test/OffsetZone.pass.cpp +0 -81
  135. package/external/date/test/tz_test/README.md +0 -22
  136. package/external/date/test/tz_test/tzdata2015e.txt.zip +0 -0
  137. package/external/date/test/tz_test/tzdata2015f.txt.zip +0 -0
  138. package/external/date/test/tz_test/tzdata2016c.txt.zip +0 -0
  139. package/external/date/test/tz_test/tzdata2016d.txt.zip +0 -0
  140. package/external/date/test/tz_test/tzdata2016e.txt.zip +0 -0
  141. package/external/date/test/tz_test/tzdata2016f.txt.zip +0 -0
  142. package/external/date/test/tz_test/validate.cpp +0 -165
  143. package/external/date/test/tz_test/zone.pass.cpp +0 -37
  144. package/external/date/test/tz_test/zoned_time.pass.cpp +0 -464
  145. package/external/date/test_fail.sh +0 -10
  146. package/external/rapidjson/.gitattributes +0 -22
  147. package/external/rapidjson/.gitmodules +0 -3
  148. package/external/rapidjson/.travis.yml +0 -99
  149. package/external/rapidjson/CHANGELOG.md +0 -158
  150. package/external/rapidjson/CMakeLists.txt +0 -221
  151. package/external/rapidjson/CMakeModules/FindGTestSrc.cmake +0 -30
  152. package/external/rapidjson/RapidJSON.pc.in +0 -7
  153. package/external/rapidjson/RapidJSONConfig.cmake.in +0 -15
  154. package/external/rapidjson/RapidJSONConfigVersion.cmake.in +0 -10
  155. package/external/rapidjson/appveyor.yml +0 -54
  156. package/external/rapidjson/bin/data/glossary.json +0 -22
  157. package/external/rapidjson/bin/data/menu.json +0 -27
  158. package/external/rapidjson/bin/data/readme.txt +0 -1
  159. package/external/rapidjson/bin/data/sample.json +0 -3315
  160. package/external/rapidjson/bin/data/webapp.json +0 -88
  161. package/external/rapidjson/bin/data/widget.json +0 -26
  162. package/external/rapidjson/bin/encodings/utf16be.json +0 -0
  163. package/external/rapidjson/bin/encodings/utf16bebom.json +0 -0
  164. package/external/rapidjson/bin/encodings/utf16le.json +0 -0
  165. package/external/rapidjson/bin/encodings/utf16lebom.json +0 -0
  166. package/external/rapidjson/bin/encodings/utf32be.json +0 -0
  167. package/external/rapidjson/bin/encodings/utf32bebom.json +0 -0
  168. package/external/rapidjson/bin/encodings/utf32le.json +0 -0
  169. package/external/rapidjson/bin/encodings/utf32lebom.json +0 -0
  170. package/external/rapidjson/bin/encodings/utf8.json +0 -7
  171. package/external/rapidjson/bin/encodings/utf8bom.json +0 -7
  172. package/external/rapidjson/bin/jsonchecker/fail1.json +0 -1
  173. package/external/rapidjson/bin/jsonchecker/fail10.json +0 -1
  174. package/external/rapidjson/bin/jsonchecker/fail11.json +0 -1
  175. package/external/rapidjson/bin/jsonchecker/fail12.json +0 -1
  176. package/external/rapidjson/bin/jsonchecker/fail13.json +0 -1
  177. package/external/rapidjson/bin/jsonchecker/fail14.json +0 -1
  178. package/external/rapidjson/bin/jsonchecker/fail15.json +0 -1
  179. package/external/rapidjson/bin/jsonchecker/fail16.json +0 -1
  180. package/external/rapidjson/bin/jsonchecker/fail17.json +0 -1
  181. package/external/rapidjson/bin/jsonchecker/fail18.json +0 -1
  182. package/external/rapidjson/bin/jsonchecker/fail19.json +0 -1
  183. package/external/rapidjson/bin/jsonchecker/fail2.json +0 -1
  184. package/external/rapidjson/bin/jsonchecker/fail20.json +0 -1
  185. package/external/rapidjson/bin/jsonchecker/fail21.json +0 -1
  186. package/external/rapidjson/bin/jsonchecker/fail22.json +0 -1
  187. package/external/rapidjson/bin/jsonchecker/fail23.json +0 -1
  188. package/external/rapidjson/bin/jsonchecker/fail24.json +0 -1
  189. package/external/rapidjson/bin/jsonchecker/fail25.json +0 -1
  190. package/external/rapidjson/bin/jsonchecker/fail26.json +0 -1
  191. package/external/rapidjson/bin/jsonchecker/fail27.json +0 -2
  192. package/external/rapidjson/bin/jsonchecker/fail28.json +0 -2
  193. package/external/rapidjson/bin/jsonchecker/fail29.json +0 -1
  194. package/external/rapidjson/bin/jsonchecker/fail3.json +0 -1
  195. package/external/rapidjson/bin/jsonchecker/fail30.json +0 -1
  196. package/external/rapidjson/bin/jsonchecker/fail31.json +0 -1
  197. package/external/rapidjson/bin/jsonchecker/fail32.json +0 -1
  198. package/external/rapidjson/bin/jsonchecker/fail33.json +0 -1
  199. package/external/rapidjson/bin/jsonchecker/fail4.json +0 -1
  200. package/external/rapidjson/bin/jsonchecker/fail5.json +0 -1
  201. package/external/rapidjson/bin/jsonchecker/fail6.json +0 -1
  202. package/external/rapidjson/bin/jsonchecker/fail7.json +0 -1
  203. package/external/rapidjson/bin/jsonchecker/fail8.json +0 -1
  204. package/external/rapidjson/bin/jsonchecker/fail9.json +0 -1
  205. package/external/rapidjson/bin/jsonchecker/pass1.json +0 -58
  206. package/external/rapidjson/bin/jsonchecker/pass2.json +0 -1
  207. package/external/rapidjson/bin/jsonchecker/pass3.json +0 -6
  208. package/external/rapidjson/bin/jsonchecker/readme.txt +0 -3
  209. package/external/rapidjson/bin/types/booleans.json +0 -102
  210. package/external/rapidjson/bin/types/floats.json +0 -102
  211. package/external/rapidjson/bin/types/guids.json +0 -102
  212. package/external/rapidjson/bin/types/integers.json +0 -102
  213. package/external/rapidjson/bin/types/mixed.json +0 -592
  214. package/external/rapidjson/bin/types/nulls.json +0 -102
  215. package/external/rapidjson/bin/types/paragraphs.json +0 -102
  216. package/external/rapidjson/bin/types/readme.txt +0 -1
  217. package/external/rapidjson/contrib/natvis/LICENSE +0 -45
  218. package/external/rapidjson/contrib/natvis/README.md +0 -7
  219. package/external/rapidjson/contrib/natvis/rapidjson.natvis +0 -38
  220. package/external/rapidjson/doc/CMakeLists.txt +0 -27
  221. package/external/rapidjson/doc/Doxyfile.in +0 -2369
  222. package/external/rapidjson/doc/Doxyfile.zh-cn.in +0 -2369
  223. package/external/rapidjson/doc/diagram/architecture.dot +0 -50
  224. package/external/rapidjson/doc/diagram/architecture.png +0 -0
  225. package/external/rapidjson/doc/diagram/insituparsing.dot +0 -65
  226. package/external/rapidjson/doc/diagram/insituparsing.png +0 -0
  227. package/external/rapidjson/doc/diagram/iterative-parser-states-diagram.dot +0 -62
  228. package/external/rapidjson/doc/diagram/iterative-parser-states-diagram.png +0 -0
  229. package/external/rapidjson/doc/diagram/move1.dot +0 -47
  230. package/external/rapidjson/doc/diagram/move1.png +0 -0
  231. package/external/rapidjson/doc/diagram/move2.dot +0 -62
  232. package/external/rapidjson/doc/diagram/move2.png +0 -0
  233. package/external/rapidjson/doc/diagram/move3.dot +0 -60
  234. package/external/rapidjson/doc/diagram/move3.png +0 -0
  235. package/external/rapidjson/doc/diagram/normalparsing.dot +0 -56
  236. package/external/rapidjson/doc/diagram/normalparsing.png +0 -0
  237. package/external/rapidjson/doc/diagram/simpledom.dot +0 -54
  238. package/external/rapidjson/doc/diagram/simpledom.png +0 -0
  239. package/external/rapidjson/doc/diagram/tutorial.dot +0 -58
  240. package/external/rapidjson/doc/diagram/tutorial.png +0 -0
  241. package/external/rapidjson/doc/diagram/utilityclass.dot +0 -73
  242. package/external/rapidjson/doc/diagram/utilityclass.png +0 -0
  243. package/external/rapidjson/doc/dom.md +0 -280
  244. package/external/rapidjson/doc/dom.zh-cn.md +0 -284
  245. package/external/rapidjson/doc/encoding.md +0 -146
  246. package/external/rapidjson/doc/encoding.zh-cn.md +0 -152
  247. package/external/rapidjson/doc/faq.md +0 -289
  248. package/external/rapidjson/doc/faq.zh-cn.md +0 -290
  249. package/external/rapidjson/doc/features.md +0 -104
  250. package/external/rapidjson/doc/features.zh-cn.md +0 -103
  251. package/external/rapidjson/doc/internals.md +0 -368
  252. package/external/rapidjson/doc/internals.zh-cn.md +0 -363
  253. package/external/rapidjson/doc/logo/rapidjson.png +0 -0
  254. package/external/rapidjson/doc/logo/rapidjson.svg +0 -119
  255. package/external/rapidjson/doc/misc/DoxygenLayout.xml +0 -194
  256. package/external/rapidjson/doc/misc/doxygenextra.css +0 -274
  257. package/external/rapidjson/doc/misc/footer.html +0 -11
  258. package/external/rapidjson/doc/misc/header.html +0 -24
  259. package/external/rapidjson/doc/npm.md +0 -31
  260. package/external/rapidjson/doc/performance.md +0 -26
  261. package/external/rapidjson/doc/performance.zh-cn.md +0 -26
  262. package/external/rapidjson/doc/pointer.md +0 -234
  263. package/external/rapidjson/doc/pointer.zh-cn.md +0 -234
  264. package/external/rapidjson/doc/sax.md +0 -509
  265. package/external/rapidjson/doc/sax.zh-cn.md +0 -487
  266. package/external/rapidjson/doc/schema.md +0 -505
  267. package/external/rapidjson/doc/schema.zh-cn.md +0 -237
  268. package/external/rapidjson/doc/stream.md +0 -429
  269. package/external/rapidjson/doc/stream.zh-cn.md +0 -429
  270. package/external/rapidjson/doc/tutorial.md +0 -536
  271. package/external/rapidjson/doc/tutorial.zh-cn.md +0 -535
  272. package/external/rapidjson/docker/debian/Dockerfile +0 -8
  273. package/external/rapidjson/example/CMakeLists.txt +0 -45
  274. package/external/rapidjson/example/archiver/archiver.cpp +0 -292
  275. package/external/rapidjson/example/archiver/archiver.h +0 -145
  276. package/external/rapidjson/example/archiver/archivertest.cpp +0 -287
  277. package/external/rapidjson/example/capitalize/capitalize.cpp +0 -67
  278. package/external/rapidjson/example/condense/condense.cpp +0 -32
  279. package/external/rapidjson/example/filterkey/filterkey.cpp +0 -135
  280. package/external/rapidjson/example/filterkeydom/filterkeydom.cpp +0 -170
  281. package/external/rapidjson/example/jsonx/jsonx.cpp +0 -207
  282. package/external/rapidjson/example/lookaheadparser/lookaheadparser.cpp +0 -350
  283. package/external/rapidjson/example/messagereader/messagereader.cpp +0 -105
  284. package/external/rapidjson/example/parsebyparts/parsebyparts.cpp +0 -176
  285. package/external/rapidjson/example/pretty/pretty.cpp +0 -30
  286. package/external/rapidjson/example/prettyauto/prettyauto.cpp +0 -56
  287. package/external/rapidjson/example/schemavalidator/schemavalidator.cpp +0 -78
  288. package/external/rapidjson/example/serialize/serialize.cpp +0 -173
  289. package/external/rapidjson/example/simpledom/simpledom.cpp +0 -29
  290. package/external/rapidjson/example/simplepullreader/simplepullreader.cpp +0 -53
  291. package/external/rapidjson/example/simplereader/simplereader.cpp +0 -42
  292. package/external/rapidjson/example/simplewriter/simplewriter.cpp +0 -36
  293. package/external/rapidjson/example/tutorial/tutorial.cpp +0 -151
  294. package/external/rapidjson/include/rapidjson/allocators.h +0 -284
  295. package/external/rapidjson/include/rapidjson/cursorstreamwrapper.h +0 -78
  296. package/external/rapidjson/include/rapidjson/document.h +0 -2646
  297. package/external/rapidjson/include/rapidjson/encodedstream.h +0 -299
  298. package/external/rapidjson/include/rapidjson/encodings.h +0 -716
  299. package/external/rapidjson/include/rapidjson/error/en.h +0 -74
  300. package/external/rapidjson/include/rapidjson/error/error.h +0 -161
  301. package/external/rapidjson/include/rapidjson/filereadstream.h +0 -99
  302. package/external/rapidjson/include/rapidjson/filewritestream.h +0 -104
  303. package/external/rapidjson/include/rapidjson/fwd.h +0 -151
  304. package/external/rapidjson/include/rapidjson/internal/biginteger.h +0 -290
  305. package/external/rapidjson/include/rapidjson/internal/diyfp.h +0 -271
  306. package/external/rapidjson/include/rapidjson/internal/dtoa.h +0 -245
  307. package/external/rapidjson/include/rapidjson/internal/ieee754.h +0 -78
  308. package/external/rapidjson/include/rapidjson/internal/itoa.h +0 -308
  309. package/external/rapidjson/include/rapidjson/internal/meta.h +0 -186
  310. package/external/rapidjson/include/rapidjson/internal/pow10.h +0 -55
  311. package/external/rapidjson/include/rapidjson/internal/regex.h +0 -732
  312. package/external/rapidjson/include/rapidjson/internal/stack.h +0 -231
  313. package/external/rapidjson/include/rapidjson/internal/strfunc.h +0 -69
  314. package/external/rapidjson/include/rapidjson/internal/strtod.h +0 -290
  315. package/external/rapidjson/include/rapidjson/internal/swap.h +0 -46
  316. package/external/rapidjson/include/rapidjson/istreamwrapper.h +0 -113
  317. package/external/rapidjson/include/rapidjson/memorybuffer.h +0 -70
  318. package/external/rapidjson/include/rapidjson/memorystream.h +0 -71
  319. package/external/rapidjson/include/rapidjson/msinttypes/inttypes.h +0 -316
  320. package/external/rapidjson/include/rapidjson/msinttypes/stdint.h +0 -300
  321. package/external/rapidjson/include/rapidjson/ostreamwrapper.h +0 -81
  322. package/external/rapidjson/include/rapidjson/pointer.h +0 -1357
  323. package/external/rapidjson/include/rapidjson/prettywriter.h +0 -277
  324. package/external/rapidjson/include/rapidjson/rapidjson.h +0 -654
  325. package/external/rapidjson/include/rapidjson/reader.h +0 -2230
  326. package/external/rapidjson/include/rapidjson/schema.h +0 -2494
  327. package/external/rapidjson/include/rapidjson/stream.h +0 -223
  328. package/external/rapidjson/include/rapidjson/stringbuffer.h +0 -121
  329. package/external/rapidjson/include/rapidjson/writer.h +0 -710
  330. package/external/rapidjson/include_dirs.js +0 -2
  331. package/external/rapidjson/library.json +0 -15
  332. package/external/rapidjson/license.txt +0 -57
  333. package/external/rapidjson/package.json +0 -24
  334. package/external/rapidjson/rapidjson.autopkg +0 -77
  335. package/external/rapidjson/readme.md +0 -160
  336. package/external/rapidjson/readme.zh-cn.md +0 -152
  337. package/external/rapidjson/test/CMakeLists.txt +0 -20
  338. package/external/rapidjson/test/perftest/CMakeLists.txt +0 -28
  339. package/external/rapidjson/test/perftest/misctest.cpp +0 -974
  340. package/external/rapidjson/test/perftest/perftest.cpp +0 -24
  341. package/external/rapidjson/test/perftest/perftest.h +0 -185
  342. package/external/rapidjson/test/perftest/platformtest.cpp +0 -166
  343. package/external/rapidjson/test/perftest/rapidjsontest.cpp +0 -472
  344. package/external/rapidjson/test/perftest/schematest.cpp +0 -223
  345. package/external/rapidjson/test/unittest/CMakeLists.txt +0 -92
  346. package/external/rapidjson/test/unittest/allocatorstest.cpp +0 -100
  347. package/external/rapidjson/test/unittest/bigintegertest.cpp +0 -138
  348. package/external/rapidjson/test/unittest/cursorstreamwrappertest.cpp +0 -115
  349. package/external/rapidjson/test/unittest/documenttest.cpp +0 -672
  350. package/external/rapidjson/test/unittest/dtoatest.cpp +0 -98
  351. package/external/rapidjson/test/unittest/encodedstreamtest.cpp +0 -313
  352. package/external/rapidjson/test/unittest/encodingstest.cpp +0 -451
  353. package/external/rapidjson/test/unittest/filestreamtest.cpp +0 -112
  354. package/external/rapidjson/test/unittest/fwdtest.cpp +0 -230
  355. package/external/rapidjson/test/unittest/istreamwrappertest.cpp +0 -181
  356. package/external/rapidjson/test/unittest/itoatest.cpp +0 -160
  357. package/external/rapidjson/test/unittest/jsoncheckertest.cpp +0 -143
  358. package/external/rapidjson/test/unittest/namespacetest.cpp +0 -70
  359. package/external/rapidjson/test/unittest/ostreamwrappertest.cpp +0 -92
  360. package/external/rapidjson/test/unittest/pointertest.cpp +0 -1529
  361. package/external/rapidjson/test/unittest/prettywritertest.cpp +0 -373
  362. package/external/rapidjson/test/unittest/readertest.cpp +0 -2190
  363. package/external/rapidjson/test/unittest/regextest.cpp +0 -638
  364. package/external/rapidjson/test/unittest/schematest.cpp +0 -2072
  365. package/external/rapidjson/test/unittest/simdtest.cpp +0 -219
  366. package/external/rapidjson/test/unittest/strfunctest.cpp +0 -30
  367. package/external/rapidjson/test/unittest/stringbuffertest.cpp +0 -192
  368. package/external/rapidjson/test/unittest/strtodtest.cpp +0 -132
  369. package/external/rapidjson/test/unittest/unittest.cpp +0 -51
  370. package/external/rapidjson/test/unittest/unittest.h +0 -140
  371. package/external/rapidjson/test/unittest/valuetest.cpp +0 -1851
  372. package/external/rapidjson/test/unittest/writertest.cpp +0 -598
  373. package/external/rapidjson/test/valgrind.supp +0 -17
  374. package/external/rapidjson/thirdparty/gtest/.travis.yml +0 -81
  375. package/external/rapidjson/thirdparty/gtest/BUILD.bazel +0 -175
  376. package/external/rapidjson/thirdparty/gtest/CMakeLists.txt +0 -33
  377. package/external/rapidjson/thirdparty/gtest/CONTRIBUTING.md +0 -160
  378. package/external/rapidjson/thirdparty/gtest/LICENSE +0 -28
  379. package/external/rapidjson/thirdparty/gtest/Makefile.am +0 -14
  380. package/external/rapidjson/thirdparty/gtest/README.md +0 -122
  381. package/external/rapidjson/thirdparty/gtest/WORKSPACE +0 -8
  382. package/external/rapidjson/thirdparty/gtest/appveyor.yml +0 -104
  383. package/external/rapidjson/thirdparty/gtest/ci/build-linux-autotools.sh +0 -44
  384. package/external/rapidjson/thirdparty/gtest/ci/build-linux-bazel.sh +0 -36
  385. package/external/rapidjson/thirdparty/gtest/ci/env-linux.sh +0 -41
  386. package/external/rapidjson/thirdparty/gtest/ci/env-osx.sh +0 -40
  387. package/external/rapidjson/thirdparty/gtest/ci/get-nprocessors.sh +0 -48
  388. package/external/rapidjson/thirdparty/gtest/ci/install-linux.sh +0 -49
  389. package/external/rapidjson/thirdparty/gtest/ci/install-osx.sh +0 -39
  390. package/external/rapidjson/thirdparty/gtest/ci/log-config.sh +0 -51
  391. package/external/rapidjson/thirdparty/gtest/ci/travis.sh +0 -44
  392. package/external/rapidjson/thirdparty/gtest/configure.ac +0 -16
  393. package/external/rapidjson/thirdparty/gtest/googlemock/CHANGES +0 -126
  394. package/external/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +0 -242
  395. package/external/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +0 -40
  396. package/external/rapidjson/thirdparty/gtest/googlemock/LICENSE +0 -28
  397. package/external/rapidjson/thirdparty/gtest/googlemock/Makefile.am +0 -224
  398. package/external/rapidjson/thirdparty/gtest/googlemock/README.md +0 -344
  399. package/external/rapidjson/thirdparty/gtest/googlemock/build-aux/.keep +0 -0
  400. package/external/rapidjson/thirdparty/gtest/googlemock/cmake/gmock.pc.in +0 -9
  401. package/external/rapidjson/thirdparty/gtest/googlemock/cmake/gmock_main.pc.in +0 -9
  402. package/external/rapidjson/thirdparty/gtest/googlemock/configure.ac +0 -146
  403. package/external/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +0 -564
  404. package/external/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +0 -3660
  405. package/external/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +0 -280
  406. package/external/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +0 -15
  407. package/external/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +0 -447
  408. package/external/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +0 -627
  409. package/external/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +0 -19
  410. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +0 -1262
  411. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +0 -147
  412. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +0 -2571
  413. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +0 -833
  414. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +0 -1379
  415. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +0 -347
  416. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +0 -2258
  417. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +0 -675
  418. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +0 -458
  419. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +0 -178
  420. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +0 -5255
  421. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +0 -246
  422. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +0 -91
  423. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +0 -1918
  424. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +0 -95
  425. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +0 -8
  426. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +0 -10
  427. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +0 -38
  428. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +0 -46
  429. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +0 -286
  430. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +0 -136
  431. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +0 -574
  432. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +0 -87
  433. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +0 -32
  434. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +0 -191
  435. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +0 -15
  436. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +0 -187
  437. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +0 -201
  438. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +0 -46
  439. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +0 -145
  440. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +0 -19
  441. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +0 -151
  442. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +0 -176
  443. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +0 -46
  444. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +0 -145
  445. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +0 -19
  446. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +0 -151
  447. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +0 -176
  448. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +0 -240
  449. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +0 -203
  450. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +0 -34
  451. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +0 -115
  452. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
  453. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +0 -1733
  454. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +0 -227
  455. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +0 -448
  456. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +0 -59
  457. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +0 -287
  458. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +0 -41
  459. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +0 -31
  460. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +0 -303
  461. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +0 -640
  462. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +0 -1387
  463. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +0 -78
  464. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +0 -47
  465. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +0 -156
  466. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +0 -204
  467. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +0 -573
  468. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +0 -883
  469. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +0 -205
  470. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +0 -54
  471. package/external/rapidjson/thirdparty/gtest/googlemock/test/BUILD.bazel +0 -123
  472. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +0 -1575
  473. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +0 -428
  474. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +0 -1230
  475. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +0 -647
  476. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +0 -129
  477. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +0 -1341
  478. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +0 -718
  479. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +0 -6767
  480. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +0 -710
  481. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +0 -511
  482. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +0 -43
  483. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +0 -2771
  484. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +0 -51
  485. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +0 -81
  486. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +0 -108
  487. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +0 -100
  488. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +0 -40
  489. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +0 -40
  490. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +0 -691
  491. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +0 -183
  492. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +0 -310
  493. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +0 -317
  494. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +0 -323
  495. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +0 -262
  496. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +0 -110
  497. package/external/rapidjson/thirdparty/gtest/googletest/CHANGES +0 -157
  498. package/external/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +0 -312
  499. package/external/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +0 -37
  500. package/external/rapidjson/thirdparty/gtest/googletest/LICENSE +0 -28
  501. package/external/rapidjson/thirdparty/gtest/googletest/Makefile.am +0 -339
  502. package/external/rapidjson/thirdparty/gtest/googletest/README.md +0 -341
  503. package/external/rapidjson/thirdparty/gtest/googletest/cmake/gtest.pc.in +0 -9
  504. package/external/rapidjson/thirdparty/gtest/googletest/cmake/gtest_main.pc.in +0 -10
  505. package/external/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +0 -280
  506. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +0 -138
  507. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +0 -54
  508. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +0 -38
  509. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +0 -40
  510. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +0 -82
  511. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +0 -88
  512. package/external/rapidjson/thirdparty/gtest/googletest/configure.ac +0 -68
  513. package/external/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +0 -146
  514. package/external/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +0 -177
  515. package/external/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +0 -93
  516. package/external/rapidjson/thirdparty/gtest/googletest/docs/advanced.md +0 -2416
  517. package/external/rapidjson/thirdparty/gtest/googletest/docs/faq.md +0 -1092
  518. package/external/rapidjson/thirdparty/gtest/googletest/docs/primer.md +0 -536
  519. package/external/rapidjson/thirdparty/gtest/googletest/docs/samples.md +0 -14
  520. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +0 -342
  521. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +0 -249
  522. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +0 -1438
  523. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +0 -501
  524. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +0 -1082
  525. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +0 -231
  526. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +0 -179
  527. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +0 -264
  528. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +0 -2332
  529. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +0 -357
  530. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +0 -61
  531. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +0 -70
  532. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +0 -42
  533. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +0 -45
  534. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +0 -275
  535. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +0 -205
  536. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +0 -1277
  537. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +0 -243
  538. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +0 -5139
  539. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +0 -279
  540. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +0 -723
  541. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +0 -100
  542. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +0 -2687
  543. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +0 -167
  544. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +0 -1020
  545. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +0 -347
  546. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +0 -3347
  547. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +0 -313
  548. package/external/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +0 -363
  549. package/external/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +0 -74
  550. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.sln +0 -55
  551. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj +0 -149
  552. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj.filters +0 -18
  553. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.sln +0 -55
  554. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj +0 -149
  555. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj.filters +0 -18
  556. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj +0 -154
  557. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj.filters +0 -18
  558. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj +0 -162
  559. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj.filters +0 -18
  560. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj +0 -199
  561. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj.filters +0 -26
  562. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj +0 -191
  563. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj.filters +0 -26
  564. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj +0 -188
  565. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj.filters +0 -18
  566. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj +0 -180
  567. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj.filters +0 -18
  568. package/external/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +0 -127
  569. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +0 -68
  570. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +0 -43
  571. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +0 -140
  572. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +0 -154
  573. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +0 -56
  574. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +0 -85
  575. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +0 -110
  576. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +0 -172
  577. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +0 -152
  578. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +0 -46
  579. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +0 -53
  580. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +0 -49
  581. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +0 -199
  582. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +0 -225
  583. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +0 -118
  584. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +0 -174
  585. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +0 -157
  586. package/external/rapidjson/thirdparty/gtest/googletest/scripts/common.py +0 -83
  587. package/external/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +0 -253
  588. package/external/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +0 -730
  589. package/external/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +0 -274
  590. package/external/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +0 -855
  591. package/external/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +0 -158
  592. package/external/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +0 -1387
  593. package/external/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +0 -78
  594. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +0 -48
  595. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +0 -1536
  596. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +0 -385
  597. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +0 -1175
  598. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +0 -1277
  599. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +0 -458
  600. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +0 -102
  601. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +0 -119
  602. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +0 -5846
  603. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +0 -38
  604. package/external/rapidjson/thirdparty/gtest/googletest/test/BUILD.bazel +0 -396
  605. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +0 -93
  606. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +0 -1424
  607. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +0 -652
  608. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +0 -154
  609. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +0 -311
  610. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +0 -159
  611. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +0 -213
  612. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +0 -61
  613. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +0 -1110
  614. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +0 -53
  615. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +0 -1303
  616. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +0 -1737
  617. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +0 -208
  618. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +0 -320
  619. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +0 -45
  620. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +0 -380
  621. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +0 -66
  622. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +0 -341
  623. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +0 -47
  624. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_assert_by_exception_test.cc +0 -119
  625. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +0 -210
  626. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +0 -87
  627. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +0 -235
  628. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +0 -311
  629. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +0 -129
  630. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +0 -63
  631. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +0 -119
  632. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +0 -124
  633. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +0 -189
  634. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +0 -638
  635. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +0 -138
  636. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +0 -172
  637. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +0 -46
  638. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_json_outfiles_test.py +0 -162
  639. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_json_output_unittest.py +0 -611
  640. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_json_test_utils.py +0 -60
  641. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +0 -207
  642. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +0 -157
  643. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +0 -45
  644. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +0 -56
  645. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +0 -344
  646. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +0 -1067
  647. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +0 -781
  648. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +0 -2427
  649. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +0 -127
  650. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +0 -57
  651. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +0 -236
  652. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +0 -325
  653. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +0 -103
  654. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +0 -57
  655. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +0 -250
  656. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +0 -318
  657. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test.py +0 -65
  658. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test_.cc +0 -44
  659. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +0 -92
  660. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +0 -171
  661. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +0 -72
  662. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +0 -69
  663. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +0 -43
  664. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +0 -7797
  665. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +0 -48
  666. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +0 -48
  667. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +0 -140
  668. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +0 -378
  669. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +0 -179
  670. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +0 -196
  671. package/external/rapidjson/thirdparty/gtest/googletest/test/production.cc +0 -36
  672. package/external/rapidjson/thirdparty/gtest/googletest/test/production.h +0 -55
  673. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +0 -30
  674. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +0 -17
  675. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +0 -41
  676. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +0 -32
  677. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +0 -18
  678. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +0 -8
  679. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +0 -30
  680. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +0 -28
  681. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +0 -457
  682. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +0 -62
  683. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +0 -63
  684. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +0 -59
  685. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +0 -68
  686. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +0 -65
  687. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +0 -100
  688. package/external/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +0 -1182
  689. package/external/rapidjson/travis-doxygen.sh +0 -121
  690. package/include/.clang-format +0 -76
  691. package/include/eosio/abi.hpp +0 -286
  692. package/include/eosio/asset.hpp +0 -458
  693. package/include/eosio/bytes.hpp +0 -27
  694. package/include/eosio/chain_conversions.hpp +0 -450
  695. package/include/eosio/chain_types.hpp +0 -14
  696. package/include/eosio/check.hpp +0 -178
  697. package/include/eosio/convert.hpp +0 -95
  698. package/include/eosio/crypto.hpp +0 -147
  699. package/include/eosio/eosio_outcome.hpp +0 -41
  700. package/include/eosio/fixed_bytes.hpp +0 -246
  701. package/include/eosio/float.hpp +0 -35
  702. package/include/eosio/for_each_field.hpp +0 -48
  703. package/include/eosio/fpconv.c +0 -336
  704. package/include/eosio/fpconv.h +0 -41
  705. package/include/eosio/fpconv.license +0 -23
  706. package/include/eosio/from_bin.hpp +0 -272
  707. package/include/eosio/from_json.hpp +0 -737
  708. package/include/eosio/from_string.hpp +0 -28
  709. package/include/eosio/map_macro.h +0 -64
  710. package/include/eosio/murmur.hpp +0 -55
  711. package/include/eosio/name.hpp +0 -174
  712. package/include/eosio/opaque.hpp +0 -108
  713. package/include/eosio/operators.hpp +0 -71
  714. package/include/eosio/powers.h +0 -76
  715. package/include/eosio/reflection.hpp +0 -61
  716. package/include/eosio/ship_protocol.hpp +0 -850
  717. package/include/eosio/stream.hpp +0 -231
  718. package/include/eosio/symbol.hpp +0 -300
  719. package/include/eosio/time.hpp +0 -264
  720. package/include/eosio/to_bin.hpp +0 -189
  721. package/include/eosio/to_json.hpp +0 -279
  722. package/include/eosio/to_key.hpp +0 -298
  723. package/include/eosio/types.hpp +0 -97
  724. package/include/eosio/varint.hpp +0 -452
  725. package/include/outcome-basic.hpp +0 -6836
  726. package/src/abi.cpp +0 -297
  727. package/src/abieos.cpp +0 -263
  728. package/src/abieos.h +0 -76
  729. package/src/abieos.hpp +0 -1010
  730. package/src/abieos_exception.hpp +0 -89
  731. package/src/abieos_numeric.hpp +0 -94
  732. package/src/abieos_ripemd160.hpp +0 -417
  733. package/src/crypto.cpp +0 -215
  734. package/src/key_test.cpp +0 -218
  735. package/src/main.cpp +0 -242
  736. package/src/reflect_test.cpp +0 -28
  737. package/src/template_test.cpp +0 -240
  738. package/src/test.cpp +0 -940
  739. package/tools/CMakeLists.txt +0 -9
  740. package/tools/name.cpp +0 -86
@@ -1,2332 +0,0 @@
1
- // Copyright 2005, Google Inc.
2
- // All rights reserved.
3
- //
4
- // Redistribution and use in source and binary forms, with or without
5
- // modification, are permitted provided that the following conditions are
6
- // met:
7
- //
8
- // * Redistributions of source code must retain the above copyright
9
- // notice, this list of conditions and the following disclaimer.
10
- // * Redistributions in binary form must reproduce the above
11
- // copyright notice, this list of conditions and the following disclaimer
12
- // in the documentation and/or other materials provided with the
13
- // distribution.
14
- // * Neither the name of Google Inc. nor the names of its
15
- // contributors may be used to endorse or promote products derived from
16
- // this software without specific prior written permission.
17
- //
18
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
- //
30
- // Author: wan@google.com (Zhanyong Wan)
31
- //
32
- // The Google C++ Testing and Mocking Framework (Google Test)
33
- //
34
- // This header file defines the public API for Google Test. It should be
35
- // included by any test program that uses Google Test.
36
- //
37
- // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
38
- // leave some internal implementation details in this header file.
39
- // They are clearly marked by comments like this:
40
- //
41
- // // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
42
- //
43
- // Such code is NOT meant to be used by a user directly, and is subject
44
- // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
45
- // program!
46
- //
47
- // Acknowledgment: Google Test borrowed the idea of automatic test
48
- // registration from Barthelemy Dagenais' (barthelemy@prologique.com)
49
- // easyUnit framework.
50
-
51
- #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
52
- #define GTEST_INCLUDE_GTEST_GTEST_H_
53
-
54
- #include <limits>
55
- #include <ostream>
56
- #include <vector>
57
-
58
- #include "gtest/internal/gtest-internal.h"
59
- #include "gtest/internal/gtest-string.h"
60
- #include "gtest/gtest-death-test.h"
61
- #include "gtest/gtest-message.h"
62
- #include "gtest/gtest-param-test.h"
63
- #include "gtest/gtest-printers.h"
64
- #include "gtest/gtest_prod.h"
65
- #include "gtest/gtest-test-part.h"
66
- #include "gtest/gtest-typed-test.h"
67
-
68
- // Depending on the platform, different string classes are available.
69
- // On Linux, in addition to ::std::string, Google also makes use of
70
- // class ::string, which has the same interface as ::std::string, but
71
- // has a different implementation.
72
- //
73
- // You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
74
- // ::string is available AND is a distinct type to ::std::string, or
75
- // define it to 0 to indicate otherwise.
76
- //
77
- // If ::std::string and ::string are the same class on your platform
78
- // due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0.
79
- //
80
- // If you do not define GTEST_HAS_GLOBAL_STRING, it is defined
81
- // heuristically.
82
-
83
- namespace testing {
84
-
85
- // Silence C4100 (unreferenced formal parameter) and 4805
86
- // unsafe mix of type 'const int' and type 'const bool'
87
- #ifdef _MSC_VER
88
- # pragma warning(push)
89
- # pragma warning(disable:4805)
90
- # pragma warning(disable:4100)
91
- #endif
92
-
93
-
94
- // Declares the flags.
95
-
96
- // This flag temporary enables the disabled tests.
97
- GTEST_DECLARE_bool_(also_run_disabled_tests);
98
-
99
- // This flag brings the debugger on an assertion failure.
100
- GTEST_DECLARE_bool_(break_on_failure);
101
-
102
- // This flag controls whether Google Test catches all test-thrown exceptions
103
- // and logs them as failures.
104
- GTEST_DECLARE_bool_(catch_exceptions);
105
-
106
- // This flag enables using colors in terminal output. Available values are
107
- // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
108
- // to let Google Test decide.
109
- GTEST_DECLARE_string_(color);
110
-
111
- // This flag sets up the filter to select by name using a glob pattern
112
- // the tests to run. If the filter is not given all tests are executed.
113
- GTEST_DECLARE_string_(filter);
114
-
115
- // This flag causes the Google Test to list tests. None of the tests listed
116
- // are actually run if the flag is provided.
117
- GTEST_DECLARE_bool_(list_tests);
118
-
119
- // This flag controls whether Google Test emits a detailed XML report to a file
120
- // in addition to its normal textual output.
121
- GTEST_DECLARE_string_(output);
122
-
123
- // This flags control whether Google Test prints the elapsed time for each
124
- // test.
125
- GTEST_DECLARE_bool_(print_time);
126
-
127
- // This flags control whether Google Test prints UTF8 characters as text.
128
- GTEST_DECLARE_bool_(print_utf8);
129
-
130
- // This flag specifies the random number seed.
131
- GTEST_DECLARE_int32_(random_seed);
132
-
133
- // This flag sets how many times the tests are repeated. The default value
134
- // is 1. If the value is -1 the tests are repeating forever.
135
- GTEST_DECLARE_int32_(repeat);
136
-
137
- // This flag controls whether Google Test includes Google Test internal
138
- // stack frames in failure stack traces.
139
- GTEST_DECLARE_bool_(show_internal_stack_frames);
140
-
141
- // When this flag is specified, tests' order is randomized on every iteration.
142
- GTEST_DECLARE_bool_(shuffle);
143
-
144
- // This flag specifies the maximum number of stack frames to be
145
- // printed in a failure message.
146
- GTEST_DECLARE_int32_(stack_trace_depth);
147
-
148
- // When this flag is specified, a failed assertion will throw an
149
- // exception if exceptions are enabled, or exit the program with a
150
- // non-zero code otherwise. For use with an external test framework.
151
- GTEST_DECLARE_bool_(throw_on_failure);
152
-
153
- // When this flag is set with a "host:port" string, on supported
154
- // platforms test results are streamed to the specified port on
155
- // the specified host machine.
156
- GTEST_DECLARE_string_(stream_result_to);
157
-
158
- // The upper limit for valid stack trace depths.
159
- const int kMaxStackTraceDepth = 100;
160
-
161
- namespace internal {
162
-
163
- class AssertHelper;
164
- class DefaultGlobalTestPartResultReporter;
165
- class ExecDeathTest;
166
- class NoExecDeathTest;
167
- class FinalSuccessChecker;
168
- class GTestFlagSaver;
169
- class StreamingListenerTest;
170
- class TestResultAccessor;
171
- class TestEventListenersAccessor;
172
- class TestEventRepeater;
173
- class UnitTestRecordPropertyTestHelper;
174
- class WindowsDeathTest;
175
- class FuchsiaDeathTest;
176
- class UnitTestImpl* GetUnitTestImpl();
177
- void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
178
- const std::string& message);
179
-
180
- } // namespace internal
181
-
182
- // The friend relationship of some of these classes is cyclic.
183
- // If we don't forward declare them the compiler might confuse the classes
184
- // in friendship clauses with same named classes on the scope.
185
- class Test;
186
- class TestCase;
187
- class TestInfo;
188
- class UnitTest;
189
-
190
- // A class for indicating whether an assertion was successful. When
191
- // the assertion wasn't successful, the AssertionResult object
192
- // remembers a non-empty message that describes how it failed.
193
- //
194
- // To create an instance of this class, use one of the factory functions
195
- // (AssertionSuccess() and AssertionFailure()).
196
- //
197
- // This class is useful for two purposes:
198
- // 1. Defining predicate functions to be used with Boolean test assertions
199
- // EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
200
- // 2. Defining predicate-format functions to be
201
- // used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
202
- //
203
- // For example, if you define IsEven predicate:
204
- //
205
- // testing::AssertionResult IsEven(int n) {
206
- // if ((n % 2) == 0)
207
- // return testing::AssertionSuccess();
208
- // else
209
- // return testing::AssertionFailure() << n << " is odd";
210
- // }
211
- //
212
- // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
213
- // will print the message
214
- //
215
- // Value of: IsEven(Fib(5))
216
- // Actual: false (5 is odd)
217
- // Expected: true
218
- //
219
- // instead of a more opaque
220
- //
221
- // Value of: IsEven(Fib(5))
222
- // Actual: false
223
- // Expected: true
224
- //
225
- // in case IsEven is a simple Boolean predicate.
226
- //
227
- // If you expect your predicate to be reused and want to support informative
228
- // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
229
- // about half as often as positive ones in our tests), supply messages for
230
- // both success and failure cases:
231
- //
232
- // testing::AssertionResult IsEven(int n) {
233
- // if ((n % 2) == 0)
234
- // return testing::AssertionSuccess() << n << " is even";
235
- // else
236
- // return testing::AssertionFailure() << n << " is odd";
237
- // }
238
- //
239
- // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
240
- //
241
- // Value of: IsEven(Fib(6))
242
- // Actual: true (8 is even)
243
- // Expected: false
244
- //
245
- // NB: Predicates that support negative Boolean assertions have reduced
246
- // performance in positive ones so be careful not to use them in tests
247
- // that have lots (tens of thousands) of positive Boolean assertions.
248
- //
249
- // To use this class with EXPECT_PRED_FORMAT assertions such as:
250
- //
251
- // // Verifies that Foo() returns an even number.
252
- // EXPECT_PRED_FORMAT1(IsEven, Foo());
253
- //
254
- // you need to define:
255
- //
256
- // testing::AssertionResult IsEven(const char* expr, int n) {
257
- // if ((n % 2) == 0)
258
- // return testing::AssertionSuccess();
259
- // else
260
- // return testing::AssertionFailure()
261
- // << "Expected: " << expr << " is even\n Actual: it's " << n;
262
- // }
263
- //
264
- // If Foo() returns 5, you will see the following message:
265
- //
266
- // Expected: Foo() is even
267
- // Actual: it's 5
268
- //
269
- class GTEST_API_ AssertionResult {
270
- public:
271
- // Copy constructor.
272
- // Used in EXPECT_TRUE/FALSE(assertion_result).
273
- AssertionResult(const AssertionResult& other);
274
-
275
- #if defined(_MSC_VER) && _MSC_VER < 1910
276
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */)
277
- #endif
278
-
279
- // Used in the EXPECT_TRUE/FALSE(bool_expression).
280
- //
281
- // T must be contextually convertible to bool.
282
- //
283
- // The second parameter prevents this overload from being considered if
284
- // the argument is implicitly convertible to AssertionResult. In that case
285
- // we want AssertionResult's copy constructor to be used.
286
- template <typename T>
287
- explicit AssertionResult(
288
- const T& success,
289
- typename internal::EnableIf<
290
- !internal::ImplicitlyConvertible<T, AssertionResult>::value>::type*
291
- /*enabler*/ = NULL)
292
- : success_(success) {}
293
-
294
- #if defined(_MSC_VER) && _MSC_VER < 1910
295
- GTEST_DISABLE_MSC_WARNINGS_POP_()
296
- #endif
297
-
298
- // Assignment operator.
299
- AssertionResult& operator=(AssertionResult other) {
300
- swap(other);
301
- return *this;
302
- }
303
-
304
- // Returns true iff the assertion succeeded.
305
- operator bool() const { return success_; } // NOLINT
306
-
307
- // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
308
- AssertionResult operator!() const;
309
-
310
- // Returns the text streamed into this AssertionResult. Test assertions
311
- // use it when they fail (i.e., the predicate's outcome doesn't match the
312
- // assertion's expectation). When nothing has been streamed into the
313
- // object, returns an empty string.
314
- const char* message() const {
315
- return message_.get() != NULL ? message_->c_str() : "";
316
- }
317
- // TODO(vladl@google.com): Remove this after making sure no clients use it.
318
- // Deprecated; please use message() instead.
319
- const char* failure_message() const { return message(); }
320
-
321
- // Streams a custom failure message into this object.
322
- template <typename T> AssertionResult& operator<<(const T& value) {
323
- AppendMessage(Message() << value);
324
- return *this;
325
- }
326
-
327
- // Allows streaming basic output manipulators such as endl or flush into
328
- // this object.
329
- AssertionResult& operator<<(
330
- ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
331
- AppendMessage(Message() << basic_manipulator);
332
- return *this;
333
- }
334
-
335
- private:
336
- // Appends the contents of message to message_.
337
- void AppendMessage(const Message& a_message) {
338
- if (message_.get() == NULL)
339
- message_.reset(new ::std::string);
340
- message_->append(a_message.GetString().c_str());
341
- }
342
-
343
- // Swap the contents of this AssertionResult with other.
344
- void swap(AssertionResult& other);
345
-
346
- // Stores result of the assertion predicate.
347
- bool success_;
348
- // Stores the message describing the condition in case the expectation
349
- // construct is not satisfied with the predicate's outcome.
350
- // Referenced via a pointer to avoid taking too much stack frame space
351
- // with test assertions.
352
- internal::scoped_ptr< ::std::string> message_;
353
- };
354
-
355
- // Makes a successful assertion result.
356
- GTEST_API_ AssertionResult AssertionSuccess();
357
-
358
- // Makes a failed assertion result.
359
- GTEST_API_ AssertionResult AssertionFailure();
360
-
361
- // Makes a failed assertion result with the given failure message.
362
- // Deprecated; use AssertionFailure() << msg.
363
- GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
364
-
365
- } // namespace testing
366
-
367
- // Includes the auto-generated header that implements a family of generic
368
- // predicate assertion macros. This include comes late because it relies on
369
- // APIs declared above.
370
- #include "gtest/gtest_pred_impl.h"
371
-
372
- namespace testing {
373
-
374
- // The abstract class that all tests inherit from.
375
- //
376
- // In Google Test, a unit test program contains one or many TestCases, and
377
- // each TestCase contains one or many Tests.
378
- //
379
- // When you define a test using the TEST macro, you don't need to
380
- // explicitly derive from Test - the TEST macro automatically does
381
- // this for you.
382
- //
383
- // The only time you derive from Test is when defining a test fixture
384
- // to be used in a TEST_F. For example:
385
- //
386
- // class FooTest : public testing::Test {
387
- // protected:
388
- // void SetUp() override { ... }
389
- // void TearDown() override { ... }
390
- // ...
391
- // };
392
- //
393
- // TEST_F(FooTest, Bar) { ... }
394
- // TEST_F(FooTest, Baz) { ... }
395
- //
396
- // Test is not copyable.
397
- class GTEST_API_ Test {
398
- public:
399
- friend class TestInfo;
400
-
401
- // Defines types for pointers to functions that set up and tear down
402
- // a test case.
403
- typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
404
- typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
405
-
406
- // The d'tor is virtual as we intend to inherit from Test.
407
- virtual ~Test();
408
-
409
- // Sets up the stuff shared by all tests in this test case.
410
- //
411
- // Google Test will call Foo::SetUpTestCase() before running the first
412
- // test in test case Foo. Hence a sub-class can define its own
413
- // SetUpTestCase() method to shadow the one defined in the super
414
- // class.
415
- static void SetUpTestCase() {}
416
-
417
- // Tears down the stuff shared by all tests in this test case.
418
- //
419
- // Google Test will call Foo::TearDownTestCase() after running the last
420
- // test in test case Foo. Hence a sub-class can define its own
421
- // TearDownTestCase() method to shadow the one defined in the super
422
- // class.
423
- static void TearDownTestCase() {}
424
-
425
- // Returns true iff the current test has a fatal failure.
426
- static bool HasFatalFailure();
427
-
428
- // Returns true iff the current test has a non-fatal failure.
429
- static bool HasNonfatalFailure();
430
-
431
- // Returns true iff the current test has a (either fatal or
432
- // non-fatal) failure.
433
- static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
434
-
435
- // Logs a property for the current test, test case, or for the entire
436
- // invocation of the test program when used outside of the context of a
437
- // test case. Only the last value for a given key is remembered. These
438
- // are public static so they can be called from utility functions that are
439
- // not members of the test fixture. Calls to RecordProperty made during
440
- // lifespan of the test (from the moment its constructor starts to the
441
- // moment its destructor finishes) will be output in XML as attributes of
442
- // the <testcase> element. Properties recorded from fixture's
443
- // SetUpTestCase or TearDownTestCase are logged as attributes of the
444
- // corresponding <testsuite> element. Calls to RecordProperty made in the
445
- // global context (before or after invocation of RUN_ALL_TESTS and from
446
- // SetUp/TearDown method of Environment objects registered with Google
447
- // Test) will be output as attributes of the <testsuites> element.
448
- static void RecordProperty(const std::string& key, const std::string& value);
449
- static void RecordProperty(const std::string& key, int value);
450
-
451
- protected:
452
- // Creates a Test object.
453
- Test();
454
-
455
- // Sets up the test fixture.
456
- virtual void SetUp();
457
-
458
- // Tears down the test fixture.
459
- virtual void TearDown();
460
-
461
- private:
462
- // Returns true iff the current test has the same fixture class as
463
- // the first test in the current test case.
464
- static bool HasSameFixtureClass();
465
-
466
- // Runs the test after the test fixture has been set up.
467
- //
468
- // A sub-class must implement this to define the test logic.
469
- //
470
- // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
471
- // Instead, use the TEST or TEST_F macro.
472
- virtual void TestBody() = 0;
473
-
474
- // Sets up, executes, and tears down the test.
475
- void Run();
476
-
477
- // Deletes self. We deliberately pick an unusual name for this
478
- // internal method to avoid clashing with names used in user TESTs.
479
- void DeleteSelf_() { delete this; }
480
-
481
- const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;
482
-
483
- // Often a user misspells SetUp() as Setup() and spends a long time
484
- // wondering why it is never called by Google Test. The declaration of
485
- // the following method is solely for catching such an error at
486
- // compile time:
487
- //
488
- // - The return type is deliberately chosen to be not void, so it
489
- // will be a conflict if void Setup() is declared in the user's
490
- // test fixture.
491
- //
492
- // - This method is private, so it will be another compiler error
493
- // if the method is called from the user's test fixture.
494
- //
495
- // DO NOT OVERRIDE THIS FUNCTION.
496
- //
497
- // If you see an error about overriding the following function or
498
- // about it being private, you have mis-spelled SetUp() as Setup().
499
- struct Setup_should_be_spelled_SetUp {};
500
- virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
501
-
502
- // We disallow copying Tests.
503
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
504
- };
505
-
506
- typedef internal::TimeInMillis TimeInMillis;
507
-
508
- // A copyable object representing a user specified test property which can be
509
- // output as a key/value string pair.
510
- //
511
- // Don't inherit from TestProperty as its destructor is not virtual.
512
- class TestProperty {
513
- public:
514
- // C'tor. TestProperty does NOT have a default constructor.
515
- // Always use this constructor (with parameters) to create a
516
- // TestProperty object.
517
- TestProperty(const std::string& a_key, const std::string& a_value) :
518
- key_(a_key), value_(a_value) {
519
- }
520
-
521
- // Gets the user supplied key.
522
- const char* key() const {
523
- return key_.c_str();
524
- }
525
-
526
- // Gets the user supplied value.
527
- const char* value() const {
528
- return value_.c_str();
529
- }
530
-
531
- // Sets a new value, overriding the one supplied in the constructor.
532
- void SetValue(const std::string& new_value) {
533
- value_ = new_value;
534
- }
535
-
536
- private:
537
- // The key supplied by the user.
538
- std::string key_;
539
- // The value supplied by the user.
540
- std::string value_;
541
- };
542
-
543
- // The result of a single Test. This includes a list of
544
- // TestPartResults, a list of TestProperties, a count of how many
545
- // death tests there are in the Test, and how much time it took to run
546
- // the Test.
547
- //
548
- // TestResult is not copyable.
549
- class GTEST_API_ TestResult {
550
- public:
551
- // Creates an empty TestResult.
552
- TestResult();
553
-
554
- // D'tor. Do not inherit from TestResult.
555
- ~TestResult();
556
-
557
- // Gets the number of all test parts. This is the sum of the number
558
- // of successful test parts and the number of failed test parts.
559
- int total_part_count() const;
560
-
561
- // Returns the number of the test properties.
562
- int test_property_count() const;
563
-
564
- // Returns true iff the test passed (i.e. no test part failed).
565
- bool Passed() const { return !Failed(); }
566
-
567
- // Returns true iff the test failed.
568
- bool Failed() const;
569
-
570
- // Returns true iff the test fatally failed.
571
- bool HasFatalFailure() const;
572
-
573
- // Returns true iff the test has a non-fatal failure.
574
- bool HasNonfatalFailure() const;
575
-
576
- // Returns the elapsed time, in milliseconds.
577
- TimeInMillis elapsed_time() const { return elapsed_time_; }
578
-
579
- // Returns the i-th test part result among all the results. i can range from 0
580
- // to total_part_count() - 1. If i is not in that range, aborts the program.
581
- const TestPartResult& GetTestPartResult(int i) const;
582
-
583
- // Returns the i-th test property. i can range from 0 to
584
- // test_property_count() - 1. If i is not in that range, aborts the
585
- // program.
586
- const TestProperty& GetTestProperty(int i) const;
587
-
588
- private:
589
- friend class TestInfo;
590
- friend class TestCase;
591
- friend class UnitTest;
592
- friend class internal::DefaultGlobalTestPartResultReporter;
593
- friend class internal::ExecDeathTest;
594
- friend class internal::TestResultAccessor;
595
- friend class internal::UnitTestImpl;
596
- friend class internal::WindowsDeathTest;
597
- friend class internal::FuchsiaDeathTest;
598
-
599
- // Gets the vector of TestPartResults.
600
- const std::vector<TestPartResult>& test_part_results() const {
601
- return test_part_results_;
602
- }
603
-
604
- // Gets the vector of TestProperties.
605
- const std::vector<TestProperty>& test_properties() const {
606
- return test_properties_;
607
- }
608
-
609
- // Sets the elapsed time.
610
- void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
611
-
612
- // Adds a test property to the list. The property is validated and may add
613
- // a non-fatal failure if invalid (e.g., if it conflicts with reserved
614
- // key names). If a property is already recorded for the same key, the
615
- // value will be updated, rather than storing multiple values for the same
616
- // key. xml_element specifies the element for which the property is being
617
- // recorded and is used for validation.
618
- void RecordProperty(const std::string& xml_element,
619
- const TestProperty& test_property);
620
-
621
- // Adds a failure if the key is a reserved attribute of Google Test
622
- // testcase tags. Returns true if the property is valid.
623
- // TODO(russr): Validate attribute names are legal and human readable.
624
- static bool ValidateTestProperty(const std::string& xml_element,
625
- const TestProperty& test_property);
626
-
627
- // Adds a test part result to the list.
628
- void AddTestPartResult(const TestPartResult& test_part_result);
629
-
630
- // Returns the death test count.
631
- int death_test_count() const { return death_test_count_; }
632
-
633
- // Increments the death test count, returning the new count.
634
- int increment_death_test_count() { return ++death_test_count_; }
635
-
636
- // Clears the test part results.
637
- void ClearTestPartResults();
638
-
639
- // Clears the object.
640
- void Clear();
641
-
642
- // Protects mutable state of the property vector and of owned
643
- // properties, whose values may be updated.
644
- internal::Mutex test_properites_mutex_;
645
-
646
- // The vector of TestPartResults
647
- std::vector<TestPartResult> test_part_results_;
648
- // The vector of TestProperties
649
- std::vector<TestProperty> test_properties_;
650
- // Running count of death tests.
651
- int death_test_count_;
652
- // The elapsed time, in milliseconds.
653
- TimeInMillis elapsed_time_;
654
-
655
- // We disallow copying TestResult.
656
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
657
- }; // class TestResult
658
-
659
- // A TestInfo object stores the following information about a test:
660
- //
661
- // Test case name
662
- // Test name
663
- // Whether the test should be run
664
- // A function pointer that creates the test object when invoked
665
- // Test result
666
- //
667
- // The constructor of TestInfo registers itself with the UnitTest
668
- // singleton such that the RUN_ALL_TESTS() macro knows which tests to
669
- // run.
670
- class GTEST_API_ TestInfo {
671
- public:
672
- // Destructs a TestInfo object. This function is not virtual, so
673
- // don't inherit from TestInfo.
674
- ~TestInfo();
675
-
676
- // Returns the test case name.
677
- const char* test_case_name() const { return test_case_name_.c_str(); }
678
-
679
- // Returns the test name.
680
- const char* name() const { return name_.c_str(); }
681
-
682
- // Returns the name of the parameter type, or NULL if this is not a typed
683
- // or a type-parameterized test.
684
- const char* type_param() const {
685
- if (type_param_.get() != NULL)
686
- return type_param_->c_str();
687
- return NULL;
688
- }
689
-
690
- // Returns the text representation of the value parameter, or NULL if this
691
- // is not a value-parameterized test.
692
- const char* value_param() const {
693
- if (value_param_.get() != NULL)
694
- return value_param_->c_str();
695
- return NULL;
696
- }
697
-
698
- // Returns the file name where this test is defined.
699
- const char* file() const { return location_.file.c_str(); }
700
-
701
- // Returns the line where this test is defined.
702
- int line() const { return location_.line; }
703
-
704
- // Return true if this test should not be run because it's in another shard.
705
- bool is_in_another_shard() const { return is_in_another_shard_; }
706
-
707
- // Returns true if this test should run, that is if the test is not
708
- // disabled (or it is disabled but the also_run_disabled_tests flag has
709
- // been specified) and its full name matches the user-specified filter.
710
- //
711
- // Google Test allows the user to filter the tests by their full names.
712
- // The full name of a test Bar in test case Foo is defined as
713
- // "Foo.Bar". Only the tests that match the filter will run.
714
- //
715
- // A filter is a colon-separated list of glob (not regex) patterns,
716
- // optionally followed by a '-' and a colon-separated list of
717
- // negative patterns (tests to exclude). A test is run if it
718
- // matches one of the positive patterns and does not match any of
719
- // the negative patterns.
720
- //
721
- // For example, *A*:Foo.* is a filter that matches any string that
722
- // contains the character 'A' or starts with "Foo.".
723
- bool should_run() const { return should_run_; }
724
-
725
- // Returns true iff this test will appear in the XML report.
726
- bool is_reportable() const {
727
- // The XML report includes tests matching the filter, excluding those
728
- // run in other shards.
729
- return matches_filter_ && !is_in_another_shard_;
730
- }
731
-
732
- // Returns the result of the test.
733
- const TestResult* result() const { return &result_; }
734
-
735
- private:
736
- #if GTEST_HAS_DEATH_TEST
737
- friend class internal::DefaultDeathTestFactory;
738
- #endif // GTEST_HAS_DEATH_TEST
739
- friend class Test;
740
- friend class TestCase;
741
- friend class internal::UnitTestImpl;
742
- friend class internal::StreamingListenerTest;
743
- friend TestInfo* internal::MakeAndRegisterTestInfo(
744
- const char* test_case_name,
745
- const char* name,
746
- const char* type_param,
747
- const char* value_param,
748
- internal::CodeLocation code_location,
749
- internal::TypeId fixture_class_id,
750
- Test::SetUpTestCaseFunc set_up_tc,
751
- Test::TearDownTestCaseFunc tear_down_tc,
752
- internal::TestFactoryBase* factory);
753
-
754
- // Constructs a TestInfo object. The newly constructed instance assumes
755
- // ownership of the factory object.
756
- TestInfo(const std::string& test_case_name,
757
- const std::string& name,
758
- const char* a_type_param, // NULL if not a type-parameterized test
759
- const char* a_value_param, // NULL if not a value-parameterized test
760
- internal::CodeLocation a_code_location,
761
- internal::TypeId fixture_class_id,
762
- internal::TestFactoryBase* factory);
763
-
764
- // Increments the number of death tests encountered in this test so
765
- // far.
766
- int increment_death_test_count() {
767
- return result_.increment_death_test_count();
768
- }
769
-
770
- // Creates the test object, runs it, records its result, and then
771
- // deletes it.
772
- void Run();
773
-
774
- static void ClearTestResult(TestInfo* test_info) {
775
- test_info->result_.Clear();
776
- }
777
-
778
- // These fields are immutable properties of the test.
779
- const std::string test_case_name_; // Test case name
780
- const std::string name_; // Test name
781
- // Name of the parameter type, or NULL if this is not a typed or a
782
- // type-parameterized test.
783
- const internal::scoped_ptr<const ::std::string> type_param_;
784
- // Text representation of the value parameter, or NULL if this is not a
785
- // value-parameterized test.
786
- const internal::scoped_ptr<const ::std::string> value_param_;
787
- internal::CodeLocation location_;
788
- const internal::TypeId fixture_class_id_; // ID of the test fixture class
789
- bool should_run_; // True iff this test should run
790
- bool is_disabled_; // True iff this test is disabled
791
- bool matches_filter_; // True if this test matches the
792
- // user-specified filter.
793
- bool is_in_another_shard_; // Will be run in another shard.
794
- internal::TestFactoryBase* const factory_; // The factory that creates
795
- // the test object
796
-
797
- // This field is mutable and needs to be reset before running the
798
- // test for the second time.
799
- TestResult result_;
800
-
801
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
802
- };
803
-
804
- // A test case, which consists of a vector of TestInfos.
805
- //
806
- // TestCase is not copyable.
807
- class GTEST_API_ TestCase {
808
- public:
809
- // Creates a TestCase with the given name.
810
- //
811
- // TestCase does NOT have a default constructor. Always use this
812
- // constructor to create a TestCase object.
813
- //
814
- // Arguments:
815
- //
816
- // name: name of the test case
817
- // a_type_param: the name of the test's type parameter, or NULL if
818
- // this is not a type-parameterized test.
819
- // set_up_tc: pointer to the function that sets up the test case
820
- // tear_down_tc: pointer to the function that tears down the test case
821
- TestCase(const char* name, const char* a_type_param,
822
- Test::SetUpTestCaseFunc set_up_tc,
823
- Test::TearDownTestCaseFunc tear_down_tc);
824
-
825
- // Destructor of TestCase.
826
- virtual ~TestCase();
827
-
828
- // Gets the name of the TestCase.
829
- const char* name() const { return name_.c_str(); }
830
-
831
- // Returns the name of the parameter type, or NULL if this is not a
832
- // type-parameterized test case.
833
- const char* type_param() const {
834
- if (type_param_.get() != NULL)
835
- return type_param_->c_str();
836
- return NULL;
837
- }
838
-
839
- // Returns true if any test in this test case should run.
840
- bool should_run() const { return should_run_; }
841
-
842
- // Gets the number of successful tests in this test case.
843
- int successful_test_count() const;
844
-
845
- // Gets the number of failed tests in this test case.
846
- int failed_test_count() const;
847
-
848
- // Gets the number of disabled tests that will be reported in the XML report.
849
- int reportable_disabled_test_count() const;
850
-
851
- // Gets the number of disabled tests in this test case.
852
- int disabled_test_count() const;
853
-
854
- // Gets the number of tests to be printed in the XML report.
855
- int reportable_test_count() const;
856
-
857
- // Get the number of tests in this test case that should run.
858
- int test_to_run_count() const;
859
-
860
- // Gets the number of all tests in this test case.
861
- int total_test_count() const;
862
-
863
- // Returns true iff the test case passed.
864
- bool Passed() const { return !Failed(); }
865
-
866
- // Returns true iff the test case failed.
867
- bool Failed() const { return failed_test_count() > 0; }
868
-
869
- // Returns the elapsed time, in milliseconds.
870
- TimeInMillis elapsed_time() const { return elapsed_time_; }
871
-
872
- // Returns the i-th test among all the tests. i can range from 0 to
873
- // total_test_count() - 1. If i is not in that range, returns NULL.
874
- const TestInfo* GetTestInfo(int i) const;
875
-
876
- // Returns the TestResult that holds test properties recorded during
877
- // execution of SetUpTestCase and TearDownTestCase.
878
- const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
879
-
880
- private:
881
- friend class Test;
882
- friend class internal::UnitTestImpl;
883
-
884
- // Gets the (mutable) vector of TestInfos in this TestCase.
885
- std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
886
-
887
- // Gets the (immutable) vector of TestInfos in this TestCase.
888
- const std::vector<TestInfo*>& test_info_list() const {
889
- return test_info_list_;
890
- }
891
-
892
- // Returns the i-th test among all the tests. i can range from 0 to
893
- // total_test_count() - 1. If i is not in that range, returns NULL.
894
- TestInfo* GetMutableTestInfo(int i);
895
-
896
- // Sets the should_run member.
897
- void set_should_run(bool should) { should_run_ = should; }
898
-
899
- // Adds a TestInfo to this test case. Will delete the TestInfo upon
900
- // destruction of the TestCase object.
901
- void AddTestInfo(TestInfo * test_info);
902
-
903
- // Clears the results of all tests in this test case.
904
- void ClearResult();
905
-
906
- // Clears the results of all tests in the given test case.
907
- static void ClearTestCaseResult(TestCase* test_case) {
908
- test_case->ClearResult();
909
- }
910
-
911
- // Runs every test in this TestCase.
912
- void Run();
913
-
914
- // Runs SetUpTestCase() for this TestCase. This wrapper is needed
915
- // for catching exceptions thrown from SetUpTestCase().
916
- void RunSetUpTestCase() { (*set_up_tc_)(); }
917
-
918
- // Runs TearDownTestCase() for this TestCase. This wrapper is
919
- // needed for catching exceptions thrown from TearDownTestCase().
920
- void RunTearDownTestCase() { (*tear_down_tc_)(); }
921
-
922
- // Returns true iff test passed.
923
- static bool TestPassed(const TestInfo* test_info) {
924
- return test_info->should_run() && test_info->result()->Passed();
925
- }
926
-
927
- // Returns true iff test failed.
928
- static bool TestFailed(const TestInfo* test_info) {
929
- return test_info->should_run() && test_info->result()->Failed();
930
- }
931
-
932
- // Returns true iff the test is disabled and will be reported in the XML
933
- // report.
934
- static bool TestReportableDisabled(const TestInfo* test_info) {
935
- return test_info->is_reportable() && test_info->is_disabled_;
936
- }
937
-
938
- // Returns true iff test is disabled.
939
- static bool TestDisabled(const TestInfo* test_info) {
940
- return test_info->is_disabled_;
941
- }
942
-
943
- // Returns true iff this test will appear in the XML report.
944
- static bool TestReportable(const TestInfo* test_info) {
945
- return test_info->is_reportable();
946
- }
947
-
948
- // Returns true if the given test should run.
949
- static bool ShouldRunTest(const TestInfo* test_info) {
950
- return test_info->should_run();
951
- }
952
-
953
- // Shuffles the tests in this test case.
954
- void ShuffleTests(internal::Random* random);
955
-
956
- // Restores the test order to before the first shuffle.
957
- void UnshuffleTests();
958
-
959
- // Name of the test case.
960
- std::string name_;
961
- // Name of the parameter type, or NULL if this is not a typed or a
962
- // type-parameterized test.
963
- const internal::scoped_ptr<const ::std::string> type_param_;
964
- // The vector of TestInfos in their original order. It owns the
965
- // elements in the vector.
966
- std::vector<TestInfo*> test_info_list_;
967
- // Provides a level of indirection for the test list to allow easy
968
- // shuffling and restoring the test order. The i-th element in this
969
- // vector is the index of the i-th test in the shuffled test list.
970
- std::vector<int> test_indices_;
971
- // Pointer to the function that sets up the test case.
972
- Test::SetUpTestCaseFunc set_up_tc_;
973
- // Pointer to the function that tears down the test case.
974
- Test::TearDownTestCaseFunc tear_down_tc_;
975
- // True iff any test in this test case should run.
976
- bool should_run_;
977
- // Elapsed time, in milliseconds.
978
- TimeInMillis elapsed_time_;
979
- // Holds test properties recorded during execution of SetUpTestCase and
980
- // TearDownTestCase.
981
- TestResult ad_hoc_test_result_;
982
-
983
- // We disallow copying TestCases.
984
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
985
- };
986
-
987
- // An Environment object is capable of setting up and tearing down an
988
- // environment. You should subclass this to define your own
989
- // environment(s).
990
- //
991
- // An Environment object does the set-up and tear-down in virtual
992
- // methods SetUp() and TearDown() instead of the constructor and the
993
- // destructor, as:
994
- //
995
- // 1. You cannot safely throw from a destructor. This is a problem
996
- // as in some cases Google Test is used where exceptions are enabled, and
997
- // we may want to implement ASSERT_* using exceptions where they are
998
- // available.
999
- // 2. You cannot use ASSERT_* directly in a constructor or
1000
- // destructor.
1001
- class Environment {
1002
- public:
1003
- // The d'tor is virtual as we need to subclass Environment.
1004
- virtual ~Environment() {}
1005
-
1006
- // Override this to define how to set up the environment.
1007
- virtual void SetUp() {}
1008
-
1009
- // Override this to define how to tear down the environment.
1010
- virtual void TearDown() {}
1011
- private:
1012
- // If you see an error about overriding the following function or
1013
- // about it being private, you have mis-spelled SetUp() as Setup().
1014
- struct Setup_should_be_spelled_SetUp {};
1015
- virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
1016
- };
1017
-
1018
- #if GTEST_HAS_EXCEPTIONS
1019
-
1020
- // Exception which can be thrown from TestEventListener::OnTestPartResult.
1021
- class GTEST_API_ AssertionException
1022
- : public internal::GoogleTestFailureException {
1023
- public:
1024
- explicit AssertionException(const TestPartResult& result)
1025
- : GoogleTestFailureException(result) {}
1026
- };
1027
-
1028
- #endif // GTEST_HAS_EXCEPTIONS
1029
-
1030
- // The interface for tracing execution of tests. The methods are organized in
1031
- // the order the corresponding events are fired.
1032
- class TestEventListener {
1033
- public:
1034
- virtual ~TestEventListener() {}
1035
-
1036
- // Fired before any test activity starts.
1037
- virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
1038
-
1039
- // Fired before each iteration of tests starts. There may be more than
1040
- // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
1041
- // index, starting from 0.
1042
- virtual void OnTestIterationStart(const UnitTest& unit_test,
1043
- int iteration) = 0;
1044
-
1045
- // Fired before environment set-up for each iteration of tests starts.
1046
- virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
1047
-
1048
- // Fired after environment set-up for each iteration of tests ends.
1049
- virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
1050
-
1051
- // Fired before the test case starts.
1052
- virtual void OnTestCaseStart(const TestCase& test_case) = 0;
1053
-
1054
- // Fired before the test starts.
1055
- virtual void OnTestStart(const TestInfo& test_info) = 0;
1056
-
1057
- // Fired after a failed assertion or a SUCCEED() invocation.
1058
- // If you want to throw an exception from this function to skip to the next
1059
- // TEST, it must be AssertionException defined above, or inherited from it.
1060
- virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
1061
-
1062
- // Fired after the test ends.
1063
- virtual void OnTestEnd(const TestInfo& test_info) = 0;
1064
-
1065
- // Fired after the test case ends.
1066
- virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
1067
-
1068
- // Fired before environment tear-down for each iteration of tests starts.
1069
- virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
1070
-
1071
- // Fired after environment tear-down for each iteration of tests ends.
1072
- virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
1073
-
1074
- // Fired after each iteration of tests finishes.
1075
- virtual void OnTestIterationEnd(const UnitTest& unit_test,
1076
- int iteration) = 0;
1077
-
1078
- // Fired after all test activities have ended.
1079
- virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
1080
- };
1081
-
1082
- // The convenience class for users who need to override just one or two
1083
- // methods and are not concerned that a possible change to a signature of
1084
- // the methods they override will not be caught during the build. For
1085
- // comments about each method please see the definition of TestEventListener
1086
- // above.
1087
- class EmptyTestEventListener : public TestEventListener {
1088
- public:
1089
- virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
1090
- virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
1091
- int /*iteration*/) {}
1092
- virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
1093
- virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
1094
- virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
1095
- virtual void OnTestStart(const TestInfo& /*test_info*/) {}
1096
- virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
1097
- virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
1098
- virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
1099
- virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
1100
- virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
1101
- virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
1102
- int /*iteration*/) {}
1103
- virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
1104
- };
1105
-
1106
- // TestEventListeners lets users add listeners to track events in Google Test.
1107
- class GTEST_API_ TestEventListeners {
1108
- public:
1109
- TestEventListeners();
1110
- ~TestEventListeners();
1111
-
1112
- // Appends an event listener to the end of the list. Google Test assumes
1113
- // the ownership of the listener (i.e. it will delete the listener when
1114
- // the test program finishes).
1115
- void Append(TestEventListener* listener);
1116
-
1117
- // Removes the given event listener from the list and returns it. It then
1118
- // becomes the caller's responsibility to delete the listener. Returns
1119
- // NULL if the listener is not found in the list.
1120
- TestEventListener* Release(TestEventListener* listener);
1121
-
1122
- // Returns the standard listener responsible for the default console
1123
- // output. Can be removed from the listeners list to shut down default
1124
- // console output. Note that removing this object from the listener list
1125
- // with Release transfers its ownership to the caller and makes this
1126
- // function return NULL the next time.
1127
- TestEventListener* default_result_printer() const {
1128
- return default_result_printer_;
1129
- }
1130
-
1131
- // Returns the standard listener responsible for the default XML output
1132
- // controlled by the --gtest_output=xml flag. Can be removed from the
1133
- // listeners list by users who want to shut down the default XML output
1134
- // controlled by this flag and substitute it with custom one. Note that
1135
- // removing this object from the listener list with Release transfers its
1136
- // ownership to the caller and makes this function return NULL the next
1137
- // time.
1138
- TestEventListener* default_xml_generator() const {
1139
- return default_xml_generator_;
1140
- }
1141
-
1142
- private:
1143
- friend class TestCase;
1144
- friend class TestInfo;
1145
- friend class internal::DefaultGlobalTestPartResultReporter;
1146
- friend class internal::NoExecDeathTest;
1147
- friend class internal::TestEventListenersAccessor;
1148
- friend class internal::UnitTestImpl;
1149
-
1150
- // Returns repeater that broadcasts the TestEventListener events to all
1151
- // subscribers.
1152
- TestEventListener* repeater();
1153
-
1154
- // Sets the default_result_printer attribute to the provided listener.
1155
- // The listener is also added to the listener list and previous
1156
- // default_result_printer is removed from it and deleted. The listener can
1157
- // also be NULL in which case it will not be added to the list. Does
1158
- // nothing if the previous and the current listener objects are the same.
1159
- void SetDefaultResultPrinter(TestEventListener* listener);
1160
-
1161
- // Sets the default_xml_generator attribute to the provided listener. The
1162
- // listener is also added to the listener list and previous
1163
- // default_xml_generator is removed from it and deleted. The listener can
1164
- // also be NULL in which case it will not be added to the list. Does
1165
- // nothing if the previous and the current listener objects are the same.
1166
- void SetDefaultXmlGenerator(TestEventListener* listener);
1167
-
1168
- // Controls whether events will be forwarded by the repeater to the
1169
- // listeners in the list.
1170
- bool EventForwardingEnabled() const;
1171
- void SuppressEventForwarding();
1172
-
1173
- // The actual list of listeners.
1174
- internal::TestEventRepeater* repeater_;
1175
- // Listener responsible for the standard result output.
1176
- TestEventListener* default_result_printer_;
1177
- // Listener responsible for the creation of the XML output file.
1178
- TestEventListener* default_xml_generator_;
1179
-
1180
- // We disallow copying TestEventListeners.
1181
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
1182
- };
1183
-
1184
- // A UnitTest consists of a vector of TestCases.
1185
- //
1186
- // This is a singleton class. The only instance of UnitTest is
1187
- // created when UnitTest::GetInstance() is first called. This
1188
- // instance is never deleted.
1189
- //
1190
- // UnitTest is not copyable.
1191
- //
1192
- // This class is thread-safe as long as the methods are called
1193
- // according to their specification.
1194
- class GTEST_API_ UnitTest {
1195
- public:
1196
- // Gets the singleton UnitTest object. The first time this method
1197
- // is called, a UnitTest object is constructed and returned.
1198
- // Consecutive calls will return the same object.
1199
- static UnitTest* GetInstance();
1200
-
1201
- // Runs all tests in this UnitTest object and prints the result.
1202
- // Returns 0 if successful, or 1 otherwise.
1203
- //
1204
- // This method can only be called from the main thread.
1205
- //
1206
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1207
- int Run() GTEST_MUST_USE_RESULT_;
1208
-
1209
- // Returns the working directory when the first TEST() or TEST_F()
1210
- // was executed. The UnitTest object owns the string.
1211
- const char* original_working_dir() const;
1212
-
1213
- // Returns the TestCase object for the test that's currently running,
1214
- // or NULL if no test is running.
1215
- const TestCase* current_test_case() const
1216
- GTEST_LOCK_EXCLUDED_(mutex_);
1217
-
1218
- // Returns the TestInfo object for the test that's currently running,
1219
- // or NULL if no test is running.
1220
- const TestInfo* current_test_info() const
1221
- GTEST_LOCK_EXCLUDED_(mutex_);
1222
-
1223
- // Returns the random seed used at the start of the current test run.
1224
- int random_seed() const;
1225
-
1226
- // Returns the ParameterizedTestCaseRegistry object used to keep track of
1227
- // value-parameterized tests and instantiate and register them.
1228
- //
1229
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1230
- internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
1231
- GTEST_LOCK_EXCLUDED_(mutex_);
1232
-
1233
- // Gets the number of successful test cases.
1234
- int successful_test_case_count() const;
1235
-
1236
- // Gets the number of failed test cases.
1237
- int failed_test_case_count() const;
1238
-
1239
- // Gets the number of all test cases.
1240
- int total_test_case_count() const;
1241
-
1242
- // Gets the number of all test cases that contain at least one test
1243
- // that should run.
1244
- int test_case_to_run_count() const;
1245
-
1246
- // Gets the number of successful tests.
1247
- int successful_test_count() const;
1248
-
1249
- // Gets the number of failed tests.
1250
- int failed_test_count() const;
1251
-
1252
- // Gets the number of disabled tests that will be reported in the XML report.
1253
- int reportable_disabled_test_count() const;
1254
-
1255
- // Gets the number of disabled tests.
1256
- int disabled_test_count() const;
1257
-
1258
- // Gets the number of tests to be printed in the XML report.
1259
- int reportable_test_count() const;
1260
-
1261
- // Gets the number of all tests.
1262
- int total_test_count() const;
1263
-
1264
- // Gets the number of tests that should run.
1265
- int test_to_run_count() const;
1266
-
1267
- // Gets the time of the test program start, in ms from the start of the
1268
- // UNIX epoch.
1269
- TimeInMillis start_timestamp() const;
1270
-
1271
- // Gets the elapsed time, in milliseconds.
1272
- TimeInMillis elapsed_time() const;
1273
-
1274
- // Returns true iff the unit test passed (i.e. all test cases passed).
1275
- bool Passed() const;
1276
-
1277
- // Returns true iff the unit test failed (i.e. some test case failed
1278
- // or something outside of all tests failed).
1279
- bool Failed() const;
1280
-
1281
- // Gets the i-th test case among all the test cases. i can range from 0 to
1282
- // total_test_case_count() - 1. If i is not in that range, returns NULL.
1283
- const TestCase* GetTestCase(int i) const;
1284
-
1285
- // Returns the TestResult containing information on test failures and
1286
- // properties logged outside of individual test cases.
1287
- const TestResult& ad_hoc_test_result() const;
1288
-
1289
- // Returns the list of event listeners that can be used to track events
1290
- // inside Google Test.
1291
- TestEventListeners& listeners();
1292
-
1293
- private:
1294
- // Registers and returns a global test environment. When a test
1295
- // program is run, all global test environments will be set-up in
1296
- // the order they were registered. After all tests in the program
1297
- // have finished, all global test environments will be torn-down in
1298
- // the *reverse* order they were registered.
1299
- //
1300
- // The UnitTest object takes ownership of the given environment.
1301
- //
1302
- // This method can only be called from the main thread.
1303
- Environment* AddEnvironment(Environment* env);
1304
-
1305
- // Adds a TestPartResult to the current TestResult object. All
1306
- // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
1307
- // eventually call this to report their results. The user code
1308
- // should use the assertion macros instead of calling this directly.
1309
- void AddTestPartResult(TestPartResult::Type result_type,
1310
- const char* file_name,
1311
- int line_number,
1312
- const std::string& message,
1313
- const std::string& os_stack_trace)
1314
- GTEST_LOCK_EXCLUDED_(mutex_);
1315
-
1316
- // Adds a TestProperty to the current TestResult object when invoked from
1317
- // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
1318
- // from SetUpTestCase or TearDownTestCase, or to the global property set
1319
- // when invoked elsewhere. If the result already contains a property with
1320
- // the same key, the value will be updated.
1321
- void RecordProperty(const std::string& key, const std::string& value);
1322
-
1323
- // Gets the i-th test case among all the test cases. i can range from 0 to
1324
- // total_test_case_count() - 1. If i is not in that range, returns NULL.
1325
- TestCase* GetMutableTestCase(int i);
1326
-
1327
- // Accessors for the implementation object.
1328
- internal::UnitTestImpl* impl() { return impl_; }
1329
- const internal::UnitTestImpl* impl() const { return impl_; }
1330
-
1331
- // These classes and functions are friends as they need to access private
1332
- // members of UnitTest.
1333
- friend class ScopedTrace;
1334
- friend class Test;
1335
- friend class internal::AssertHelper;
1336
- friend class internal::StreamingListenerTest;
1337
- friend class internal::UnitTestRecordPropertyTestHelper;
1338
- friend Environment* AddGlobalTestEnvironment(Environment* env);
1339
- friend internal::UnitTestImpl* internal::GetUnitTestImpl();
1340
- friend void internal::ReportFailureInUnknownLocation(
1341
- TestPartResult::Type result_type,
1342
- const std::string& message);
1343
-
1344
- // Creates an empty UnitTest.
1345
- UnitTest();
1346
-
1347
- // D'tor
1348
- virtual ~UnitTest();
1349
-
1350
- // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
1351
- // Google Test trace stack.
1352
- void PushGTestTrace(const internal::TraceInfo& trace)
1353
- GTEST_LOCK_EXCLUDED_(mutex_);
1354
-
1355
- // Pops a trace from the per-thread Google Test trace stack.
1356
- void PopGTestTrace()
1357
- GTEST_LOCK_EXCLUDED_(mutex_);
1358
-
1359
- // Protects mutable state in *impl_. This is mutable as some const
1360
- // methods need to lock it too.
1361
- mutable internal::Mutex mutex_;
1362
-
1363
- // Opaque implementation object. This field is never changed once
1364
- // the object is constructed. We don't mark it as const here, as
1365
- // doing so will cause a warning in the constructor of UnitTest.
1366
- // Mutable state in *impl_ is protected by mutex_.
1367
- internal::UnitTestImpl* impl_;
1368
-
1369
- // We disallow copying UnitTest.
1370
- GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
1371
- };
1372
-
1373
- // A convenient wrapper for adding an environment for the test
1374
- // program.
1375
- //
1376
- // You should call this before RUN_ALL_TESTS() is called, probably in
1377
- // main(). If you use gtest_main, you need to call this before main()
1378
- // starts for it to take effect. For example, you can define a global
1379
- // variable like this:
1380
- //
1381
- // testing::Environment* const foo_env =
1382
- // testing::AddGlobalTestEnvironment(new FooEnvironment);
1383
- //
1384
- // However, we strongly recommend you to write your own main() and
1385
- // call AddGlobalTestEnvironment() there, as relying on initialization
1386
- // of global variables makes the code harder to read and may cause
1387
- // problems when you register multiple environments from different
1388
- // translation units and the environments have dependencies among them
1389
- // (remember that the compiler doesn't guarantee the order in which
1390
- // global variables from different translation units are initialized).
1391
- inline Environment* AddGlobalTestEnvironment(Environment* env) {
1392
- return UnitTest::GetInstance()->AddEnvironment(env);
1393
- }
1394
-
1395
- // Initializes Google Test. This must be called before calling
1396
- // RUN_ALL_TESTS(). In particular, it parses a command line for the
1397
- // flags that Google Test recognizes. Whenever a Google Test flag is
1398
- // seen, it is removed from argv, and *argc is decremented.
1399
- //
1400
- // No value is returned. Instead, the Google Test flag variables are
1401
- // updated.
1402
- //
1403
- // Calling the function for the second time has no user-visible effect.
1404
- GTEST_API_ void InitGoogleTest(int* argc, char** argv);
1405
-
1406
- // This overloaded version can be used in Windows programs compiled in
1407
- // UNICODE mode.
1408
- GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
1409
-
1410
- namespace internal {
1411
-
1412
- // Separate the error generating code from the code path to reduce the stack
1413
- // frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers
1414
- // when calling EXPECT_* in a tight loop.
1415
- template <typename T1, typename T2>
1416
- AssertionResult CmpHelperEQFailure(const char* lhs_expression,
1417
- const char* rhs_expression,
1418
- const T1& lhs, const T2& rhs) {
1419
- return EqFailure(lhs_expression,
1420
- rhs_expression,
1421
- FormatForComparisonFailureMessage(lhs, rhs),
1422
- FormatForComparisonFailureMessage(rhs, lhs),
1423
- false);
1424
- }
1425
-
1426
- // The helper function for {ASSERT|EXPECT}_EQ.
1427
- template <typename T1, typename T2>
1428
- AssertionResult CmpHelperEQ(const char* lhs_expression,
1429
- const char* rhs_expression,
1430
- const T1& lhs,
1431
- const T2& rhs) {
1432
- if (lhs == rhs) {
1433
- return AssertionSuccess();
1434
- }
1435
-
1436
- return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);
1437
- }
1438
-
1439
- // With this overloaded version, we allow anonymous enums to be used
1440
- // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
1441
- // can be implicitly cast to BiggestInt.
1442
- GTEST_API_ AssertionResult CmpHelperEQ(const char* lhs_expression,
1443
- const char* rhs_expression,
1444
- BiggestInt lhs,
1445
- BiggestInt rhs);
1446
-
1447
- // The helper class for {ASSERT|EXPECT}_EQ. The template argument
1448
- // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
1449
- // is a null pointer literal. The following default implementation is
1450
- // for lhs_is_null_literal being false.
1451
- template <bool lhs_is_null_literal>
1452
- class EqHelper {
1453
- public:
1454
- // This templatized version is for the general case.
1455
- template <typename T1, typename T2>
1456
- static AssertionResult Compare(const char* lhs_expression,
1457
- const char* rhs_expression,
1458
- const T1& lhs,
1459
- const T2& rhs) {
1460
- return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
1461
- }
1462
-
1463
- // With this overloaded version, we allow anonymous enums to be used
1464
- // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
1465
- // enums can be implicitly cast to BiggestInt.
1466
- //
1467
- // Even though its body looks the same as the above version, we
1468
- // cannot merge the two, as it will make anonymous enums unhappy.
1469
- static AssertionResult Compare(const char* lhs_expression,
1470
- const char* rhs_expression,
1471
- BiggestInt lhs,
1472
- BiggestInt rhs) {
1473
- return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
1474
- }
1475
- };
1476
-
1477
- // This specialization is used when the first argument to ASSERT_EQ()
1478
- // is a null pointer literal, like NULL, false, or 0.
1479
- template <>
1480
- class EqHelper<true> {
1481
- public:
1482
- // We define two overloaded versions of Compare(). The first
1483
- // version will be picked when the second argument to ASSERT_EQ() is
1484
- // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
1485
- // EXPECT_EQ(false, a_bool).
1486
- template <typename T1, typename T2>
1487
- static AssertionResult Compare(
1488
- const char* lhs_expression,
1489
- const char* rhs_expression,
1490
- const T1& lhs,
1491
- const T2& rhs,
1492
- // The following line prevents this overload from being considered if T2
1493
- // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
1494
- // expands to Compare("", "", NULL, my_ptr), which requires a conversion
1495
- // to match the Secret* in the other overload, which would otherwise make
1496
- // this template match better.
1497
- typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
1498
- return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
1499
- }
1500
-
1501
- // This version will be picked when the second argument to ASSERT_EQ() is a
1502
- // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
1503
- template <typename T>
1504
- static AssertionResult Compare(
1505
- const char* lhs_expression,
1506
- const char* rhs_expression,
1507
- // We used to have a second template parameter instead of Secret*. That
1508
- // template parameter would deduce to 'long', making this a better match
1509
- // than the first overload even without the first overload's EnableIf.
1510
- // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
1511
- // non-pointer argument" (even a deduced integral argument), so the old
1512
- // implementation caused warnings in user code.
1513
- Secret* /* lhs (NULL) */,
1514
- T* rhs) {
1515
- // We already know that 'lhs' is a null pointer.
1516
- return CmpHelperEQ(lhs_expression, rhs_expression,
1517
- static_cast<T*>(NULL), rhs);
1518
- }
1519
- };
1520
-
1521
- // Separate the error generating code from the code path to reduce the stack
1522
- // frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers
1523
- // when calling EXPECT_OP in a tight loop.
1524
- template <typename T1, typename T2>
1525
- AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
1526
- const T1& val1, const T2& val2,
1527
- const char* op) {
1528
- return AssertionFailure()
1529
- << "Expected: (" << expr1 << ") " << op << " (" << expr2
1530
- << "), actual: " << FormatForComparisonFailureMessage(val1, val2)
1531
- << " vs " << FormatForComparisonFailureMessage(val2, val1);
1532
- }
1533
-
1534
- // A macro for implementing the helper functions needed to implement
1535
- // ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
1536
- // of similar code.
1537
- //
1538
- // For each templatized helper function, we also define an overloaded
1539
- // version for BiggestInt in order to reduce code bloat and allow
1540
- // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
1541
- // with gcc 4.
1542
- //
1543
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1544
-
1545
- #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
1546
- template <typename T1, typename T2>\
1547
- AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
1548
- const T1& val1, const T2& val2) {\
1549
- if (val1 op val2) {\
1550
- return AssertionSuccess();\
1551
- } else {\
1552
- return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
1553
- }\
1554
- }\
1555
- GTEST_API_ AssertionResult CmpHelper##op_name(\
1556
- const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
1557
-
1558
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1559
-
1560
- // Implements the helper function for {ASSERT|EXPECT}_NE
1561
- GTEST_IMPL_CMP_HELPER_(NE, !=);
1562
- // Implements the helper function for {ASSERT|EXPECT}_LE
1563
- GTEST_IMPL_CMP_HELPER_(LE, <=);
1564
- // Implements the helper function for {ASSERT|EXPECT}_LT
1565
- GTEST_IMPL_CMP_HELPER_(LT, <);
1566
- // Implements the helper function for {ASSERT|EXPECT}_GE
1567
- GTEST_IMPL_CMP_HELPER_(GE, >=);
1568
- // Implements the helper function for {ASSERT|EXPECT}_GT
1569
- GTEST_IMPL_CMP_HELPER_(GT, >);
1570
-
1571
- #undef GTEST_IMPL_CMP_HELPER_
1572
-
1573
- // The helper function for {ASSERT|EXPECT}_STREQ.
1574
- //
1575
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1576
- GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
1577
- const char* s2_expression,
1578
- const char* s1,
1579
- const char* s2);
1580
-
1581
- // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
1582
- //
1583
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1584
- GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression,
1585
- const char* s2_expression,
1586
- const char* s1,
1587
- const char* s2);
1588
-
1589
- // The helper function for {ASSERT|EXPECT}_STRNE.
1590
- //
1591
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1592
- GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
1593
- const char* s2_expression,
1594
- const char* s1,
1595
- const char* s2);
1596
-
1597
- // The helper function for {ASSERT|EXPECT}_STRCASENE.
1598
- //
1599
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1600
- GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
1601
- const char* s2_expression,
1602
- const char* s1,
1603
- const char* s2);
1604
-
1605
-
1606
- // Helper function for *_STREQ on wide strings.
1607
- //
1608
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1609
- GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
1610
- const char* s2_expression,
1611
- const wchar_t* s1,
1612
- const wchar_t* s2);
1613
-
1614
- // Helper function for *_STRNE on wide strings.
1615
- //
1616
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1617
- GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
1618
- const char* s2_expression,
1619
- const wchar_t* s1,
1620
- const wchar_t* s2);
1621
-
1622
- } // namespace internal
1623
-
1624
- // IsSubstring() and IsNotSubstring() are intended to be used as the
1625
- // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
1626
- // themselves. They check whether needle is a substring of haystack
1627
- // (NULL is considered a substring of itself only), and return an
1628
- // appropriate error message when they fail.
1629
- //
1630
- // The {needle,haystack}_expr arguments are the stringified
1631
- // expressions that generated the two real arguments.
1632
- GTEST_API_ AssertionResult IsSubstring(
1633
- const char* needle_expr, const char* haystack_expr,
1634
- const char* needle, const char* haystack);
1635
- GTEST_API_ AssertionResult IsSubstring(
1636
- const char* needle_expr, const char* haystack_expr,
1637
- const wchar_t* needle, const wchar_t* haystack);
1638
- GTEST_API_ AssertionResult IsNotSubstring(
1639
- const char* needle_expr, const char* haystack_expr,
1640
- const char* needle, const char* haystack);
1641
- GTEST_API_ AssertionResult IsNotSubstring(
1642
- const char* needle_expr, const char* haystack_expr,
1643
- const wchar_t* needle, const wchar_t* haystack);
1644
- GTEST_API_ AssertionResult IsSubstring(
1645
- const char* needle_expr, const char* haystack_expr,
1646
- const ::std::string& needle, const ::std::string& haystack);
1647
- GTEST_API_ AssertionResult IsNotSubstring(
1648
- const char* needle_expr, const char* haystack_expr,
1649
- const ::std::string& needle, const ::std::string& haystack);
1650
-
1651
- #if GTEST_HAS_STD_WSTRING
1652
- GTEST_API_ AssertionResult IsSubstring(
1653
- const char* needle_expr, const char* haystack_expr,
1654
- const ::std::wstring& needle, const ::std::wstring& haystack);
1655
- GTEST_API_ AssertionResult IsNotSubstring(
1656
- const char* needle_expr, const char* haystack_expr,
1657
- const ::std::wstring& needle, const ::std::wstring& haystack);
1658
- #endif // GTEST_HAS_STD_WSTRING
1659
-
1660
- namespace internal {
1661
-
1662
- // Helper template function for comparing floating-points.
1663
- //
1664
- // Template parameter:
1665
- //
1666
- // RawType: the raw floating-point type (either float or double)
1667
- //
1668
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1669
- template <typename RawType>
1670
- AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
1671
- const char* rhs_expression,
1672
- RawType lhs_value,
1673
- RawType rhs_value) {
1674
- const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value);
1675
-
1676
- if (lhs.AlmostEquals(rhs)) {
1677
- return AssertionSuccess();
1678
- }
1679
-
1680
- ::std::stringstream lhs_ss;
1681
- lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1682
- << lhs_value;
1683
-
1684
- ::std::stringstream rhs_ss;
1685
- rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1686
- << rhs_value;
1687
-
1688
- return EqFailure(lhs_expression,
1689
- rhs_expression,
1690
- StringStreamToString(&lhs_ss),
1691
- StringStreamToString(&rhs_ss),
1692
- false);
1693
- }
1694
-
1695
- // Helper function for implementing ASSERT_NEAR.
1696
- //
1697
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
1698
- GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
1699
- const char* expr2,
1700
- const char* abs_error_expr,
1701
- double val1,
1702
- double val2,
1703
- double abs_error);
1704
-
1705
- // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
1706
- // A class that enables one to stream messages to assertion macros
1707
- class GTEST_API_ AssertHelper {
1708
- public:
1709
- // Constructor.
1710
- AssertHelper(TestPartResult::Type type,
1711
- const char* file,
1712
- int line,
1713
- const char* message);
1714
- ~AssertHelper();
1715
-
1716
- // Message assignment is a semantic trick to enable assertion
1717
- // streaming; see the GTEST_MESSAGE_ macro below.
1718
- void operator=(const Message& message) const;
1719
-
1720
- private:
1721
- // We put our data in a struct so that the size of the AssertHelper class can
1722
- // be as small as possible. This is important because gcc is incapable of
1723
- // re-using stack space even for temporary variables, so every EXPECT_EQ
1724
- // reserves stack space for another AssertHelper.
1725
- struct AssertHelperData {
1726
- AssertHelperData(TestPartResult::Type t,
1727
- const char* srcfile,
1728
- int line_num,
1729
- const char* msg)
1730
- : type(t), file(srcfile), line(line_num), message(msg) { }
1731
-
1732
- TestPartResult::Type const type;
1733
- const char* const file;
1734
- int const line;
1735
- std::string const message;
1736
-
1737
- private:
1738
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
1739
- };
1740
-
1741
- AssertHelperData* const data_;
1742
-
1743
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
1744
- };
1745
-
1746
- } // namespace internal
1747
-
1748
- // The pure interface class that all value-parameterized tests inherit from.
1749
- // A value-parameterized class must inherit from both ::testing::Test and
1750
- // ::testing::WithParamInterface. In most cases that just means inheriting
1751
- // from ::testing::TestWithParam, but more complicated test hierarchies
1752
- // may need to inherit from Test and WithParamInterface at different levels.
1753
- //
1754
- // This interface has support for accessing the test parameter value via
1755
- // the GetParam() method.
1756
- //
1757
- // Use it with one of the parameter generator defining functions, like Range(),
1758
- // Values(), ValuesIn(), Bool(), and Combine().
1759
- //
1760
- // class FooTest : public ::testing::TestWithParam<int> {
1761
- // protected:
1762
- // FooTest() {
1763
- // // Can use GetParam() here.
1764
- // }
1765
- // virtual ~FooTest() {
1766
- // // Can use GetParam() here.
1767
- // }
1768
- // virtual void SetUp() {
1769
- // // Can use GetParam() here.
1770
- // }
1771
- // virtual void TearDown {
1772
- // // Can use GetParam() here.
1773
- // }
1774
- // };
1775
- // TEST_P(FooTest, DoesBar) {
1776
- // // Can use GetParam() method here.
1777
- // Foo foo;
1778
- // ASSERT_TRUE(foo.DoesBar(GetParam()));
1779
- // }
1780
- // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
1781
-
1782
- template <typename T>
1783
- class WithParamInterface {
1784
- public:
1785
- typedef T ParamType;
1786
- virtual ~WithParamInterface() {}
1787
-
1788
- // The current parameter value. Is also available in the test fixture's
1789
- // constructor. This member function is non-static, even though it only
1790
- // references static data, to reduce the opportunity for incorrect uses
1791
- // like writing 'WithParamInterface<bool>::GetParam()' for a test that
1792
- // uses a fixture whose parameter type is int.
1793
- const ParamType& GetParam() const {
1794
- GTEST_CHECK_(parameter_ != NULL)
1795
- << "GetParam() can only be called inside a value-parameterized test "
1796
- << "-- did you intend to write TEST_P instead of TEST_F?";
1797
- return *parameter_;
1798
- }
1799
-
1800
- private:
1801
- // Sets parameter value. The caller is responsible for making sure the value
1802
- // remains alive and unchanged throughout the current test.
1803
- static void SetParam(const ParamType* parameter) {
1804
- parameter_ = parameter;
1805
- }
1806
-
1807
- // Static value used for accessing parameter during a test lifetime.
1808
- static const ParamType* parameter_;
1809
-
1810
- // TestClass must be a subclass of WithParamInterface<T> and Test.
1811
- template <class TestClass> friend class internal::ParameterizedTestFactory;
1812
- };
1813
-
1814
- template <typename T>
1815
- const T* WithParamInterface<T>::parameter_ = NULL;
1816
-
1817
- // Most value-parameterized classes can ignore the existence of
1818
- // WithParamInterface, and can just inherit from ::testing::TestWithParam.
1819
-
1820
- template <typename T>
1821
- class TestWithParam : public Test, public WithParamInterface<T> {
1822
- };
1823
-
1824
- // Macros for indicating success/failure in test code.
1825
-
1826
- // ADD_FAILURE unconditionally adds a failure to the current test.
1827
- // SUCCEED generates a success - it doesn't automatically make the
1828
- // current test successful, as a test is only successful when it has
1829
- // no failure.
1830
- //
1831
- // EXPECT_* verifies that a certain condition is satisfied. If not,
1832
- // it behaves like ADD_FAILURE. In particular:
1833
- //
1834
- // EXPECT_TRUE verifies that a Boolean condition is true.
1835
- // EXPECT_FALSE verifies that a Boolean condition is false.
1836
- //
1837
- // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
1838
- // that they will also abort the current function on failure. People
1839
- // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
1840
- // writing data-driven tests often find themselves using ADD_FAILURE
1841
- // and EXPECT_* more.
1842
-
1843
- // Generates a nonfatal failure with a generic message.
1844
- #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
1845
-
1846
- // Generates a nonfatal failure at the given source file location with
1847
- // a generic message.
1848
- #define ADD_FAILURE_AT(file, line) \
1849
- GTEST_MESSAGE_AT_(file, line, "Failed", \
1850
- ::testing::TestPartResult::kNonFatalFailure)
1851
-
1852
- // Generates a fatal failure with a generic message.
1853
- #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
1854
-
1855
- // Define this macro to 1 to omit the definition of FAIL(), which is a
1856
- // generic name and clashes with some other libraries.
1857
- #if !GTEST_DONT_DEFINE_FAIL
1858
- # define FAIL() GTEST_FAIL()
1859
- #endif
1860
-
1861
- // Generates a success with a generic message.
1862
- #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
1863
-
1864
- // Define this macro to 1 to omit the definition of SUCCEED(), which
1865
- // is a generic name and clashes with some other libraries.
1866
- #if !GTEST_DONT_DEFINE_SUCCEED
1867
- # define SUCCEED() GTEST_SUCCEED()
1868
- #endif
1869
-
1870
- // Macros for testing exceptions.
1871
- //
1872
- // * {ASSERT|EXPECT}_THROW(statement, expected_exception):
1873
- // Tests that the statement throws the expected exception.
1874
- // * {ASSERT|EXPECT}_NO_THROW(statement):
1875
- // Tests that the statement doesn't throw any exception.
1876
- // * {ASSERT|EXPECT}_ANY_THROW(statement):
1877
- // Tests that the statement throws an exception.
1878
-
1879
- #define EXPECT_THROW(statement, expected_exception) \
1880
- GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
1881
- #define EXPECT_NO_THROW(statement) \
1882
- GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
1883
- #define EXPECT_ANY_THROW(statement) \
1884
- GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
1885
- #define ASSERT_THROW(statement, expected_exception) \
1886
- GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
1887
- #define ASSERT_NO_THROW(statement) \
1888
- GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
1889
- #define ASSERT_ANY_THROW(statement) \
1890
- GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
1891
-
1892
- // Boolean assertions. Condition can be either a Boolean expression or an
1893
- // AssertionResult. For more information on how to use AssertionResult with
1894
- // these macros see comments on that class.
1895
- #define EXPECT_TRUE(condition) \
1896
- GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
1897
- GTEST_NONFATAL_FAILURE_)
1898
- #define EXPECT_FALSE(condition) \
1899
- GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
1900
- GTEST_NONFATAL_FAILURE_)
1901
- #define ASSERT_TRUE(condition) \
1902
- GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
1903
- GTEST_FATAL_FAILURE_)
1904
- #define ASSERT_FALSE(condition) \
1905
- GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
1906
- GTEST_FATAL_FAILURE_)
1907
-
1908
- // Macros for testing equalities and inequalities.
1909
- //
1910
- // * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
1911
- // * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
1912
- // * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
1913
- // * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
1914
- // * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
1915
- // * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
1916
- //
1917
- // When they are not, Google Test prints both the tested expressions and
1918
- // their actual values. The values must be compatible built-in types,
1919
- // or you will get a compiler error. By "compatible" we mean that the
1920
- // values can be compared by the respective operator.
1921
- //
1922
- // Note:
1923
- //
1924
- // 1. It is possible to make a user-defined type work with
1925
- // {ASSERT|EXPECT}_??(), but that requires overloading the
1926
- // comparison operators and is thus discouraged by the Google C++
1927
- // Usage Guide. Therefore, you are advised to use the
1928
- // {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
1929
- // equal.
1930
- //
1931
- // 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
1932
- // pointers (in particular, C strings). Therefore, if you use it
1933
- // with two C strings, you are testing how their locations in memory
1934
- // are related, not how their content is related. To compare two C
1935
- // strings by content, use {ASSERT|EXPECT}_STR*().
1936
- //
1937
- // 3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to
1938
- // {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you
1939
- // what the actual value is when it fails, and similarly for the
1940
- // other comparisons.
1941
- //
1942
- // 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
1943
- // evaluate their arguments, which is undefined.
1944
- //
1945
- // 5. These macros evaluate their arguments exactly once.
1946
- //
1947
- // Examples:
1948
- //
1949
- // EXPECT_NE(Foo(), 5);
1950
- // EXPECT_EQ(a_pointer, NULL);
1951
- // ASSERT_LT(i, array_size);
1952
- // ASSERT_GT(records.size(), 0) << "There is no record left.";
1953
-
1954
- #define EXPECT_EQ(val1, val2) \
1955
- EXPECT_PRED_FORMAT2(::testing::internal:: \
1956
- EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
1957
- val1, val2)
1958
- #define EXPECT_NE(val1, val2) \
1959
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
1960
- #define EXPECT_LE(val1, val2) \
1961
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
1962
- #define EXPECT_LT(val1, val2) \
1963
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
1964
- #define EXPECT_GE(val1, val2) \
1965
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
1966
- #define EXPECT_GT(val1, val2) \
1967
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
1968
-
1969
- #define GTEST_ASSERT_EQ(val1, val2) \
1970
- ASSERT_PRED_FORMAT2(::testing::internal:: \
1971
- EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
1972
- val1, val2)
1973
- #define GTEST_ASSERT_NE(val1, val2) \
1974
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
1975
- #define GTEST_ASSERT_LE(val1, val2) \
1976
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
1977
- #define GTEST_ASSERT_LT(val1, val2) \
1978
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
1979
- #define GTEST_ASSERT_GE(val1, val2) \
1980
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
1981
- #define GTEST_ASSERT_GT(val1, val2) \
1982
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
1983
-
1984
- // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
1985
- // ASSERT_XY(), which clashes with some users' own code.
1986
-
1987
- #if !GTEST_DONT_DEFINE_ASSERT_EQ
1988
- # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
1989
- #endif
1990
-
1991
- #if !GTEST_DONT_DEFINE_ASSERT_NE
1992
- # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
1993
- #endif
1994
-
1995
- #if !GTEST_DONT_DEFINE_ASSERT_LE
1996
- # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
1997
- #endif
1998
-
1999
- #if !GTEST_DONT_DEFINE_ASSERT_LT
2000
- # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
2001
- #endif
2002
-
2003
- #if !GTEST_DONT_DEFINE_ASSERT_GE
2004
- # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
2005
- #endif
2006
-
2007
- #if !GTEST_DONT_DEFINE_ASSERT_GT
2008
- # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
2009
- #endif
2010
-
2011
- // C-string Comparisons. All tests treat NULL and any non-NULL string
2012
- // as different. Two NULLs are equal.
2013
- //
2014
- // * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
2015
- // * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
2016
- // * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
2017
- // * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
2018
- //
2019
- // For wide or narrow string objects, you can use the
2020
- // {ASSERT|EXPECT}_??() macros.
2021
- //
2022
- // Don't depend on the order in which the arguments are evaluated,
2023
- // which is undefined.
2024
- //
2025
- // These macros evaluate their arguments exactly once.
2026
-
2027
- #define EXPECT_STREQ(s1, s2) \
2028
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
2029
- #define EXPECT_STRNE(s1, s2) \
2030
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
2031
- #define EXPECT_STRCASEEQ(s1, s2) \
2032
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
2033
- #define EXPECT_STRCASENE(s1, s2)\
2034
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
2035
-
2036
- #define ASSERT_STREQ(s1, s2) \
2037
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
2038
- #define ASSERT_STRNE(s1, s2) \
2039
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
2040
- #define ASSERT_STRCASEEQ(s1, s2) \
2041
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
2042
- #define ASSERT_STRCASENE(s1, s2)\
2043
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
2044
-
2045
- // Macros for comparing floating-point numbers.
2046
- //
2047
- // * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2):
2048
- // Tests that two float values are almost equal.
2049
- // * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2):
2050
- // Tests that two double values are almost equal.
2051
- // * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
2052
- // Tests that v1 and v2 are within the given distance to each other.
2053
- //
2054
- // Google Test uses ULP-based comparison to automatically pick a default
2055
- // error bound that is appropriate for the operands. See the
2056
- // FloatingPoint template class in gtest-internal.h if you are
2057
- // interested in the implementation details.
2058
-
2059
- #define EXPECT_FLOAT_EQ(val1, val2)\
2060
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
2061
- val1, val2)
2062
-
2063
- #define EXPECT_DOUBLE_EQ(val1, val2)\
2064
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
2065
- val1, val2)
2066
-
2067
- #define ASSERT_FLOAT_EQ(val1, val2)\
2068
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
2069
- val1, val2)
2070
-
2071
- #define ASSERT_DOUBLE_EQ(val1, val2)\
2072
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
2073
- val1, val2)
2074
-
2075
- #define EXPECT_NEAR(val1, val2, abs_error)\
2076
- EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
2077
- val1, val2, abs_error)
2078
-
2079
- #define ASSERT_NEAR(val1, val2, abs_error)\
2080
- ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
2081
- val1, val2, abs_error)
2082
-
2083
- // These predicate format functions work on floating-point values, and
2084
- // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
2085
- //
2086
- // EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
2087
-
2088
- // Asserts that val1 is less than, or almost equal to, val2. Fails
2089
- // otherwise. In particular, it fails if either val1 or val2 is NaN.
2090
- GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
2091
- float val1, float val2);
2092
- GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
2093
- double val1, double val2);
2094
-
2095
-
2096
- #if GTEST_OS_WINDOWS
2097
-
2098
- // Macros that test for HRESULT failure and success, these are only useful
2099
- // on Windows, and rely on Windows SDK macros and APIs to compile.
2100
- //
2101
- // * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
2102
- //
2103
- // When expr unexpectedly fails or succeeds, Google Test prints the
2104
- // expected result and the actual result with both a human-readable
2105
- // string representation of the error, if available, as well as the
2106
- // hex result code.
2107
- # define EXPECT_HRESULT_SUCCEEDED(expr) \
2108
- EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
2109
-
2110
- # define ASSERT_HRESULT_SUCCEEDED(expr) \
2111
- ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
2112
-
2113
- # define EXPECT_HRESULT_FAILED(expr) \
2114
- EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
2115
-
2116
- # define ASSERT_HRESULT_FAILED(expr) \
2117
- ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
2118
-
2119
- #endif // GTEST_OS_WINDOWS
2120
-
2121
- // Macros that execute statement and check that it doesn't generate new fatal
2122
- // failures in the current thread.
2123
- //
2124
- // * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
2125
- //
2126
- // Examples:
2127
- //
2128
- // EXPECT_NO_FATAL_FAILURE(Process());
2129
- // ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
2130
- //
2131
- #define ASSERT_NO_FATAL_FAILURE(statement) \
2132
- GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
2133
- #define EXPECT_NO_FATAL_FAILURE(statement) \
2134
- GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
2135
-
2136
- // Causes a trace (including the given source file path and line number,
2137
- // and the given message) to be included in every test failure message generated
2138
- // by code in the scope of the lifetime of an instance of this class. The effect
2139
- // is undone with the destruction of the instance.
2140
- //
2141
- // The message argument can be anything streamable to std::ostream.
2142
- //
2143
- // Example:
2144
- // testing::ScopedTrace trace("file.cc", 123, "message");
2145
- //
2146
- class GTEST_API_ ScopedTrace {
2147
- public:
2148
- // The c'tor pushes the given source file location and message onto
2149
- // a trace stack maintained by Google Test.
2150
-
2151
- // Template version. Uses Message() to convert the values into strings.
2152
- // Slow, but flexible.
2153
- template <typename T>
2154
- ScopedTrace(const char* file, int line, const T& message) {
2155
- PushTrace(file, line, (Message() << message).GetString());
2156
- }
2157
-
2158
- // Optimize for some known types.
2159
- ScopedTrace(const char* file, int line, const char* message) {
2160
- PushTrace(file, line, message ? message : "(null)");
2161
- }
2162
-
2163
- #if GTEST_HAS_GLOBAL_STRING
2164
- ScopedTrace(const char* file, int line, const ::string& message) {
2165
- PushTrace(file, line, message);
2166
- }
2167
- #endif
2168
-
2169
- ScopedTrace(const char* file, int line, const std::string& message) {
2170
- PushTrace(file, line, message);
2171
- }
2172
-
2173
- // The d'tor pops the info pushed by the c'tor.
2174
- //
2175
- // Note that the d'tor is not virtual in order to be efficient.
2176
- // Don't inherit from ScopedTrace!
2177
- ~ScopedTrace();
2178
-
2179
- private:
2180
- void PushTrace(const char* file, int line, std::string message);
2181
-
2182
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
2183
- } GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
2184
- // c'tor and d'tor. Therefore it doesn't
2185
- // need to be used otherwise.
2186
-
2187
- // Causes a trace (including the source file path, the current line
2188
- // number, and the given message) to be included in every test failure
2189
- // message generated by code in the current scope. The effect is
2190
- // undone when the control leaves the current scope.
2191
- //
2192
- // The message argument can be anything streamable to std::ostream.
2193
- //
2194
- // In the implementation, we include the current line number as part
2195
- // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
2196
- // to appear in the same block - as long as they are on different
2197
- // lines.
2198
- //
2199
- // Assuming that each thread maintains its own stack of traces.
2200
- // Therefore, a SCOPED_TRACE() would (correctly) only affect the
2201
- // assertions in its own thread.
2202
- #define SCOPED_TRACE(message) \
2203
- ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
2204
- __FILE__, __LINE__, (message))
2205
-
2206
-
2207
- // Compile-time assertion for type equality.
2208
- // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
2209
- // the same type. The value it returns is not interesting.
2210
- //
2211
- // Instead of making StaticAssertTypeEq a class template, we make it a
2212
- // function template that invokes a helper class template. This
2213
- // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
2214
- // defining objects of that type.
2215
- //
2216
- // CAVEAT:
2217
- //
2218
- // When used inside a method of a class template,
2219
- // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
2220
- // instantiated. For example, given:
2221
- //
2222
- // template <typename T> class Foo {
2223
- // public:
2224
- // void Bar() { testing::StaticAssertTypeEq<int, T>(); }
2225
- // };
2226
- //
2227
- // the code:
2228
- //
2229
- // void Test1() { Foo<bool> foo; }
2230
- //
2231
- // will NOT generate a compiler error, as Foo<bool>::Bar() is never
2232
- // actually instantiated. Instead, you need:
2233
- //
2234
- // void Test2() { Foo<bool> foo; foo.Bar(); }
2235
- //
2236
- // to cause a compiler error.
2237
- template <typename T1, typename T2>
2238
- bool StaticAssertTypeEq() {
2239
- (void)internal::StaticAssertTypeEqHelper<T1, T2>();
2240
- return true;
2241
- }
2242
-
2243
- // Defines a test.
2244
- //
2245
- // The first parameter is the name of the test case, and the second
2246
- // parameter is the name of the test within the test case.
2247
- //
2248
- // The convention is to end the test case name with "Test". For
2249
- // example, a test case for the Foo class can be named FooTest.
2250
- //
2251
- // Test code should appear between braces after an invocation of
2252
- // this macro. Example:
2253
- //
2254
- // TEST(FooTest, InitializesCorrectly) {
2255
- // Foo foo;
2256
- // EXPECT_TRUE(foo.StatusIsOK());
2257
- // }
2258
-
2259
- // Note that we call GetTestTypeId() instead of GetTypeId<
2260
- // ::testing::Test>() here to get the type ID of testing::Test. This
2261
- // is to work around a suspected linker bug when using Google Test as
2262
- // a framework on Mac OS X. The bug causes GetTypeId<
2263
- // ::testing::Test>() to return different values depending on whether
2264
- // the call is from the Google Test framework itself or from user test
2265
- // code. GetTestTypeId() is guaranteed to always return the same
2266
- // value, as it always calls GetTypeId<>() from the Google Test
2267
- // framework.
2268
- #define GTEST_TEST(test_case_name, test_name)\
2269
- GTEST_TEST_(test_case_name, test_name, \
2270
- ::testing::Test, ::testing::internal::GetTestTypeId())
2271
-
2272
- // Define this macro to 1 to omit the definition of TEST(), which
2273
- // is a generic name and clashes with some other libraries.
2274
- #if !GTEST_DONT_DEFINE_TEST
2275
- # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
2276
- #endif
2277
-
2278
- // Defines a test that uses a test fixture.
2279
- //
2280
- // The first parameter is the name of the test fixture class, which
2281
- // also doubles as the test case name. The second parameter is the
2282
- // name of the test within the test case.
2283
- //
2284
- // A test fixture class must be declared earlier. The user should put
2285
- // the test code between braces after using this macro. Example:
2286
- //
2287
- // class FooTest : public testing::Test {
2288
- // protected:
2289
- // virtual void SetUp() { b_.AddElement(3); }
2290
- //
2291
- // Foo a_;
2292
- // Foo b_;
2293
- // };
2294
- //
2295
- // TEST_F(FooTest, InitializesCorrectly) {
2296
- // EXPECT_TRUE(a_.StatusIsOK());
2297
- // }
2298
- //
2299
- // TEST_F(FooTest, ReturnsElementCountCorrectly) {
2300
- // EXPECT_EQ(a_.size(), 0);
2301
- // EXPECT_EQ(b_.size(), 1);
2302
- // }
2303
-
2304
- #define TEST_F(test_fixture, test_name)\
2305
- GTEST_TEST_(test_fixture, test_name, test_fixture, \
2306
- ::testing::internal::GetTypeId<test_fixture>())
2307
-
2308
- // Returns a path to temporary directory.
2309
- // Tries to determine an appropriate directory for the platform.
2310
- GTEST_API_ std::string TempDir();
2311
-
2312
- #ifdef _MSC_VER
2313
- # pragma warning(pop)
2314
- #endif
2315
-
2316
- } // namespace testing
2317
-
2318
- // Use this function in main() to run all tests. It returns 0 if all
2319
- // tests are successful, or 1 otherwise.
2320
- //
2321
- // RUN_ALL_TESTS() should be invoked after the command line has been
2322
- // parsed by InitGoogleTest().
2323
- //
2324
- // This function was formerly a macro; thus, it is in the global
2325
- // namespace and has an all-caps name.
2326
- int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
2327
-
2328
- inline int RUN_ALL_TESTS() {
2329
- return ::testing::UnitTest::GetInstance()->Run();
2330
- }
2331
-
2332
- #endif // GTEST_INCLUDE_GTEST_GTEST_H_