@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,1424 +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
- // Tests for death tests.
33
-
34
- #include "gtest/gtest-death-test.h"
35
- #include "gtest/gtest.h"
36
- #include "gtest/internal/gtest-filepath.h"
37
-
38
- using testing::internal::AlwaysFalse;
39
- using testing::internal::AlwaysTrue;
40
-
41
- #if GTEST_HAS_DEATH_TEST
42
-
43
- # if GTEST_OS_WINDOWS
44
- # include <direct.h> // For chdir().
45
- # else
46
- # include <unistd.h>
47
- # include <sys/wait.h> // For waitpid.
48
- # endif // GTEST_OS_WINDOWS
49
-
50
- # include <limits.h>
51
- # include <signal.h>
52
- # include <stdio.h>
53
-
54
- # if GTEST_OS_LINUX
55
- # include <sys/time.h>
56
- # endif // GTEST_OS_LINUX
57
-
58
- # include "gtest/gtest-spi.h"
59
- # include "src/gtest-internal-inl.h"
60
-
61
- namespace posix = ::testing::internal::posix;
62
-
63
- using testing::Message;
64
- using testing::internal::DeathTest;
65
- using testing::internal::DeathTestFactory;
66
- using testing::internal::FilePath;
67
- using testing::internal::GetLastErrnoDescription;
68
- using testing::internal::GetUnitTestImpl;
69
- using testing::internal::InDeathTestChild;
70
- using testing::internal::ParseNaturalNumber;
71
-
72
- namespace testing {
73
- namespace internal {
74
-
75
- // A helper class whose objects replace the death test factory for a
76
- // single UnitTest object during their lifetimes.
77
- class ReplaceDeathTestFactory {
78
- public:
79
- explicit ReplaceDeathTestFactory(DeathTestFactory* new_factory)
80
- : unit_test_impl_(GetUnitTestImpl()) {
81
- old_factory_ = unit_test_impl_->death_test_factory_.release();
82
- unit_test_impl_->death_test_factory_.reset(new_factory);
83
- }
84
-
85
- ~ReplaceDeathTestFactory() {
86
- unit_test_impl_->death_test_factory_.release();
87
- unit_test_impl_->death_test_factory_.reset(old_factory_);
88
- }
89
- private:
90
- // Prevents copying ReplaceDeathTestFactory objects.
91
- ReplaceDeathTestFactory(const ReplaceDeathTestFactory&);
92
- void operator=(const ReplaceDeathTestFactory&);
93
-
94
- UnitTestImpl* unit_test_impl_;
95
- DeathTestFactory* old_factory_;
96
- };
97
-
98
- } // namespace internal
99
- } // namespace testing
100
-
101
- void DieWithMessage(const ::std::string& message) {
102
- fprintf(stderr, "%s", message.c_str());
103
- fflush(stderr); // Make sure the text is printed before the process exits.
104
-
105
- // We call _exit() instead of exit(), as the former is a direct
106
- // system call and thus safer in the presence of threads. exit()
107
- // will invoke user-defined exit-hooks, which may do dangerous
108
- // things that conflict with death tests.
109
- //
110
- // Some compilers can recognize that _exit() never returns and issue the
111
- // 'unreachable code' warning for code following this function, unless
112
- // fooled by a fake condition.
113
- if (AlwaysTrue())
114
- _exit(1);
115
- }
116
-
117
- void DieInside(const ::std::string& function) {
118
- DieWithMessage("death inside " + function + "().");
119
- }
120
-
121
- // Tests that death tests work.
122
-
123
- class TestForDeathTest : public testing::Test {
124
- protected:
125
- TestForDeathTest() : original_dir_(FilePath::GetCurrentDir()) {}
126
-
127
- virtual ~TestForDeathTest() {
128
- posix::ChDir(original_dir_.c_str());
129
- }
130
-
131
- // A static member function that's expected to die.
132
- static void StaticMemberFunction() { DieInside("StaticMemberFunction"); }
133
-
134
- // A method of the test fixture that may die.
135
- void MemberFunction() {
136
- if (should_die_)
137
- DieInside("MemberFunction");
138
- }
139
-
140
- // True iff MemberFunction() should die.
141
- bool should_die_;
142
- const FilePath original_dir_;
143
- };
144
-
145
- // A class with a member function that may die.
146
- class MayDie {
147
- public:
148
- explicit MayDie(bool should_die) : should_die_(should_die) {}
149
-
150
- // A member function that may die.
151
- void MemberFunction() const {
152
- if (should_die_)
153
- DieInside("MayDie::MemberFunction");
154
- }
155
-
156
- private:
157
- // True iff MemberFunction() should die.
158
- bool should_die_;
159
- };
160
-
161
- // A global function that's expected to die.
162
- void GlobalFunction() { DieInside("GlobalFunction"); }
163
-
164
- // A non-void function that's expected to die.
165
- int NonVoidFunction() {
166
- DieInside("NonVoidFunction");
167
- return 1;
168
- }
169
-
170
- // A unary function that may die.
171
- void DieIf(bool should_die) {
172
- if (should_die)
173
- DieInside("DieIf");
174
- }
175
-
176
- // A binary function that may die.
177
- bool DieIfLessThan(int x, int y) {
178
- if (x < y) {
179
- DieInside("DieIfLessThan");
180
- }
181
- return true;
182
- }
183
-
184
- // Tests that ASSERT_DEATH can be used outside a TEST, TEST_F, or test fixture.
185
- void DeathTestSubroutine() {
186
- EXPECT_DEATH(GlobalFunction(), "death.*GlobalFunction");
187
- ASSERT_DEATH(GlobalFunction(), "death.*GlobalFunction");
188
- }
189
-
190
- // Death in dbg, not opt.
191
- int DieInDebugElse12(int* sideeffect) {
192
- if (sideeffect) *sideeffect = 12;
193
-
194
- # ifndef NDEBUG
195
-
196
- DieInside("DieInDebugElse12");
197
-
198
- # endif // NDEBUG
199
-
200
- return 12;
201
- }
202
-
203
- # if GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
204
-
205
- // Tests the ExitedWithCode predicate.
206
- TEST(ExitStatusPredicateTest, ExitedWithCode) {
207
- // On Windows, the process's exit code is the same as its exit status,
208
- // so the predicate just compares the its input with its parameter.
209
- EXPECT_TRUE(testing::ExitedWithCode(0)(0));
210
- EXPECT_TRUE(testing::ExitedWithCode(1)(1));
211
- EXPECT_TRUE(testing::ExitedWithCode(42)(42));
212
- EXPECT_FALSE(testing::ExitedWithCode(0)(1));
213
- EXPECT_FALSE(testing::ExitedWithCode(1)(0));
214
- }
215
-
216
- # else
217
-
218
- // Returns the exit status of a process that calls _exit(2) with a
219
- // given exit code. This is a helper function for the
220
- // ExitStatusPredicateTest test suite.
221
- static int NormalExitStatus(int exit_code) {
222
- pid_t child_pid = fork();
223
- if (child_pid == 0) {
224
- _exit(exit_code);
225
- }
226
- int status;
227
- waitpid(child_pid, &status, 0);
228
- return status;
229
- }
230
-
231
- // Returns the exit status of a process that raises a given signal.
232
- // If the signal does not cause the process to die, then it returns
233
- // instead the exit status of a process that exits normally with exit
234
- // code 1. This is a helper function for the ExitStatusPredicateTest
235
- // test suite.
236
- static int KilledExitStatus(int signum) {
237
- pid_t child_pid = fork();
238
- if (child_pid == 0) {
239
- raise(signum);
240
- _exit(1);
241
- }
242
- int status;
243
- waitpid(child_pid, &status, 0);
244
- return status;
245
- }
246
-
247
- // Tests the ExitedWithCode predicate.
248
- TEST(ExitStatusPredicateTest, ExitedWithCode) {
249
- const int status0 = NormalExitStatus(0);
250
- const int status1 = NormalExitStatus(1);
251
- const int status42 = NormalExitStatus(42);
252
- const testing::ExitedWithCode pred0(0);
253
- const testing::ExitedWithCode pred1(1);
254
- const testing::ExitedWithCode pred42(42);
255
- EXPECT_PRED1(pred0, status0);
256
- EXPECT_PRED1(pred1, status1);
257
- EXPECT_PRED1(pred42, status42);
258
- EXPECT_FALSE(pred0(status1));
259
- EXPECT_FALSE(pred42(status0));
260
- EXPECT_FALSE(pred1(status42));
261
- }
262
-
263
- // Tests the KilledBySignal predicate.
264
- TEST(ExitStatusPredicateTest, KilledBySignal) {
265
- const int status_segv = KilledExitStatus(SIGSEGV);
266
- const int status_kill = KilledExitStatus(SIGKILL);
267
- const testing::KilledBySignal pred_segv(SIGSEGV);
268
- const testing::KilledBySignal pred_kill(SIGKILL);
269
- EXPECT_PRED1(pred_segv, status_segv);
270
- EXPECT_PRED1(pred_kill, status_kill);
271
- EXPECT_FALSE(pred_segv(status_kill));
272
- EXPECT_FALSE(pred_kill(status_segv));
273
- }
274
-
275
- # endif // GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
276
-
277
- // Tests that the death test macros expand to code which may or may not
278
- // be followed by operator<<, and that in either case the complete text
279
- // comprises only a single C++ statement.
280
- TEST_F(TestForDeathTest, SingleStatement) {
281
- if (AlwaysFalse())
282
- // This would fail if executed; this is a compilation test only
283
- ASSERT_DEATH(return, "");
284
-
285
- if (AlwaysTrue())
286
- EXPECT_DEATH(_exit(1), "");
287
- else
288
- // This empty "else" branch is meant to ensure that EXPECT_DEATH
289
- // doesn't expand into an "if" statement without an "else"
290
- ;
291
-
292
- if (AlwaysFalse())
293
- ASSERT_DEATH(return, "") << "did not die";
294
-
295
- if (AlwaysFalse())
296
- ;
297
- else
298
- EXPECT_DEATH(_exit(1), "") << 1 << 2 << 3;
299
- }
300
-
301
- void DieWithEmbeddedNul() {
302
- fprintf(stderr, "Hello%cmy null world.\n", '\0');
303
- fflush(stderr);
304
- _exit(1);
305
- }
306
-
307
- # if GTEST_USES_PCRE
308
-
309
- // Tests that EXPECT_DEATH and ASSERT_DEATH work when the error
310
- // message has a NUL character in it.
311
- TEST_F(TestForDeathTest, EmbeddedNulInMessage) {
312
- EXPECT_DEATH(DieWithEmbeddedNul(), "my null world");
313
- ASSERT_DEATH(DieWithEmbeddedNul(), "my null world");
314
- }
315
-
316
- # endif // GTEST_USES_PCRE
317
-
318
- // Tests that death test macros expand to code which interacts well with switch
319
- // statements.
320
- TEST_F(TestForDeathTest, SwitchStatement) {
321
- // Microsoft compiler usually complains about switch statements without
322
- // case labels. We suppress that warning for this test.
323
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4065)
324
-
325
- switch (0)
326
- default:
327
- ASSERT_DEATH(_exit(1), "") << "exit in default switch handler";
328
-
329
- switch (0)
330
- case 0:
331
- EXPECT_DEATH(_exit(1), "") << "exit in switch case";
332
-
333
- GTEST_DISABLE_MSC_WARNINGS_POP_()
334
- }
335
-
336
- // Tests that a static member function can be used in a "fast" style
337
- // death test.
338
- TEST_F(TestForDeathTest, StaticMemberFunctionFastStyle) {
339
- testing::GTEST_FLAG(death_test_style) = "fast";
340
- ASSERT_DEATH(StaticMemberFunction(), "death.*StaticMember");
341
- }
342
-
343
- // Tests that a method of the test fixture can be used in a "fast"
344
- // style death test.
345
- TEST_F(TestForDeathTest, MemberFunctionFastStyle) {
346
- testing::GTEST_FLAG(death_test_style) = "fast";
347
- should_die_ = true;
348
- EXPECT_DEATH(MemberFunction(), "inside.*MemberFunction");
349
- }
350
-
351
- void ChangeToRootDir() { posix::ChDir(GTEST_PATH_SEP_); }
352
-
353
- // Tests that death tests work even if the current directory has been
354
- // changed.
355
- TEST_F(TestForDeathTest, FastDeathTestInChangedDir) {
356
- testing::GTEST_FLAG(death_test_style) = "fast";
357
-
358
- ChangeToRootDir();
359
- EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
360
-
361
- ChangeToRootDir();
362
- ASSERT_DEATH(_exit(1), "");
363
- }
364
-
365
- # if GTEST_OS_LINUX
366
- void SigprofAction(int, siginfo_t*, void*) { /* no op */ }
367
-
368
- // Sets SIGPROF action and ITIMER_PROF timer (interval: 1ms).
369
- void SetSigprofActionAndTimer() {
370
- struct itimerval timer;
371
- timer.it_interval.tv_sec = 0;
372
- timer.it_interval.tv_usec = 1;
373
- timer.it_value = timer.it_interval;
374
- ASSERT_EQ(0, setitimer(ITIMER_PROF, &timer, NULL));
375
- struct sigaction signal_action;
376
- memset(&signal_action, 0, sizeof(signal_action));
377
- sigemptyset(&signal_action.sa_mask);
378
- signal_action.sa_sigaction = SigprofAction;
379
- signal_action.sa_flags = SA_RESTART | SA_SIGINFO;
380
- ASSERT_EQ(0, sigaction(SIGPROF, &signal_action, NULL));
381
- }
382
-
383
- // Disables ITIMER_PROF timer and ignores SIGPROF signal.
384
- void DisableSigprofActionAndTimer(struct sigaction* old_signal_action) {
385
- struct itimerval timer;
386
- timer.it_interval.tv_sec = 0;
387
- timer.it_interval.tv_usec = 0;
388
- timer.it_value = timer.it_interval;
389
- ASSERT_EQ(0, setitimer(ITIMER_PROF, &timer, NULL));
390
- struct sigaction signal_action;
391
- memset(&signal_action, 0, sizeof(signal_action));
392
- sigemptyset(&signal_action.sa_mask);
393
- signal_action.sa_handler = SIG_IGN;
394
- ASSERT_EQ(0, sigaction(SIGPROF, &signal_action, old_signal_action));
395
- }
396
-
397
- // Tests that death tests work when SIGPROF handler and timer are set.
398
- TEST_F(TestForDeathTest, FastSigprofActionSet) {
399
- testing::GTEST_FLAG(death_test_style) = "fast";
400
- SetSigprofActionAndTimer();
401
- EXPECT_DEATH(_exit(1), "");
402
- struct sigaction old_signal_action;
403
- DisableSigprofActionAndTimer(&old_signal_action);
404
- EXPECT_TRUE(old_signal_action.sa_sigaction == SigprofAction);
405
- }
406
-
407
- TEST_F(TestForDeathTest, ThreadSafeSigprofActionSet) {
408
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
409
- SetSigprofActionAndTimer();
410
- EXPECT_DEATH(_exit(1), "");
411
- struct sigaction old_signal_action;
412
- DisableSigprofActionAndTimer(&old_signal_action);
413
- EXPECT_TRUE(old_signal_action.sa_sigaction == SigprofAction);
414
- }
415
- # endif // GTEST_OS_LINUX
416
-
417
- // Repeats a representative sample of death tests in the "threadsafe" style:
418
-
419
- TEST_F(TestForDeathTest, StaticMemberFunctionThreadsafeStyle) {
420
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
421
- ASSERT_DEATH(StaticMemberFunction(), "death.*StaticMember");
422
- }
423
-
424
- TEST_F(TestForDeathTest, MemberFunctionThreadsafeStyle) {
425
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
426
- should_die_ = true;
427
- EXPECT_DEATH(MemberFunction(), "inside.*MemberFunction");
428
- }
429
-
430
- TEST_F(TestForDeathTest, ThreadsafeDeathTestInLoop) {
431
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
432
-
433
- for (int i = 0; i < 3; ++i)
434
- EXPECT_EXIT(_exit(i), testing::ExitedWithCode(i), "") << ": i = " << i;
435
- }
436
-
437
- TEST_F(TestForDeathTest, ThreadsafeDeathTestInChangedDir) {
438
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
439
-
440
- ChangeToRootDir();
441
- EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
442
-
443
- ChangeToRootDir();
444
- ASSERT_DEATH(_exit(1), "");
445
- }
446
-
447
- TEST_F(TestForDeathTest, MixedStyles) {
448
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
449
- EXPECT_DEATH(_exit(1), "");
450
- testing::GTEST_FLAG(death_test_style) = "fast";
451
- EXPECT_DEATH(_exit(1), "");
452
- }
453
-
454
- # if GTEST_HAS_CLONE && GTEST_HAS_PTHREAD
455
-
456
- namespace {
457
-
458
- bool pthread_flag;
459
-
460
- void SetPthreadFlag() {
461
- pthread_flag = true;
462
- }
463
-
464
- } // namespace
465
-
466
- TEST_F(TestForDeathTest, DoesNotExecuteAtforkHooks) {
467
- if (!testing::GTEST_FLAG(death_test_use_fork)) {
468
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
469
- pthread_flag = false;
470
- ASSERT_EQ(0, pthread_atfork(&SetPthreadFlag, NULL, NULL));
471
- ASSERT_DEATH(_exit(1), "");
472
- ASSERT_FALSE(pthread_flag);
473
- }
474
- }
475
-
476
- # endif // GTEST_HAS_CLONE && GTEST_HAS_PTHREAD
477
-
478
- // Tests that a method of another class can be used in a death test.
479
- TEST_F(TestForDeathTest, MethodOfAnotherClass) {
480
- const MayDie x(true);
481
- ASSERT_DEATH(x.MemberFunction(), "MayDie\\:\\:MemberFunction");
482
- }
483
-
484
- // Tests that a global function can be used in a death test.
485
- TEST_F(TestForDeathTest, GlobalFunction) {
486
- EXPECT_DEATH(GlobalFunction(), "GlobalFunction");
487
- }
488
-
489
- // Tests that any value convertible to an RE works as a second
490
- // argument to EXPECT_DEATH.
491
- TEST_F(TestForDeathTest, AcceptsAnythingConvertibleToRE) {
492
- static const char regex_c_str[] = "GlobalFunction";
493
- EXPECT_DEATH(GlobalFunction(), regex_c_str);
494
-
495
- const testing::internal::RE regex(regex_c_str);
496
- EXPECT_DEATH(GlobalFunction(), regex);
497
-
498
- # if GTEST_HAS_GLOBAL_STRING
499
-
500
- const ::string regex_str(regex_c_str);
501
- EXPECT_DEATH(GlobalFunction(), regex_str);
502
-
503
- # endif // GTEST_HAS_GLOBAL_STRING
504
-
505
- # if !GTEST_USES_PCRE
506
-
507
- const ::std::string regex_std_str(regex_c_str);
508
- EXPECT_DEATH(GlobalFunction(), regex_std_str);
509
-
510
- # endif // !GTEST_USES_PCRE
511
- }
512
-
513
- // Tests that a non-void function can be used in a death test.
514
- TEST_F(TestForDeathTest, NonVoidFunction) {
515
- ASSERT_DEATH(NonVoidFunction(), "NonVoidFunction");
516
- }
517
-
518
- // Tests that functions that take parameter(s) can be used in a death test.
519
- TEST_F(TestForDeathTest, FunctionWithParameter) {
520
- EXPECT_DEATH(DieIf(true), "DieIf\\(\\)");
521
- EXPECT_DEATH(DieIfLessThan(2, 3), "DieIfLessThan");
522
- }
523
-
524
- // Tests that ASSERT_DEATH can be used outside a TEST, TEST_F, or test fixture.
525
- TEST_F(TestForDeathTest, OutsideFixture) {
526
- DeathTestSubroutine();
527
- }
528
-
529
- // Tests that death tests can be done inside a loop.
530
- TEST_F(TestForDeathTest, InsideLoop) {
531
- for (int i = 0; i < 5; i++) {
532
- EXPECT_DEATH(DieIfLessThan(-1, i), "DieIfLessThan") << "where i == " << i;
533
- }
534
- }
535
-
536
- // Tests that a compound statement can be used in a death test.
537
- TEST_F(TestForDeathTest, CompoundStatement) {
538
- EXPECT_DEATH({ // NOLINT
539
- const int x = 2;
540
- const int y = x + 1;
541
- DieIfLessThan(x, y);
542
- },
543
- "DieIfLessThan");
544
- }
545
-
546
- // Tests that code that doesn't die causes a death test to fail.
547
- TEST_F(TestForDeathTest, DoesNotDie) {
548
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(DieIf(false), "DieIf"),
549
- "failed to die");
550
- }
551
-
552
- // Tests that a death test fails when the error message isn't expected.
553
- TEST_F(TestForDeathTest, ErrorMessageMismatch) {
554
- EXPECT_NONFATAL_FAILURE({ // NOLINT
555
- EXPECT_DEATH(DieIf(true), "DieIfLessThan") << "End of death test message.";
556
- }, "died but not with expected error");
557
- }
558
-
559
- // On exit, *aborted will be true iff the EXPECT_DEATH() statement
560
- // aborted the function.
561
- void ExpectDeathTestHelper(bool* aborted) {
562
- *aborted = true;
563
- EXPECT_DEATH(DieIf(false), "DieIf"); // This assertion should fail.
564
- *aborted = false;
565
- }
566
-
567
- // Tests that EXPECT_DEATH doesn't abort the test on failure.
568
- TEST_F(TestForDeathTest, EXPECT_DEATH) {
569
- bool aborted = true;
570
- EXPECT_NONFATAL_FAILURE(ExpectDeathTestHelper(&aborted),
571
- "failed to die");
572
- EXPECT_FALSE(aborted);
573
- }
574
-
575
- // Tests that ASSERT_DEATH does abort the test on failure.
576
- TEST_F(TestForDeathTest, ASSERT_DEATH) {
577
- static bool aborted;
578
- EXPECT_FATAL_FAILURE({ // NOLINT
579
- aborted = true;
580
- ASSERT_DEATH(DieIf(false), "DieIf"); // This assertion should fail.
581
- aborted = false;
582
- }, "failed to die");
583
- EXPECT_TRUE(aborted);
584
- }
585
-
586
- // Tests that EXPECT_DEATH evaluates the arguments exactly once.
587
- TEST_F(TestForDeathTest, SingleEvaluation) {
588
- int x = 3;
589
- EXPECT_DEATH(DieIf((++x) == 4), "DieIf");
590
-
591
- const char* regex = "DieIf";
592
- const char* regex_save = regex;
593
- EXPECT_DEATH(DieIfLessThan(3, 4), regex++);
594
- EXPECT_EQ(regex_save + 1, regex);
595
- }
596
-
597
- // Tests that run-away death tests are reported as failures.
598
- TEST_F(TestForDeathTest, RunawayIsFailure) {
599
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(static_cast<void>(0), "Foo"),
600
- "failed to die.");
601
- }
602
-
603
- // Tests that death tests report executing 'return' in the statement as
604
- // failure.
605
- TEST_F(TestForDeathTest, ReturnIsFailure) {
606
- EXPECT_FATAL_FAILURE(ASSERT_DEATH(return, "Bar"),
607
- "illegal return in test statement.");
608
- }
609
-
610
- // Tests that EXPECT_DEBUG_DEATH works as expected, that is, you can stream a
611
- // message to it, and in debug mode it:
612
- // 1. Asserts on death.
613
- // 2. Has no side effect.
614
- //
615
- // And in opt mode, it:
616
- // 1. Has side effects but does not assert.
617
- TEST_F(TestForDeathTest, TestExpectDebugDeath) {
618
- int sideeffect = 0;
619
-
620
- // Put the regex in a local variable to make sure we don't get an "unused"
621
- // warning in opt mode.
622
- const char* regex = "death.*DieInDebugElse12";
623
-
624
- EXPECT_DEBUG_DEATH(DieInDebugElse12(&sideeffect), regex)
625
- << "Must accept a streamed message";
626
-
627
- # ifdef NDEBUG
628
-
629
- // Checks that the assignment occurs in opt mode (sideeffect).
630
- EXPECT_EQ(12, sideeffect);
631
-
632
- # else
633
-
634
- // Checks that the assignment does not occur in dbg mode (no sideeffect).
635
- EXPECT_EQ(0, sideeffect);
636
-
637
- # endif
638
- }
639
-
640
- // Tests that ASSERT_DEBUG_DEATH works as expected, that is, you can stream a
641
- // message to it, and in debug mode it:
642
- // 1. Asserts on death.
643
- // 2. Has no side effect.
644
- //
645
- // And in opt mode, it:
646
- // 1. Has side effects but does not assert.
647
- TEST_F(TestForDeathTest, TestAssertDebugDeath) {
648
- int sideeffect = 0;
649
-
650
- ASSERT_DEBUG_DEATH(DieInDebugElse12(&sideeffect), "death.*DieInDebugElse12")
651
- << "Must accept a streamed message";
652
-
653
- # ifdef NDEBUG
654
-
655
- // Checks that the assignment occurs in opt mode (sideeffect).
656
- EXPECT_EQ(12, sideeffect);
657
-
658
- # else
659
-
660
- // Checks that the assignment does not occur in dbg mode (no sideeffect).
661
- EXPECT_EQ(0, sideeffect);
662
-
663
- # endif
664
- }
665
-
666
- # ifndef NDEBUG
667
-
668
- void ExpectDebugDeathHelper(bool* aborted) {
669
- *aborted = true;
670
- EXPECT_DEBUG_DEATH(return, "") << "This is expected to fail.";
671
- *aborted = false;
672
- }
673
-
674
- # if GTEST_OS_WINDOWS
675
- TEST(PopUpDeathTest, DoesNotShowPopUpOnAbort) {
676
- printf("This test should be considered failing if it shows "
677
- "any pop-up dialogs.\n");
678
- fflush(stdout);
679
-
680
- EXPECT_DEATH({
681
- testing::GTEST_FLAG(catch_exceptions) = false;
682
- abort();
683
- }, "");
684
- }
685
- # endif // GTEST_OS_WINDOWS
686
-
687
- // Tests that EXPECT_DEBUG_DEATH in debug mode does not abort
688
- // the function.
689
- TEST_F(TestForDeathTest, ExpectDebugDeathDoesNotAbort) {
690
- bool aborted = true;
691
- EXPECT_NONFATAL_FAILURE(ExpectDebugDeathHelper(&aborted), "");
692
- EXPECT_FALSE(aborted);
693
- }
694
-
695
- void AssertDebugDeathHelper(bool* aborted) {
696
- *aborted = true;
697
- GTEST_LOG_(INFO) << "Before ASSERT_DEBUG_DEATH";
698
- ASSERT_DEBUG_DEATH(GTEST_LOG_(INFO) << "In ASSERT_DEBUG_DEATH"; return, "")
699
- << "This is expected to fail.";
700
- GTEST_LOG_(INFO) << "After ASSERT_DEBUG_DEATH";
701
- *aborted = false;
702
- }
703
-
704
- // Tests that ASSERT_DEBUG_DEATH in debug mode aborts the function on
705
- // failure.
706
- TEST_F(TestForDeathTest, AssertDebugDeathAborts) {
707
- static bool aborted;
708
- aborted = false;
709
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
710
- EXPECT_TRUE(aborted);
711
- }
712
-
713
- TEST_F(TestForDeathTest, AssertDebugDeathAborts2) {
714
- static bool aborted;
715
- aborted = false;
716
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
717
- EXPECT_TRUE(aborted);
718
- }
719
-
720
- TEST_F(TestForDeathTest, AssertDebugDeathAborts3) {
721
- static bool aborted;
722
- aborted = false;
723
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
724
- EXPECT_TRUE(aborted);
725
- }
726
-
727
- TEST_F(TestForDeathTest, AssertDebugDeathAborts4) {
728
- static bool aborted;
729
- aborted = false;
730
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
731
- EXPECT_TRUE(aborted);
732
- }
733
-
734
- TEST_F(TestForDeathTest, AssertDebugDeathAborts5) {
735
- static bool aborted;
736
- aborted = false;
737
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
738
- EXPECT_TRUE(aborted);
739
- }
740
-
741
- TEST_F(TestForDeathTest, AssertDebugDeathAborts6) {
742
- static bool aborted;
743
- aborted = false;
744
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
745
- EXPECT_TRUE(aborted);
746
- }
747
-
748
- TEST_F(TestForDeathTest, AssertDebugDeathAborts7) {
749
- static bool aborted;
750
- aborted = false;
751
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
752
- EXPECT_TRUE(aborted);
753
- }
754
-
755
- TEST_F(TestForDeathTest, AssertDebugDeathAborts8) {
756
- static bool aborted;
757
- aborted = false;
758
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
759
- EXPECT_TRUE(aborted);
760
- }
761
-
762
- TEST_F(TestForDeathTest, AssertDebugDeathAborts9) {
763
- static bool aborted;
764
- aborted = false;
765
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
766
- EXPECT_TRUE(aborted);
767
- }
768
-
769
- TEST_F(TestForDeathTest, AssertDebugDeathAborts10) {
770
- static bool aborted;
771
- aborted = false;
772
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
773
- EXPECT_TRUE(aborted);
774
- }
775
-
776
- # endif // _NDEBUG
777
-
778
- // Tests the *_EXIT family of macros, using a variety of predicates.
779
- static void TestExitMacros() {
780
- EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
781
- ASSERT_EXIT(_exit(42), testing::ExitedWithCode(42), "");
782
-
783
- # if GTEST_OS_WINDOWS
784
-
785
- // Of all signals effects on the process exit code, only those of SIGABRT
786
- // are documented on Windows.
787
- // See http://msdn.microsoft.com/en-us/library/dwwzkt4c(VS.71).aspx.
788
- EXPECT_EXIT(raise(SIGABRT), testing::ExitedWithCode(3), "") << "b_ar";
789
-
790
- # elif !GTEST_OS_FUCHSIA
791
-
792
- // Fuchsia has no unix signals.
793
- EXPECT_EXIT(raise(SIGKILL), testing::KilledBySignal(SIGKILL), "") << "foo";
794
- ASSERT_EXIT(raise(SIGUSR2), testing::KilledBySignal(SIGUSR2), "") << "bar";
795
-
796
- EXPECT_FATAL_FAILURE({ // NOLINT
797
- ASSERT_EXIT(_exit(0), testing::KilledBySignal(SIGSEGV), "")
798
- << "This failure is expected, too.";
799
- }, "This failure is expected, too.");
800
-
801
- # endif // GTEST_OS_WINDOWS
802
-
803
- EXPECT_NONFATAL_FAILURE({ // NOLINT
804
- EXPECT_EXIT(raise(SIGSEGV), testing::ExitedWithCode(0), "")
805
- << "This failure is expected.";
806
- }, "This failure is expected.");
807
- }
808
-
809
- TEST_F(TestForDeathTest, ExitMacros) {
810
- TestExitMacros();
811
- }
812
-
813
- TEST_F(TestForDeathTest, ExitMacrosUsingFork) {
814
- testing::GTEST_FLAG(death_test_use_fork) = true;
815
- TestExitMacros();
816
- }
817
-
818
- TEST_F(TestForDeathTest, InvalidStyle) {
819
- testing::GTEST_FLAG(death_test_style) = "rococo";
820
- EXPECT_NONFATAL_FAILURE({ // NOLINT
821
- EXPECT_DEATH(_exit(0), "") << "This failure is expected.";
822
- }, "This failure is expected.");
823
- }
824
-
825
- TEST_F(TestForDeathTest, DeathTestFailedOutput) {
826
- testing::GTEST_FLAG(death_test_style) = "fast";
827
- EXPECT_NONFATAL_FAILURE(
828
- EXPECT_DEATH(DieWithMessage("death\n"),
829
- "expected message"),
830
- "Actual msg:\n"
831
- "[ DEATH ] death\n");
832
- }
833
-
834
- TEST_F(TestForDeathTest, DeathTestUnexpectedReturnOutput) {
835
- testing::GTEST_FLAG(death_test_style) = "fast";
836
- EXPECT_NONFATAL_FAILURE(
837
- EXPECT_DEATH({
838
- fprintf(stderr, "returning\n");
839
- fflush(stderr);
840
- return;
841
- }, ""),
842
- " Result: illegal return in test statement.\n"
843
- " Error msg:\n"
844
- "[ DEATH ] returning\n");
845
- }
846
-
847
- TEST_F(TestForDeathTest, DeathTestBadExitCodeOutput) {
848
- testing::GTEST_FLAG(death_test_style) = "fast";
849
- EXPECT_NONFATAL_FAILURE(
850
- EXPECT_EXIT(DieWithMessage("exiting with rc 1\n"),
851
- testing::ExitedWithCode(3),
852
- "expected message"),
853
- " Result: died but not with expected exit code:\n"
854
- " Exited with exit status 1\n"
855
- "Actual msg:\n"
856
- "[ DEATH ] exiting with rc 1\n");
857
- }
858
-
859
- TEST_F(TestForDeathTest, DeathTestMultiLineMatchFail) {
860
- testing::GTEST_FLAG(death_test_style) = "fast";
861
- EXPECT_NONFATAL_FAILURE(
862
- EXPECT_DEATH(DieWithMessage("line 1\nline 2\nline 3\n"),
863
- "line 1\nxyz\nline 3\n"),
864
- "Actual msg:\n"
865
- "[ DEATH ] line 1\n"
866
- "[ DEATH ] line 2\n"
867
- "[ DEATH ] line 3\n");
868
- }
869
-
870
- TEST_F(TestForDeathTest, DeathTestMultiLineMatchPass) {
871
- testing::GTEST_FLAG(death_test_style) = "fast";
872
- EXPECT_DEATH(DieWithMessage("line 1\nline 2\nline 3\n"),
873
- "line 1\nline 2\nline 3\n");
874
- }
875
-
876
- // A DeathTestFactory that returns MockDeathTests.
877
- class MockDeathTestFactory : public DeathTestFactory {
878
- public:
879
- MockDeathTestFactory();
880
- virtual bool Create(const char* statement,
881
- const ::testing::internal::RE* regex,
882
- const char* file, int line, DeathTest** test);
883
-
884
- // Sets the parameters for subsequent calls to Create.
885
- void SetParameters(bool create, DeathTest::TestRole role,
886
- int status, bool passed);
887
-
888
- // Accessors.
889
- int AssumeRoleCalls() const { return assume_role_calls_; }
890
- int WaitCalls() const { return wait_calls_; }
891
- size_t PassedCalls() const { return passed_args_.size(); }
892
- bool PassedArgument(int n) const { return passed_args_[n]; }
893
- size_t AbortCalls() const { return abort_args_.size(); }
894
- DeathTest::AbortReason AbortArgument(int n) const {
895
- return abort_args_[n];
896
- }
897
- bool TestDeleted() const { return test_deleted_; }
898
-
899
- private:
900
- friend class MockDeathTest;
901
- // If true, Create will return a MockDeathTest; otherwise it returns
902
- // NULL.
903
- bool create_;
904
- // The value a MockDeathTest will return from its AssumeRole method.
905
- DeathTest::TestRole role_;
906
- // The value a MockDeathTest will return from its Wait method.
907
- int status_;
908
- // The value a MockDeathTest will return from its Passed method.
909
- bool passed_;
910
-
911
- // Number of times AssumeRole was called.
912
- int assume_role_calls_;
913
- // Number of times Wait was called.
914
- int wait_calls_;
915
- // The arguments to the calls to Passed since the last call to
916
- // SetParameters.
917
- std::vector<bool> passed_args_;
918
- // The arguments to the calls to Abort since the last call to
919
- // SetParameters.
920
- std::vector<DeathTest::AbortReason> abort_args_;
921
- // True if the last MockDeathTest returned by Create has been
922
- // deleted.
923
- bool test_deleted_;
924
- };
925
-
926
-
927
- // A DeathTest implementation useful in testing. It returns values set
928
- // at its creation from its various inherited DeathTest methods, and
929
- // reports calls to those methods to its parent MockDeathTestFactory
930
- // object.
931
- class MockDeathTest : public DeathTest {
932
- public:
933
- MockDeathTest(MockDeathTestFactory *parent,
934
- TestRole role, int status, bool passed) :
935
- parent_(parent), role_(role), status_(status), passed_(passed) {
936
- }
937
- virtual ~MockDeathTest() {
938
- parent_->test_deleted_ = true;
939
- }
940
- virtual TestRole AssumeRole() {
941
- ++parent_->assume_role_calls_;
942
- return role_;
943
- }
944
- virtual int Wait() {
945
- ++parent_->wait_calls_;
946
- return status_;
947
- }
948
- virtual bool Passed(bool exit_status_ok) {
949
- parent_->passed_args_.push_back(exit_status_ok);
950
- return passed_;
951
- }
952
- virtual void Abort(AbortReason reason) {
953
- parent_->abort_args_.push_back(reason);
954
- }
955
-
956
- private:
957
- MockDeathTestFactory* const parent_;
958
- const TestRole role_;
959
- const int status_;
960
- const bool passed_;
961
- };
962
-
963
-
964
- // MockDeathTestFactory constructor.
965
- MockDeathTestFactory::MockDeathTestFactory()
966
- : create_(true),
967
- role_(DeathTest::OVERSEE_TEST),
968
- status_(0),
969
- passed_(true),
970
- assume_role_calls_(0),
971
- wait_calls_(0),
972
- passed_args_(),
973
- abort_args_() {
974
- }
975
-
976
-
977
- // Sets the parameters for subsequent calls to Create.
978
- void MockDeathTestFactory::SetParameters(bool create,
979
- DeathTest::TestRole role,
980
- int status, bool passed) {
981
- create_ = create;
982
- role_ = role;
983
- status_ = status;
984
- passed_ = passed;
985
-
986
- assume_role_calls_ = 0;
987
- wait_calls_ = 0;
988
- passed_args_.clear();
989
- abort_args_.clear();
990
- }
991
-
992
-
993
- // Sets test to NULL (if create_ is false) or to the address of a new
994
- // MockDeathTest object with parameters taken from the last call
995
- // to SetParameters (if create_ is true). Always returns true.
996
- bool MockDeathTestFactory::Create(const char* /*statement*/,
997
- const ::testing::internal::RE* /*regex*/,
998
- const char* /*file*/,
999
- int /*line*/,
1000
- DeathTest** test) {
1001
- test_deleted_ = false;
1002
- if (create_) {
1003
- *test = new MockDeathTest(this, role_, status_, passed_);
1004
- } else {
1005
- *test = NULL;
1006
- }
1007
- return true;
1008
- }
1009
-
1010
- // A test fixture for testing the logic of the GTEST_DEATH_TEST_ macro.
1011
- // It installs a MockDeathTestFactory that is used for the duration
1012
- // of the test case.
1013
- class MacroLogicDeathTest : public testing::Test {
1014
- protected:
1015
- static testing::internal::ReplaceDeathTestFactory* replacer_;
1016
- static MockDeathTestFactory* factory_;
1017
-
1018
- static void SetUpTestCase() {
1019
- factory_ = new MockDeathTestFactory;
1020
- replacer_ = new testing::internal::ReplaceDeathTestFactory(factory_);
1021
- }
1022
-
1023
- static void TearDownTestCase() {
1024
- delete replacer_;
1025
- replacer_ = NULL;
1026
- delete factory_;
1027
- factory_ = NULL;
1028
- }
1029
-
1030
- // Runs a death test that breaks the rules by returning. Such a death
1031
- // test cannot be run directly from a test routine that uses a
1032
- // MockDeathTest, or the remainder of the routine will not be executed.
1033
- static void RunReturningDeathTest(bool* flag) {
1034
- ASSERT_DEATH({ // NOLINT
1035
- *flag = true;
1036
- return;
1037
- }, "");
1038
- }
1039
- };
1040
-
1041
- testing::internal::ReplaceDeathTestFactory* MacroLogicDeathTest::replacer_
1042
- = NULL;
1043
- MockDeathTestFactory* MacroLogicDeathTest::factory_ = NULL;
1044
-
1045
-
1046
- // Test that nothing happens when the factory doesn't return a DeathTest:
1047
- TEST_F(MacroLogicDeathTest, NothingHappens) {
1048
- bool flag = false;
1049
- factory_->SetParameters(false, DeathTest::OVERSEE_TEST, 0, true);
1050
- EXPECT_DEATH(flag = true, "");
1051
- EXPECT_FALSE(flag);
1052
- EXPECT_EQ(0, factory_->AssumeRoleCalls());
1053
- EXPECT_EQ(0, factory_->WaitCalls());
1054
- EXPECT_EQ(0U, factory_->PassedCalls());
1055
- EXPECT_EQ(0U, factory_->AbortCalls());
1056
- EXPECT_FALSE(factory_->TestDeleted());
1057
- }
1058
-
1059
- // Test that the parent process doesn't run the death test code,
1060
- // and that the Passed method returns false when the (simulated)
1061
- // child process exits with status 0:
1062
- TEST_F(MacroLogicDeathTest, ChildExitsSuccessfully) {
1063
- bool flag = false;
1064
- factory_->SetParameters(true, DeathTest::OVERSEE_TEST, 0, true);
1065
- EXPECT_DEATH(flag = true, "");
1066
- EXPECT_FALSE(flag);
1067
- EXPECT_EQ(1, factory_->AssumeRoleCalls());
1068
- EXPECT_EQ(1, factory_->WaitCalls());
1069
- ASSERT_EQ(1U, factory_->PassedCalls());
1070
- EXPECT_FALSE(factory_->PassedArgument(0));
1071
- EXPECT_EQ(0U, factory_->AbortCalls());
1072
- EXPECT_TRUE(factory_->TestDeleted());
1073
- }
1074
-
1075
- // Tests that the Passed method was given the argument "true" when
1076
- // the (simulated) child process exits with status 1:
1077
- TEST_F(MacroLogicDeathTest, ChildExitsUnsuccessfully) {
1078
- bool flag = false;
1079
- factory_->SetParameters(true, DeathTest::OVERSEE_TEST, 1, true);
1080
- EXPECT_DEATH(flag = true, "");
1081
- EXPECT_FALSE(flag);
1082
- EXPECT_EQ(1, factory_->AssumeRoleCalls());
1083
- EXPECT_EQ(1, factory_->WaitCalls());
1084
- ASSERT_EQ(1U, factory_->PassedCalls());
1085
- EXPECT_TRUE(factory_->PassedArgument(0));
1086
- EXPECT_EQ(0U, factory_->AbortCalls());
1087
- EXPECT_TRUE(factory_->TestDeleted());
1088
- }
1089
-
1090
- // Tests that the (simulated) child process executes the death test
1091
- // code, and is aborted with the correct AbortReason if it
1092
- // executes a return statement.
1093
- TEST_F(MacroLogicDeathTest, ChildPerformsReturn) {
1094
- bool flag = false;
1095
- factory_->SetParameters(true, DeathTest::EXECUTE_TEST, 0, true);
1096
- RunReturningDeathTest(&flag);
1097
- EXPECT_TRUE(flag);
1098
- EXPECT_EQ(1, factory_->AssumeRoleCalls());
1099
- EXPECT_EQ(0, factory_->WaitCalls());
1100
- EXPECT_EQ(0U, factory_->PassedCalls());
1101
- EXPECT_EQ(1U, factory_->AbortCalls());
1102
- EXPECT_EQ(DeathTest::TEST_ENCOUNTERED_RETURN_STATEMENT,
1103
- factory_->AbortArgument(0));
1104
- EXPECT_TRUE(factory_->TestDeleted());
1105
- }
1106
-
1107
- // Tests that the (simulated) child process is aborted with the
1108
- // correct AbortReason if it does not die.
1109
- TEST_F(MacroLogicDeathTest, ChildDoesNotDie) {
1110
- bool flag = false;
1111
- factory_->SetParameters(true, DeathTest::EXECUTE_TEST, 0, true);
1112
- EXPECT_DEATH(flag = true, "");
1113
- EXPECT_TRUE(flag);
1114
- EXPECT_EQ(1, factory_->AssumeRoleCalls());
1115
- EXPECT_EQ(0, factory_->WaitCalls());
1116
- EXPECT_EQ(0U, factory_->PassedCalls());
1117
- // This time there are two calls to Abort: one since the test didn't
1118
- // die, and another from the ReturnSentinel when it's destroyed. The
1119
- // sentinel normally isn't destroyed if a test doesn't die, since
1120
- // _exit(2) is called in that case by ForkingDeathTest, but not by
1121
- // our MockDeathTest.
1122
- ASSERT_EQ(2U, factory_->AbortCalls());
1123
- EXPECT_EQ(DeathTest::TEST_DID_NOT_DIE,
1124
- factory_->AbortArgument(0));
1125
- EXPECT_EQ(DeathTest::TEST_ENCOUNTERED_RETURN_STATEMENT,
1126
- factory_->AbortArgument(1));
1127
- EXPECT_TRUE(factory_->TestDeleted());
1128
- }
1129
-
1130
- // Tests that a successful death test does not register a successful
1131
- // test part.
1132
- TEST(SuccessRegistrationDeathTest, NoSuccessPart) {
1133
- EXPECT_DEATH(_exit(1), "");
1134
- EXPECT_EQ(0, GetUnitTestImpl()->current_test_result()->total_part_count());
1135
- }
1136
-
1137
- TEST(StreamingAssertionsDeathTest, DeathTest) {
1138
- EXPECT_DEATH(_exit(1), "") << "unexpected failure";
1139
- ASSERT_DEATH(_exit(1), "") << "unexpected failure";
1140
- EXPECT_NONFATAL_FAILURE({ // NOLINT
1141
- EXPECT_DEATH(_exit(0), "") << "expected failure";
1142
- }, "expected failure");
1143
- EXPECT_FATAL_FAILURE({ // NOLINT
1144
- ASSERT_DEATH(_exit(0), "") << "expected failure";
1145
- }, "expected failure");
1146
- }
1147
-
1148
- // Tests that GetLastErrnoDescription returns an empty string when the
1149
- // last error is 0 and non-empty string when it is non-zero.
1150
- TEST(GetLastErrnoDescription, GetLastErrnoDescriptionWorks) {
1151
- errno = ENOENT;
1152
- EXPECT_STRNE("", GetLastErrnoDescription().c_str());
1153
- errno = 0;
1154
- EXPECT_STREQ("", GetLastErrnoDescription().c_str());
1155
- }
1156
-
1157
- # if GTEST_OS_WINDOWS
1158
- TEST(AutoHandleTest, AutoHandleWorks) {
1159
- HANDLE handle = ::CreateEvent(NULL, FALSE, FALSE, NULL);
1160
- ASSERT_NE(INVALID_HANDLE_VALUE, handle);
1161
-
1162
- // Tests that the AutoHandle is correctly initialized with a handle.
1163
- testing::internal::AutoHandle auto_handle(handle);
1164
- EXPECT_EQ(handle, auto_handle.Get());
1165
-
1166
- // Tests that Reset assigns INVALID_HANDLE_VALUE.
1167
- // Note that this cannot verify whether the original handle is closed.
1168
- auto_handle.Reset();
1169
- EXPECT_EQ(INVALID_HANDLE_VALUE, auto_handle.Get());
1170
-
1171
- // Tests that Reset assigns the new handle.
1172
- // Note that this cannot verify whether the original handle is closed.
1173
- handle = ::CreateEvent(NULL, FALSE, FALSE, NULL);
1174
- ASSERT_NE(INVALID_HANDLE_VALUE, handle);
1175
- auto_handle.Reset(handle);
1176
- EXPECT_EQ(handle, auto_handle.Get());
1177
-
1178
- // Tests that AutoHandle contains INVALID_HANDLE_VALUE by default.
1179
- testing::internal::AutoHandle auto_handle2;
1180
- EXPECT_EQ(INVALID_HANDLE_VALUE, auto_handle2.Get());
1181
- }
1182
- # endif // GTEST_OS_WINDOWS
1183
-
1184
- # if GTEST_OS_WINDOWS
1185
- typedef unsigned __int64 BiggestParsable;
1186
- typedef signed __int64 BiggestSignedParsable;
1187
- # else
1188
- typedef unsigned long long BiggestParsable;
1189
- typedef signed long long BiggestSignedParsable;
1190
- # endif // GTEST_OS_WINDOWS
1191
-
1192
- // We cannot use std::numeric_limits<T>::max() as it clashes with the
1193
- // max() macro defined by <windows.h>.
1194
- const BiggestParsable kBiggestParsableMax = ULLONG_MAX;
1195
- const BiggestSignedParsable kBiggestSignedParsableMax = LLONG_MAX;
1196
-
1197
- TEST(ParseNaturalNumberTest, RejectsInvalidFormat) {
1198
- BiggestParsable result = 0;
1199
-
1200
- // Rejects non-numbers.
1201
- EXPECT_FALSE(ParseNaturalNumber("non-number string", &result));
1202
-
1203
- // Rejects numbers with whitespace prefix.
1204
- EXPECT_FALSE(ParseNaturalNumber(" 123", &result));
1205
-
1206
- // Rejects negative numbers.
1207
- EXPECT_FALSE(ParseNaturalNumber("-123", &result));
1208
-
1209
- // Rejects numbers starting with a plus sign.
1210
- EXPECT_FALSE(ParseNaturalNumber("+123", &result));
1211
- errno = 0;
1212
- }
1213
-
1214
- TEST(ParseNaturalNumberTest, RejectsOverflownNumbers) {
1215
- BiggestParsable result = 0;
1216
-
1217
- EXPECT_FALSE(ParseNaturalNumber("99999999999999999999999", &result));
1218
-
1219
- signed char char_result = 0;
1220
- EXPECT_FALSE(ParseNaturalNumber("200", &char_result));
1221
- errno = 0;
1222
- }
1223
-
1224
- TEST(ParseNaturalNumberTest, AcceptsValidNumbers) {
1225
- BiggestParsable result = 0;
1226
-
1227
- result = 0;
1228
- ASSERT_TRUE(ParseNaturalNumber("123", &result));
1229
- EXPECT_EQ(123U, result);
1230
-
1231
- // Check 0 as an edge case.
1232
- result = 1;
1233
- ASSERT_TRUE(ParseNaturalNumber("0", &result));
1234
- EXPECT_EQ(0U, result);
1235
-
1236
- result = 1;
1237
- ASSERT_TRUE(ParseNaturalNumber("00000", &result));
1238
- EXPECT_EQ(0U, result);
1239
- }
1240
-
1241
- TEST(ParseNaturalNumberTest, AcceptsTypeLimits) {
1242
- Message msg;
1243
- msg << kBiggestParsableMax;
1244
-
1245
- BiggestParsable result = 0;
1246
- EXPECT_TRUE(ParseNaturalNumber(msg.GetString(), &result));
1247
- EXPECT_EQ(kBiggestParsableMax, result);
1248
-
1249
- Message msg2;
1250
- msg2 << kBiggestSignedParsableMax;
1251
-
1252
- BiggestSignedParsable signed_result = 0;
1253
- EXPECT_TRUE(ParseNaturalNumber(msg2.GetString(), &signed_result));
1254
- EXPECT_EQ(kBiggestSignedParsableMax, signed_result);
1255
-
1256
- Message msg3;
1257
- msg3 << INT_MAX;
1258
-
1259
- int int_result = 0;
1260
- EXPECT_TRUE(ParseNaturalNumber(msg3.GetString(), &int_result));
1261
- EXPECT_EQ(INT_MAX, int_result);
1262
-
1263
- Message msg4;
1264
- msg4 << UINT_MAX;
1265
-
1266
- unsigned int uint_result = 0;
1267
- EXPECT_TRUE(ParseNaturalNumber(msg4.GetString(), &uint_result));
1268
- EXPECT_EQ(UINT_MAX, uint_result);
1269
- }
1270
-
1271
- TEST(ParseNaturalNumberTest, WorksForShorterIntegers) {
1272
- short short_result = 0;
1273
- ASSERT_TRUE(ParseNaturalNumber("123", &short_result));
1274
- EXPECT_EQ(123, short_result);
1275
-
1276
- signed char char_result = 0;
1277
- ASSERT_TRUE(ParseNaturalNumber("123", &char_result));
1278
- EXPECT_EQ(123, char_result);
1279
- }
1280
-
1281
- # if GTEST_OS_WINDOWS
1282
- TEST(EnvironmentTest, HandleFitsIntoSizeT) {
1283
- // TODO(vladl@google.com): Remove this test after this condition is verified
1284
- // in a static assertion in gtest-death-test.cc in the function
1285
- // GetStatusFileDescriptor.
1286
- ASSERT_TRUE(sizeof(HANDLE) <= sizeof(size_t));
1287
- }
1288
- # endif // GTEST_OS_WINDOWS
1289
-
1290
- // Tests that EXPECT_DEATH_IF_SUPPORTED/ASSERT_DEATH_IF_SUPPORTED trigger
1291
- // failures when death tests are available on the system.
1292
- TEST(ConditionalDeathMacrosDeathTest, ExpectsDeathWhenDeathTestsAvailable) {
1293
- EXPECT_DEATH_IF_SUPPORTED(DieInside("CondDeathTestExpectMacro"),
1294
- "death inside CondDeathTestExpectMacro");
1295
- ASSERT_DEATH_IF_SUPPORTED(DieInside("CondDeathTestAssertMacro"),
1296
- "death inside CondDeathTestAssertMacro");
1297
-
1298
- // Empty statement will not crash, which must trigger a failure.
1299
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH_IF_SUPPORTED(;, ""), "");
1300
- EXPECT_FATAL_FAILURE(ASSERT_DEATH_IF_SUPPORTED(;, ""), "");
1301
- }
1302
-
1303
- TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInFastStyle) {
1304
- testing::GTEST_FLAG(death_test_style) = "fast";
1305
- EXPECT_FALSE(InDeathTestChild());
1306
- EXPECT_DEATH({
1307
- fprintf(stderr, InDeathTestChild() ? "Inside" : "Outside");
1308
- fflush(stderr);
1309
- _exit(1);
1310
- }, "Inside");
1311
- }
1312
-
1313
- TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInThreadSafeStyle) {
1314
- testing::GTEST_FLAG(death_test_style) = "threadsafe";
1315
- EXPECT_FALSE(InDeathTestChild());
1316
- EXPECT_DEATH({
1317
- fprintf(stderr, InDeathTestChild() ? "Inside" : "Outside");
1318
- fflush(stderr);
1319
- _exit(1);
1320
- }, "Inside");
1321
- }
1322
-
1323
- #else // !GTEST_HAS_DEATH_TEST follows
1324
-
1325
- using testing::internal::CaptureStderr;
1326
- using testing::internal::GetCapturedStderr;
1327
-
1328
- // Tests that EXPECT_DEATH_IF_SUPPORTED/ASSERT_DEATH_IF_SUPPORTED are still
1329
- // defined but do not trigger failures when death tests are not available on
1330
- // the system.
1331
- TEST(ConditionalDeathMacrosTest, WarnsWhenDeathTestsNotAvailable) {
1332
- // Empty statement will not crash, but that should not trigger a failure
1333
- // when death tests are not supported.
1334
- CaptureStderr();
1335
- EXPECT_DEATH_IF_SUPPORTED(;, "");
1336
- std::string output = GetCapturedStderr();
1337
- ASSERT_TRUE(NULL != strstr(output.c_str(),
1338
- "Death tests are not supported on this platform"));
1339
- ASSERT_TRUE(NULL != strstr(output.c_str(), ";"));
1340
-
1341
- // The streamed message should not be printed as there is no test failure.
1342
- CaptureStderr();
1343
- EXPECT_DEATH_IF_SUPPORTED(;, "") << "streamed message";
1344
- output = GetCapturedStderr();
1345
- ASSERT_TRUE(NULL == strstr(output.c_str(), "streamed message"));
1346
-
1347
- CaptureStderr();
1348
- ASSERT_DEATH_IF_SUPPORTED(;, ""); // NOLINT
1349
- output = GetCapturedStderr();
1350
- ASSERT_TRUE(NULL != strstr(output.c_str(),
1351
- "Death tests are not supported on this platform"));
1352
- ASSERT_TRUE(NULL != strstr(output.c_str(), ";"));
1353
-
1354
- CaptureStderr();
1355
- ASSERT_DEATH_IF_SUPPORTED(;, "") << "streamed message"; // NOLINT
1356
- output = GetCapturedStderr();
1357
- ASSERT_TRUE(NULL == strstr(output.c_str(), "streamed message"));
1358
- }
1359
-
1360
- void FuncWithAssert(int* n) {
1361
- ASSERT_DEATH_IF_SUPPORTED(return;, "");
1362
- (*n)++;
1363
- }
1364
-
1365
- // Tests that ASSERT_DEATH_IF_SUPPORTED does not return from the current
1366
- // function (as ASSERT_DEATH does) if death tests are not supported.
1367
- TEST(ConditionalDeathMacrosTest, AssertDeatDoesNotReturnhIfUnsupported) {
1368
- int n = 0;
1369
- FuncWithAssert(&n);
1370
- EXPECT_EQ(1, n);
1371
- }
1372
-
1373
- #endif // !GTEST_HAS_DEATH_TEST
1374
-
1375
- // Tests that the death test macros expand to code which may or may not
1376
- // be followed by operator<<, and that in either case the complete text
1377
- // comprises only a single C++ statement.
1378
- //
1379
- // The syntax should work whether death tests are available or not.
1380
- TEST(ConditionalDeathMacrosSyntaxDeathTest, SingleStatement) {
1381
- if (AlwaysFalse())
1382
- // This would fail if executed; this is a compilation test only
1383
- ASSERT_DEATH_IF_SUPPORTED(return, "");
1384
-
1385
- if (AlwaysTrue())
1386
- EXPECT_DEATH_IF_SUPPORTED(_exit(1), "");
1387
- else
1388
- // This empty "else" branch is meant to ensure that EXPECT_DEATH
1389
- // doesn't expand into an "if" statement without an "else"
1390
- ; // NOLINT
1391
-
1392
- if (AlwaysFalse())
1393
- ASSERT_DEATH_IF_SUPPORTED(return, "") << "did not die";
1394
-
1395
- if (AlwaysFalse())
1396
- ; // NOLINT
1397
- else
1398
- EXPECT_DEATH_IF_SUPPORTED(_exit(1), "") << 1 << 2 << 3;
1399
- }
1400
-
1401
- // Tests that conditional death test macros expand to code which interacts
1402
- // well with switch statements.
1403
- TEST(ConditionalDeathMacrosSyntaxDeathTest, SwitchStatement) {
1404
- // Microsoft compiler usually complains about switch statements without
1405
- // case labels. We suppress that warning for this test.
1406
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4065)
1407
-
1408
- switch (0)
1409
- default:
1410
- ASSERT_DEATH_IF_SUPPORTED(_exit(1), "")
1411
- << "exit in default switch handler";
1412
-
1413
- switch (0)
1414
- case 0:
1415
- EXPECT_DEATH_IF_SUPPORTED(_exit(1), "") << "exit in switch case";
1416
-
1417
- GTEST_DISABLE_MSC_WARNINGS_POP_()
1418
- }
1419
-
1420
- // Tests that a test case whose name ends with "DeathTest" works fine
1421
- // on Windows.
1422
- TEST(NotADeathTest, Test) {
1423
- SUCCEED();
1424
- }