@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,1303 +0,0 @@
1
- // Copyright 2008, 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
- // Authors: vladl@google.com (Vlad Losev), wan@google.com (Zhanyong Wan)
31
- //
32
- // This file tests the internal cross-platform support utilities.
33
-
34
- #include "gtest/internal/gtest-port.h"
35
-
36
- #include <stdio.h>
37
-
38
- #if GTEST_OS_MAC
39
- # include <time.h>
40
- #endif // GTEST_OS_MAC
41
-
42
- #include <list>
43
- #include <utility> // For std::pair and std::make_pair.
44
- #include <vector>
45
-
46
- #include "gtest/gtest.h"
47
- #include "gtest/gtest-spi.h"
48
- #include "src/gtest-internal-inl.h"
49
-
50
- using std::make_pair;
51
- using std::pair;
52
-
53
- namespace testing {
54
- namespace internal {
55
-
56
- TEST(IsXDigitTest, WorksForNarrowAscii) {
57
- EXPECT_TRUE(IsXDigit('0'));
58
- EXPECT_TRUE(IsXDigit('9'));
59
- EXPECT_TRUE(IsXDigit('A'));
60
- EXPECT_TRUE(IsXDigit('F'));
61
- EXPECT_TRUE(IsXDigit('a'));
62
- EXPECT_TRUE(IsXDigit('f'));
63
-
64
- EXPECT_FALSE(IsXDigit('-'));
65
- EXPECT_FALSE(IsXDigit('g'));
66
- EXPECT_FALSE(IsXDigit('G'));
67
- }
68
-
69
- TEST(IsXDigitTest, ReturnsFalseForNarrowNonAscii) {
70
- EXPECT_FALSE(IsXDigit(static_cast<char>('\x80')));
71
- EXPECT_FALSE(IsXDigit(static_cast<char>('0' | '\x80')));
72
- }
73
-
74
- TEST(IsXDigitTest, WorksForWideAscii) {
75
- EXPECT_TRUE(IsXDigit(L'0'));
76
- EXPECT_TRUE(IsXDigit(L'9'));
77
- EXPECT_TRUE(IsXDigit(L'A'));
78
- EXPECT_TRUE(IsXDigit(L'F'));
79
- EXPECT_TRUE(IsXDigit(L'a'));
80
- EXPECT_TRUE(IsXDigit(L'f'));
81
-
82
- EXPECT_FALSE(IsXDigit(L'-'));
83
- EXPECT_FALSE(IsXDigit(L'g'));
84
- EXPECT_FALSE(IsXDigit(L'G'));
85
- }
86
-
87
- TEST(IsXDigitTest, ReturnsFalseForWideNonAscii) {
88
- EXPECT_FALSE(IsXDigit(static_cast<wchar_t>(0x80)));
89
- EXPECT_FALSE(IsXDigit(static_cast<wchar_t>(L'0' | 0x80)));
90
- EXPECT_FALSE(IsXDigit(static_cast<wchar_t>(L'0' | 0x100)));
91
- }
92
-
93
- class Base {
94
- public:
95
- // Copy constructor and assignment operator do exactly what we need, so we
96
- // use them.
97
- Base() : member_(0) {}
98
- explicit Base(int n) : member_(n) {}
99
- virtual ~Base() {}
100
- int member() { return member_; }
101
-
102
- private:
103
- int member_;
104
- };
105
-
106
- class Derived : public Base {
107
- public:
108
- explicit Derived(int n) : Base(n) {}
109
- };
110
-
111
- TEST(ImplicitCastTest, ConvertsPointers) {
112
- Derived derived(0);
113
- EXPECT_TRUE(&derived == ::testing::internal::ImplicitCast_<Base*>(&derived));
114
- }
115
-
116
- TEST(ImplicitCastTest, CanUseInheritance) {
117
- Derived derived(1);
118
- Base base = ::testing::internal::ImplicitCast_<Base>(derived);
119
- EXPECT_EQ(derived.member(), base.member());
120
- }
121
-
122
- class Castable {
123
- public:
124
- explicit Castable(bool* converted) : converted_(converted) {}
125
- operator Base() {
126
- *converted_ = true;
127
- return Base();
128
- }
129
-
130
- private:
131
- bool* converted_;
132
- };
133
-
134
- TEST(ImplicitCastTest, CanUseNonConstCastOperator) {
135
- bool converted = false;
136
- Castable castable(&converted);
137
- Base base = ::testing::internal::ImplicitCast_<Base>(castable);
138
- EXPECT_TRUE(converted);
139
- }
140
-
141
- class ConstCastable {
142
- public:
143
- explicit ConstCastable(bool* converted) : converted_(converted) {}
144
- operator Base() const {
145
- *converted_ = true;
146
- return Base();
147
- }
148
-
149
- private:
150
- bool* converted_;
151
- };
152
-
153
- TEST(ImplicitCastTest, CanUseConstCastOperatorOnConstValues) {
154
- bool converted = false;
155
- const ConstCastable const_castable(&converted);
156
- Base base = ::testing::internal::ImplicitCast_<Base>(const_castable);
157
- EXPECT_TRUE(converted);
158
- }
159
-
160
- class ConstAndNonConstCastable {
161
- public:
162
- ConstAndNonConstCastable(bool* converted, bool* const_converted)
163
- : converted_(converted), const_converted_(const_converted) {}
164
- operator Base() {
165
- *converted_ = true;
166
- return Base();
167
- }
168
- operator Base() const {
169
- *const_converted_ = true;
170
- return Base();
171
- }
172
-
173
- private:
174
- bool* converted_;
175
- bool* const_converted_;
176
- };
177
-
178
- TEST(ImplicitCastTest, CanSelectBetweenConstAndNonConstCasrAppropriately) {
179
- bool converted = false;
180
- bool const_converted = false;
181
- ConstAndNonConstCastable castable(&converted, &const_converted);
182
- Base base = ::testing::internal::ImplicitCast_<Base>(castable);
183
- EXPECT_TRUE(converted);
184
- EXPECT_FALSE(const_converted);
185
-
186
- converted = false;
187
- const_converted = false;
188
- const ConstAndNonConstCastable const_castable(&converted, &const_converted);
189
- base = ::testing::internal::ImplicitCast_<Base>(const_castable);
190
- EXPECT_FALSE(converted);
191
- EXPECT_TRUE(const_converted);
192
- }
193
-
194
- class To {
195
- public:
196
- To(bool* converted) { *converted = true; } // NOLINT
197
- };
198
-
199
- TEST(ImplicitCastTest, CanUseImplicitConstructor) {
200
- bool converted = false;
201
- To to = ::testing::internal::ImplicitCast_<To>(&converted);
202
- (void)to;
203
- EXPECT_TRUE(converted);
204
- }
205
-
206
- TEST(IteratorTraitsTest, WorksForSTLContainerIterators) {
207
- StaticAssertTypeEq<int,
208
- IteratorTraits< ::std::vector<int>::const_iterator>::value_type>();
209
- StaticAssertTypeEq<bool,
210
- IteratorTraits< ::std::list<bool>::iterator>::value_type>();
211
- }
212
-
213
- TEST(IteratorTraitsTest, WorksForPointerToNonConst) {
214
- StaticAssertTypeEq<char, IteratorTraits<char*>::value_type>();
215
- StaticAssertTypeEq<const void*, IteratorTraits<const void**>::value_type>();
216
- }
217
-
218
- TEST(IteratorTraitsTest, WorksForPointerToConst) {
219
- StaticAssertTypeEq<char, IteratorTraits<const char*>::value_type>();
220
- StaticAssertTypeEq<const void*,
221
- IteratorTraits<const void* const*>::value_type>();
222
- }
223
-
224
- // Tests that the element_type typedef is available in scoped_ptr and refers
225
- // to the parameter type.
226
- TEST(ScopedPtrTest, DefinesElementType) {
227
- StaticAssertTypeEq<int, ::testing::internal::scoped_ptr<int>::element_type>();
228
- }
229
-
230
- // TODO(vladl@google.com): Implement THE REST of scoped_ptr tests.
231
-
232
- TEST(GtestCheckSyntaxTest, BehavesLikeASingleStatement) {
233
- if (AlwaysFalse())
234
- GTEST_CHECK_(false) << "This should never be executed; "
235
- "It's a compilation test only.";
236
-
237
- if (AlwaysTrue())
238
- GTEST_CHECK_(true);
239
- else
240
- ; // NOLINT
241
-
242
- if (AlwaysFalse())
243
- ; // NOLINT
244
- else
245
- GTEST_CHECK_(true) << "";
246
- }
247
-
248
- TEST(GtestCheckSyntaxTest, WorksWithSwitch) {
249
- switch (0) {
250
- case 1:
251
- break;
252
- default:
253
- GTEST_CHECK_(true);
254
- }
255
-
256
- switch (0)
257
- case 0:
258
- GTEST_CHECK_(true) << "Check failed in switch case";
259
- }
260
-
261
- // Verifies behavior of FormatFileLocation.
262
- TEST(FormatFileLocationTest, FormatsFileLocation) {
263
- EXPECT_PRED_FORMAT2(IsSubstring, "foo.cc", FormatFileLocation("foo.cc", 42));
264
- EXPECT_PRED_FORMAT2(IsSubstring, "42", FormatFileLocation("foo.cc", 42));
265
- }
266
-
267
- TEST(FormatFileLocationTest, FormatsUnknownFile) {
268
- EXPECT_PRED_FORMAT2(
269
- IsSubstring, "unknown file", FormatFileLocation(NULL, 42));
270
- EXPECT_PRED_FORMAT2(IsSubstring, "42", FormatFileLocation(NULL, 42));
271
- }
272
-
273
- TEST(FormatFileLocationTest, FormatsUknownLine) {
274
- EXPECT_EQ("foo.cc:", FormatFileLocation("foo.cc", -1));
275
- }
276
-
277
- TEST(FormatFileLocationTest, FormatsUknownFileAndLine) {
278
- EXPECT_EQ("unknown file:", FormatFileLocation(NULL, -1));
279
- }
280
-
281
- // Verifies behavior of FormatCompilerIndependentFileLocation.
282
- TEST(FormatCompilerIndependentFileLocationTest, FormatsFileLocation) {
283
- EXPECT_EQ("foo.cc:42", FormatCompilerIndependentFileLocation("foo.cc", 42));
284
- }
285
-
286
- TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFile) {
287
- EXPECT_EQ("unknown file:42",
288
- FormatCompilerIndependentFileLocation(NULL, 42));
289
- }
290
-
291
- TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownLine) {
292
- EXPECT_EQ("foo.cc", FormatCompilerIndependentFileLocation("foo.cc", -1));
293
- }
294
-
295
- TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFileAndLine) {
296
- EXPECT_EQ("unknown file", FormatCompilerIndependentFileLocation(NULL, -1));
297
- }
298
-
299
- #if GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_FUCHSIA
300
- void* ThreadFunc(void* data) {
301
- internal::Mutex* mutex = static_cast<internal::Mutex*>(data);
302
- mutex->Lock();
303
- mutex->Unlock();
304
- return NULL;
305
- }
306
-
307
- TEST(GetThreadCountTest, ReturnsCorrectValue) {
308
- const size_t starting_count = GetThreadCount();
309
- pthread_t thread_id;
310
-
311
- internal::Mutex mutex;
312
- {
313
- internal::MutexLock lock(&mutex);
314
- pthread_attr_t attr;
315
- ASSERT_EQ(0, pthread_attr_init(&attr));
316
- ASSERT_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE));
317
-
318
- const int status = pthread_create(&thread_id, &attr, &ThreadFunc, &mutex);
319
- ASSERT_EQ(0, pthread_attr_destroy(&attr));
320
- ASSERT_EQ(0, status);
321
- EXPECT_EQ(starting_count + 1, GetThreadCount());
322
- }
323
-
324
- void* dummy;
325
- ASSERT_EQ(0, pthread_join(thread_id, &dummy));
326
-
327
- // The OS may not immediately report the updated thread count after
328
- // joining a thread, causing flakiness in this test. To counter that, we
329
- // wait for up to .5 seconds for the OS to report the correct value.
330
- for (int i = 0; i < 5; ++i) {
331
- if (GetThreadCount() == starting_count)
332
- break;
333
-
334
- SleepMilliseconds(100);
335
- }
336
-
337
- EXPECT_EQ(starting_count, GetThreadCount());
338
- }
339
- #else
340
- TEST(GetThreadCountTest, ReturnsZeroWhenUnableToCountThreads) {
341
- EXPECT_EQ(0U, GetThreadCount());
342
- }
343
- #endif // GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_FUCHSIA
344
-
345
- TEST(GtestCheckDeathTest, DiesWithCorrectOutputOnFailure) {
346
- const bool a_false_condition = false;
347
- const char regex[] =
348
- #ifdef _MSC_VER
349
- "gtest-port_test\\.cc\\(\\d+\\):"
350
- #elif GTEST_USES_POSIX_RE
351
- "gtest-port_test\\.cc:[0-9]+"
352
- #else
353
- "gtest-port_test\\.cc:\\d+"
354
- #endif // _MSC_VER
355
- ".*a_false_condition.*Extra info.*";
356
-
357
- EXPECT_DEATH_IF_SUPPORTED(GTEST_CHECK_(a_false_condition) << "Extra info",
358
- regex);
359
- }
360
-
361
- #if GTEST_HAS_DEATH_TEST
362
-
363
- TEST(GtestCheckDeathTest, LivesSilentlyOnSuccess) {
364
- EXPECT_EXIT({
365
- GTEST_CHECK_(true) << "Extra info";
366
- ::std::cerr << "Success\n";
367
- exit(0); },
368
- ::testing::ExitedWithCode(0), "Success");
369
- }
370
-
371
- #endif // GTEST_HAS_DEATH_TEST
372
-
373
- // Verifies that Google Test choose regular expression engine appropriate to
374
- // the platform. The test will produce compiler errors in case of failure.
375
- // For simplicity, we only cover the most important platforms here.
376
- TEST(RegexEngineSelectionTest, SelectsCorrectRegexEngine) {
377
- #if !GTEST_USES_PCRE
378
- # if GTEST_HAS_POSIX_RE
379
-
380
- EXPECT_TRUE(GTEST_USES_POSIX_RE);
381
-
382
- # else
383
-
384
- EXPECT_TRUE(GTEST_USES_SIMPLE_RE);
385
-
386
- # endif
387
- #endif // !GTEST_USES_PCRE
388
- }
389
-
390
- #if GTEST_USES_POSIX_RE
391
-
392
- # if GTEST_HAS_TYPED_TEST
393
-
394
- template <typename Str>
395
- class RETest : public ::testing::Test {};
396
-
397
- // Defines StringTypes as the list of all string types that class RE
398
- // supports.
399
- typedef testing::Types<
400
- ::std::string,
401
- # if GTEST_HAS_GLOBAL_STRING
402
- ::string,
403
- # endif // GTEST_HAS_GLOBAL_STRING
404
- const char*> StringTypes;
405
-
406
- TYPED_TEST_CASE(RETest, StringTypes);
407
-
408
- // Tests RE's implicit constructors.
409
- TYPED_TEST(RETest, ImplicitConstructorWorks) {
410
- const RE empty(TypeParam(""));
411
- EXPECT_STREQ("", empty.pattern());
412
-
413
- const RE simple(TypeParam("hello"));
414
- EXPECT_STREQ("hello", simple.pattern());
415
-
416
- const RE normal(TypeParam(".*(\\w+)"));
417
- EXPECT_STREQ(".*(\\w+)", normal.pattern());
418
- }
419
-
420
- // Tests that RE's constructors reject invalid regular expressions.
421
- TYPED_TEST(RETest, RejectsInvalidRegex) {
422
- EXPECT_NONFATAL_FAILURE({
423
- const RE invalid(TypeParam("?"));
424
- }, "\"?\" is not a valid POSIX Extended regular expression.");
425
- }
426
-
427
- // Tests RE::FullMatch().
428
- TYPED_TEST(RETest, FullMatchWorks) {
429
- const RE empty(TypeParam(""));
430
- EXPECT_TRUE(RE::FullMatch(TypeParam(""), empty));
431
- EXPECT_FALSE(RE::FullMatch(TypeParam("a"), empty));
432
-
433
- const RE re(TypeParam("a.*z"));
434
- EXPECT_TRUE(RE::FullMatch(TypeParam("az"), re));
435
- EXPECT_TRUE(RE::FullMatch(TypeParam("axyz"), re));
436
- EXPECT_FALSE(RE::FullMatch(TypeParam("baz"), re));
437
- EXPECT_FALSE(RE::FullMatch(TypeParam("azy"), re));
438
- }
439
-
440
- // Tests RE::PartialMatch().
441
- TYPED_TEST(RETest, PartialMatchWorks) {
442
- const RE empty(TypeParam(""));
443
- EXPECT_TRUE(RE::PartialMatch(TypeParam(""), empty));
444
- EXPECT_TRUE(RE::PartialMatch(TypeParam("a"), empty));
445
-
446
- const RE re(TypeParam("a.*z"));
447
- EXPECT_TRUE(RE::PartialMatch(TypeParam("az"), re));
448
- EXPECT_TRUE(RE::PartialMatch(TypeParam("axyz"), re));
449
- EXPECT_TRUE(RE::PartialMatch(TypeParam("baz"), re));
450
- EXPECT_TRUE(RE::PartialMatch(TypeParam("azy"), re));
451
- EXPECT_FALSE(RE::PartialMatch(TypeParam("zza"), re));
452
- }
453
-
454
- # endif // GTEST_HAS_TYPED_TEST
455
-
456
- #elif GTEST_USES_SIMPLE_RE
457
-
458
- TEST(IsInSetTest, NulCharIsNotInAnySet) {
459
- EXPECT_FALSE(IsInSet('\0', ""));
460
- EXPECT_FALSE(IsInSet('\0', "\0"));
461
- EXPECT_FALSE(IsInSet('\0', "a"));
462
- }
463
-
464
- TEST(IsInSetTest, WorksForNonNulChars) {
465
- EXPECT_FALSE(IsInSet('a', "Ab"));
466
- EXPECT_FALSE(IsInSet('c', ""));
467
-
468
- EXPECT_TRUE(IsInSet('b', "bcd"));
469
- EXPECT_TRUE(IsInSet('b', "ab"));
470
- }
471
-
472
- TEST(IsAsciiDigitTest, IsFalseForNonDigit) {
473
- EXPECT_FALSE(IsAsciiDigit('\0'));
474
- EXPECT_FALSE(IsAsciiDigit(' '));
475
- EXPECT_FALSE(IsAsciiDigit('+'));
476
- EXPECT_FALSE(IsAsciiDigit('-'));
477
- EXPECT_FALSE(IsAsciiDigit('.'));
478
- EXPECT_FALSE(IsAsciiDigit('a'));
479
- }
480
-
481
- TEST(IsAsciiDigitTest, IsTrueForDigit) {
482
- EXPECT_TRUE(IsAsciiDigit('0'));
483
- EXPECT_TRUE(IsAsciiDigit('1'));
484
- EXPECT_TRUE(IsAsciiDigit('5'));
485
- EXPECT_TRUE(IsAsciiDigit('9'));
486
- }
487
-
488
- TEST(IsAsciiPunctTest, IsFalseForNonPunct) {
489
- EXPECT_FALSE(IsAsciiPunct('\0'));
490
- EXPECT_FALSE(IsAsciiPunct(' '));
491
- EXPECT_FALSE(IsAsciiPunct('\n'));
492
- EXPECT_FALSE(IsAsciiPunct('a'));
493
- EXPECT_FALSE(IsAsciiPunct('0'));
494
- }
495
-
496
- TEST(IsAsciiPunctTest, IsTrueForPunct) {
497
- for (const char* p = "^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~"; *p; p++) {
498
- EXPECT_PRED1(IsAsciiPunct, *p);
499
- }
500
- }
501
-
502
- TEST(IsRepeatTest, IsFalseForNonRepeatChar) {
503
- EXPECT_FALSE(IsRepeat('\0'));
504
- EXPECT_FALSE(IsRepeat(' '));
505
- EXPECT_FALSE(IsRepeat('a'));
506
- EXPECT_FALSE(IsRepeat('1'));
507
- EXPECT_FALSE(IsRepeat('-'));
508
- }
509
-
510
- TEST(IsRepeatTest, IsTrueForRepeatChar) {
511
- EXPECT_TRUE(IsRepeat('?'));
512
- EXPECT_TRUE(IsRepeat('*'));
513
- EXPECT_TRUE(IsRepeat('+'));
514
- }
515
-
516
- TEST(IsAsciiWhiteSpaceTest, IsFalseForNonWhiteSpace) {
517
- EXPECT_FALSE(IsAsciiWhiteSpace('\0'));
518
- EXPECT_FALSE(IsAsciiWhiteSpace('a'));
519
- EXPECT_FALSE(IsAsciiWhiteSpace('1'));
520
- EXPECT_FALSE(IsAsciiWhiteSpace('+'));
521
- EXPECT_FALSE(IsAsciiWhiteSpace('_'));
522
- }
523
-
524
- TEST(IsAsciiWhiteSpaceTest, IsTrueForWhiteSpace) {
525
- EXPECT_TRUE(IsAsciiWhiteSpace(' '));
526
- EXPECT_TRUE(IsAsciiWhiteSpace('\n'));
527
- EXPECT_TRUE(IsAsciiWhiteSpace('\r'));
528
- EXPECT_TRUE(IsAsciiWhiteSpace('\t'));
529
- EXPECT_TRUE(IsAsciiWhiteSpace('\v'));
530
- EXPECT_TRUE(IsAsciiWhiteSpace('\f'));
531
- }
532
-
533
- TEST(IsAsciiWordCharTest, IsFalseForNonWordChar) {
534
- EXPECT_FALSE(IsAsciiWordChar('\0'));
535
- EXPECT_FALSE(IsAsciiWordChar('+'));
536
- EXPECT_FALSE(IsAsciiWordChar('.'));
537
- EXPECT_FALSE(IsAsciiWordChar(' '));
538
- EXPECT_FALSE(IsAsciiWordChar('\n'));
539
- }
540
-
541
- TEST(IsAsciiWordCharTest, IsTrueForLetter) {
542
- EXPECT_TRUE(IsAsciiWordChar('a'));
543
- EXPECT_TRUE(IsAsciiWordChar('b'));
544
- EXPECT_TRUE(IsAsciiWordChar('A'));
545
- EXPECT_TRUE(IsAsciiWordChar('Z'));
546
- }
547
-
548
- TEST(IsAsciiWordCharTest, IsTrueForDigit) {
549
- EXPECT_TRUE(IsAsciiWordChar('0'));
550
- EXPECT_TRUE(IsAsciiWordChar('1'));
551
- EXPECT_TRUE(IsAsciiWordChar('7'));
552
- EXPECT_TRUE(IsAsciiWordChar('9'));
553
- }
554
-
555
- TEST(IsAsciiWordCharTest, IsTrueForUnderscore) {
556
- EXPECT_TRUE(IsAsciiWordChar('_'));
557
- }
558
-
559
- TEST(IsValidEscapeTest, IsFalseForNonPrintable) {
560
- EXPECT_FALSE(IsValidEscape('\0'));
561
- EXPECT_FALSE(IsValidEscape('\007'));
562
- }
563
-
564
- TEST(IsValidEscapeTest, IsFalseForDigit) {
565
- EXPECT_FALSE(IsValidEscape('0'));
566
- EXPECT_FALSE(IsValidEscape('9'));
567
- }
568
-
569
- TEST(IsValidEscapeTest, IsFalseForWhiteSpace) {
570
- EXPECT_FALSE(IsValidEscape(' '));
571
- EXPECT_FALSE(IsValidEscape('\n'));
572
- }
573
-
574
- TEST(IsValidEscapeTest, IsFalseForSomeLetter) {
575
- EXPECT_FALSE(IsValidEscape('a'));
576
- EXPECT_FALSE(IsValidEscape('Z'));
577
- }
578
-
579
- TEST(IsValidEscapeTest, IsTrueForPunct) {
580
- EXPECT_TRUE(IsValidEscape('.'));
581
- EXPECT_TRUE(IsValidEscape('-'));
582
- EXPECT_TRUE(IsValidEscape('^'));
583
- EXPECT_TRUE(IsValidEscape('$'));
584
- EXPECT_TRUE(IsValidEscape('('));
585
- EXPECT_TRUE(IsValidEscape(']'));
586
- EXPECT_TRUE(IsValidEscape('{'));
587
- EXPECT_TRUE(IsValidEscape('|'));
588
- }
589
-
590
- TEST(IsValidEscapeTest, IsTrueForSomeLetter) {
591
- EXPECT_TRUE(IsValidEscape('d'));
592
- EXPECT_TRUE(IsValidEscape('D'));
593
- EXPECT_TRUE(IsValidEscape('s'));
594
- EXPECT_TRUE(IsValidEscape('S'));
595
- EXPECT_TRUE(IsValidEscape('w'));
596
- EXPECT_TRUE(IsValidEscape('W'));
597
- }
598
-
599
- TEST(AtomMatchesCharTest, EscapedPunct) {
600
- EXPECT_FALSE(AtomMatchesChar(true, '\\', '\0'));
601
- EXPECT_FALSE(AtomMatchesChar(true, '\\', ' '));
602
- EXPECT_FALSE(AtomMatchesChar(true, '_', '.'));
603
- EXPECT_FALSE(AtomMatchesChar(true, '.', 'a'));
604
-
605
- EXPECT_TRUE(AtomMatchesChar(true, '\\', '\\'));
606
- EXPECT_TRUE(AtomMatchesChar(true, '_', '_'));
607
- EXPECT_TRUE(AtomMatchesChar(true, '+', '+'));
608
- EXPECT_TRUE(AtomMatchesChar(true, '.', '.'));
609
- }
610
-
611
- TEST(AtomMatchesCharTest, Escaped_d) {
612
- EXPECT_FALSE(AtomMatchesChar(true, 'd', '\0'));
613
- EXPECT_FALSE(AtomMatchesChar(true, 'd', 'a'));
614
- EXPECT_FALSE(AtomMatchesChar(true, 'd', '.'));
615
-
616
- EXPECT_TRUE(AtomMatchesChar(true, 'd', '0'));
617
- EXPECT_TRUE(AtomMatchesChar(true, 'd', '9'));
618
- }
619
-
620
- TEST(AtomMatchesCharTest, Escaped_D) {
621
- EXPECT_FALSE(AtomMatchesChar(true, 'D', '0'));
622
- EXPECT_FALSE(AtomMatchesChar(true, 'D', '9'));
623
-
624
- EXPECT_TRUE(AtomMatchesChar(true, 'D', '\0'));
625
- EXPECT_TRUE(AtomMatchesChar(true, 'D', 'a'));
626
- EXPECT_TRUE(AtomMatchesChar(true, 'D', '-'));
627
- }
628
-
629
- TEST(AtomMatchesCharTest, Escaped_s) {
630
- EXPECT_FALSE(AtomMatchesChar(true, 's', '\0'));
631
- EXPECT_FALSE(AtomMatchesChar(true, 's', 'a'));
632
- EXPECT_FALSE(AtomMatchesChar(true, 's', '.'));
633
- EXPECT_FALSE(AtomMatchesChar(true, 's', '9'));
634
-
635
- EXPECT_TRUE(AtomMatchesChar(true, 's', ' '));
636
- EXPECT_TRUE(AtomMatchesChar(true, 's', '\n'));
637
- EXPECT_TRUE(AtomMatchesChar(true, 's', '\t'));
638
- }
639
-
640
- TEST(AtomMatchesCharTest, Escaped_S) {
641
- EXPECT_FALSE(AtomMatchesChar(true, 'S', ' '));
642
- EXPECT_FALSE(AtomMatchesChar(true, 'S', '\r'));
643
-
644
- EXPECT_TRUE(AtomMatchesChar(true, 'S', '\0'));
645
- EXPECT_TRUE(AtomMatchesChar(true, 'S', 'a'));
646
- EXPECT_TRUE(AtomMatchesChar(true, 'S', '9'));
647
- }
648
-
649
- TEST(AtomMatchesCharTest, Escaped_w) {
650
- EXPECT_FALSE(AtomMatchesChar(true, 'w', '\0'));
651
- EXPECT_FALSE(AtomMatchesChar(true, 'w', '+'));
652
- EXPECT_FALSE(AtomMatchesChar(true, 'w', ' '));
653
- EXPECT_FALSE(AtomMatchesChar(true, 'w', '\n'));
654
-
655
- EXPECT_TRUE(AtomMatchesChar(true, 'w', '0'));
656
- EXPECT_TRUE(AtomMatchesChar(true, 'w', 'b'));
657
- EXPECT_TRUE(AtomMatchesChar(true, 'w', 'C'));
658
- EXPECT_TRUE(AtomMatchesChar(true, 'w', '_'));
659
- }
660
-
661
- TEST(AtomMatchesCharTest, Escaped_W) {
662
- EXPECT_FALSE(AtomMatchesChar(true, 'W', 'A'));
663
- EXPECT_FALSE(AtomMatchesChar(true, 'W', 'b'));
664
- EXPECT_FALSE(AtomMatchesChar(true, 'W', '9'));
665
- EXPECT_FALSE(AtomMatchesChar(true, 'W', '_'));
666
-
667
- EXPECT_TRUE(AtomMatchesChar(true, 'W', '\0'));
668
- EXPECT_TRUE(AtomMatchesChar(true, 'W', '*'));
669
- EXPECT_TRUE(AtomMatchesChar(true, 'W', '\n'));
670
- }
671
-
672
- TEST(AtomMatchesCharTest, EscapedWhiteSpace) {
673
- EXPECT_FALSE(AtomMatchesChar(true, 'f', '\0'));
674
- EXPECT_FALSE(AtomMatchesChar(true, 'f', '\n'));
675
- EXPECT_FALSE(AtomMatchesChar(true, 'n', '\0'));
676
- EXPECT_FALSE(AtomMatchesChar(true, 'n', '\r'));
677
- EXPECT_FALSE(AtomMatchesChar(true, 'r', '\0'));
678
- EXPECT_FALSE(AtomMatchesChar(true, 'r', 'a'));
679
- EXPECT_FALSE(AtomMatchesChar(true, 't', '\0'));
680
- EXPECT_FALSE(AtomMatchesChar(true, 't', 't'));
681
- EXPECT_FALSE(AtomMatchesChar(true, 'v', '\0'));
682
- EXPECT_FALSE(AtomMatchesChar(true, 'v', '\f'));
683
-
684
- EXPECT_TRUE(AtomMatchesChar(true, 'f', '\f'));
685
- EXPECT_TRUE(AtomMatchesChar(true, 'n', '\n'));
686
- EXPECT_TRUE(AtomMatchesChar(true, 'r', '\r'));
687
- EXPECT_TRUE(AtomMatchesChar(true, 't', '\t'));
688
- EXPECT_TRUE(AtomMatchesChar(true, 'v', '\v'));
689
- }
690
-
691
- TEST(AtomMatchesCharTest, UnescapedDot) {
692
- EXPECT_FALSE(AtomMatchesChar(false, '.', '\n'));
693
-
694
- EXPECT_TRUE(AtomMatchesChar(false, '.', '\0'));
695
- EXPECT_TRUE(AtomMatchesChar(false, '.', '.'));
696
- EXPECT_TRUE(AtomMatchesChar(false, '.', 'a'));
697
- EXPECT_TRUE(AtomMatchesChar(false, '.', ' '));
698
- }
699
-
700
- TEST(AtomMatchesCharTest, UnescapedChar) {
701
- EXPECT_FALSE(AtomMatchesChar(false, 'a', '\0'));
702
- EXPECT_FALSE(AtomMatchesChar(false, 'a', 'b'));
703
- EXPECT_FALSE(AtomMatchesChar(false, '$', 'a'));
704
-
705
- EXPECT_TRUE(AtomMatchesChar(false, '$', '$'));
706
- EXPECT_TRUE(AtomMatchesChar(false, '5', '5'));
707
- EXPECT_TRUE(AtomMatchesChar(false, 'Z', 'Z'));
708
- }
709
-
710
- TEST(ValidateRegexTest, GeneratesFailureAndReturnsFalseForInvalid) {
711
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex(NULL)),
712
- "NULL is not a valid simple regular expression");
713
- EXPECT_NONFATAL_FAILURE(
714
- ASSERT_FALSE(ValidateRegex("a\\")),
715
- "Syntax error at index 1 in simple regular expression \"a\\\": ");
716
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("a\\")),
717
- "'\\' cannot appear at the end");
718
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("\\n\\")),
719
- "'\\' cannot appear at the end");
720
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("\\s\\hb")),
721
- "invalid escape sequence \"\\h\"");
722
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("^^")),
723
- "'^' can only appear at the beginning");
724
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex(".*^b")),
725
- "'^' can only appear at the beginning");
726
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("$$")),
727
- "'$' can only appear at the end");
728
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("^$a")),
729
- "'$' can only appear at the end");
730
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("a(b")),
731
- "'(' is unsupported");
732
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("ab)")),
733
- "')' is unsupported");
734
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("[ab")),
735
- "'[' is unsupported");
736
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("a{2")),
737
- "'{' is unsupported");
738
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("?")),
739
- "'?' can only follow a repeatable token");
740
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("^*")),
741
- "'*' can only follow a repeatable token");
742
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("5*+")),
743
- "'+' can only follow a repeatable token");
744
- }
745
-
746
- TEST(ValidateRegexTest, ReturnsTrueForValid) {
747
- EXPECT_TRUE(ValidateRegex(""));
748
- EXPECT_TRUE(ValidateRegex("a"));
749
- EXPECT_TRUE(ValidateRegex(".*"));
750
- EXPECT_TRUE(ValidateRegex("^a_+"));
751
- EXPECT_TRUE(ValidateRegex("^a\\t\\&?"));
752
- EXPECT_TRUE(ValidateRegex("09*$"));
753
- EXPECT_TRUE(ValidateRegex("^Z$"));
754
- EXPECT_TRUE(ValidateRegex("a\\^Z\\$\\(\\)\\|\\[\\]\\{\\}"));
755
- }
756
-
757
- TEST(MatchRepetitionAndRegexAtHeadTest, WorksForZeroOrOne) {
758
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "a", "ba"));
759
- // Repeating more than once.
760
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "b", "aab"));
761
-
762
- // Repeating zero times.
763
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "b", "ba"));
764
- // Repeating once.
765
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "b", "ab"));
766
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '#', '?', ".", "##"));
767
- }
768
-
769
- TEST(MatchRepetitionAndRegexAtHeadTest, WorksForZeroOrMany) {
770
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, '.', '*', "a$", "baab"));
771
-
772
- // Repeating zero times.
773
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '.', '*', "b", "bc"));
774
- // Repeating once.
775
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '.', '*', "b", "abc"));
776
- // Repeating more than once.
777
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(true, 'w', '*', "-", "ab_1-g"));
778
- }
779
-
780
- TEST(MatchRepetitionAndRegexAtHeadTest, WorksForOneOrMany) {
781
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, '.', '+', "a$", "baab"));
782
- // Repeating zero times.
783
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, '.', '+', "b", "bc"));
784
-
785
- // Repeating once.
786
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '.', '+', "b", "abc"));
787
- // Repeating more than once.
788
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(true, 'w', '+', "-", "ab_1-g"));
789
- }
790
-
791
- TEST(MatchRegexAtHeadTest, ReturnsTrueForEmptyRegex) {
792
- EXPECT_TRUE(MatchRegexAtHead("", ""));
793
- EXPECT_TRUE(MatchRegexAtHead("", "ab"));
794
- }
795
-
796
- TEST(MatchRegexAtHeadTest, WorksWhenDollarIsInRegex) {
797
- EXPECT_FALSE(MatchRegexAtHead("$", "a"));
798
-
799
- EXPECT_TRUE(MatchRegexAtHead("$", ""));
800
- EXPECT_TRUE(MatchRegexAtHead("a$", "a"));
801
- }
802
-
803
- TEST(MatchRegexAtHeadTest, WorksWhenRegexStartsWithEscapeSequence) {
804
- EXPECT_FALSE(MatchRegexAtHead("\\w", "+"));
805
- EXPECT_FALSE(MatchRegexAtHead("\\W", "ab"));
806
-
807
- EXPECT_TRUE(MatchRegexAtHead("\\sa", "\nab"));
808
- EXPECT_TRUE(MatchRegexAtHead("\\d", "1a"));
809
- }
810
-
811
- TEST(MatchRegexAtHeadTest, WorksWhenRegexStartsWithRepetition) {
812
- EXPECT_FALSE(MatchRegexAtHead(".+a", "abc"));
813
- EXPECT_FALSE(MatchRegexAtHead("a?b", "aab"));
814
-
815
- EXPECT_TRUE(MatchRegexAtHead(".*a", "bc12-ab"));
816
- EXPECT_TRUE(MatchRegexAtHead("a?b", "b"));
817
- EXPECT_TRUE(MatchRegexAtHead("a?b", "ab"));
818
- }
819
-
820
- TEST(MatchRegexAtHeadTest,
821
- WorksWhenRegexStartsWithRepetionOfEscapeSequence) {
822
- EXPECT_FALSE(MatchRegexAtHead("\\.+a", "abc"));
823
- EXPECT_FALSE(MatchRegexAtHead("\\s?b", " b"));
824
-
825
- EXPECT_TRUE(MatchRegexAtHead("\\(*a", "((((ab"));
826
- EXPECT_TRUE(MatchRegexAtHead("\\^?b", "^b"));
827
- EXPECT_TRUE(MatchRegexAtHead("\\\\?b", "b"));
828
- EXPECT_TRUE(MatchRegexAtHead("\\\\?b", "\\b"));
829
- }
830
-
831
- TEST(MatchRegexAtHeadTest, MatchesSequentially) {
832
- EXPECT_FALSE(MatchRegexAtHead("ab.*c", "acabc"));
833
-
834
- EXPECT_TRUE(MatchRegexAtHead("ab.*c", "ab-fsc"));
835
- }
836
-
837
- TEST(MatchRegexAnywhereTest, ReturnsFalseWhenStringIsNull) {
838
- EXPECT_FALSE(MatchRegexAnywhere("", NULL));
839
- }
840
-
841
- TEST(MatchRegexAnywhereTest, WorksWhenRegexStartsWithCaret) {
842
- EXPECT_FALSE(MatchRegexAnywhere("^a", "ba"));
843
- EXPECT_FALSE(MatchRegexAnywhere("^$", "a"));
844
-
845
- EXPECT_TRUE(MatchRegexAnywhere("^a", "ab"));
846
- EXPECT_TRUE(MatchRegexAnywhere("^", "ab"));
847
- EXPECT_TRUE(MatchRegexAnywhere("^$", ""));
848
- }
849
-
850
- TEST(MatchRegexAnywhereTest, ReturnsFalseWhenNoMatch) {
851
- EXPECT_FALSE(MatchRegexAnywhere("a", "bcde123"));
852
- EXPECT_FALSE(MatchRegexAnywhere("a.+a", "--aa88888888"));
853
- }
854
-
855
- TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingPrefix) {
856
- EXPECT_TRUE(MatchRegexAnywhere("\\w+", "ab1_ - 5"));
857
- EXPECT_TRUE(MatchRegexAnywhere(".*=", "="));
858
- EXPECT_TRUE(MatchRegexAnywhere("x.*ab?.*bc", "xaaabc"));
859
- }
860
-
861
- TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingNonPrefix) {
862
- EXPECT_TRUE(MatchRegexAnywhere("\\w+", "$$$ ab1_ - 5"));
863
- EXPECT_TRUE(MatchRegexAnywhere("\\.+=", "= ...="));
864
- }
865
-
866
- // Tests RE's implicit constructors.
867
- TEST(RETest, ImplicitConstructorWorks) {
868
- const RE empty("");
869
- EXPECT_STREQ("", empty.pattern());
870
-
871
- const RE simple("hello");
872
- EXPECT_STREQ("hello", simple.pattern());
873
- }
874
-
875
- // Tests that RE's constructors reject invalid regular expressions.
876
- TEST(RETest, RejectsInvalidRegex) {
877
- EXPECT_NONFATAL_FAILURE({
878
- const RE normal(NULL);
879
- }, "NULL is not a valid simple regular expression");
880
-
881
- EXPECT_NONFATAL_FAILURE({
882
- const RE normal(".*(\\w+");
883
- }, "'(' is unsupported");
884
-
885
- EXPECT_NONFATAL_FAILURE({
886
- const RE invalid("^?");
887
- }, "'?' can only follow a repeatable token");
888
- }
889
-
890
- // Tests RE::FullMatch().
891
- TEST(RETest, FullMatchWorks) {
892
- const RE empty("");
893
- EXPECT_TRUE(RE::FullMatch("", empty));
894
- EXPECT_FALSE(RE::FullMatch("a", empty));
895
-
896
- const RE re1("a");
897
- EXPECT_TRUE(RE::FullMatch("a", re1));
898
-
899
- const RE re("a.*z");
900
- EXPECT_TRUE(RE::FullMatch("az", re));
901
- EXPECT_TRUE(RE::FullMatch("axyz", re));
902
- EXPECT_FALSE(RE::FullMatch("baz", re));
903
- EXPECT_FALSE(RE::FullMatch("azy", re));
904
- }
905
-
906
- // Tests RE::PartialMatch().
907
- TEST(RETest, PartialMatchWorks) {
908
- const RE empty("");
909
- EXPECT_TRUE(RE::PartialMatch("", empty));
910
- EXPECT_TRUE(RE::PartialMatch("a", empty));
911
-
912
- const RE re("a.*z");
913
- EXPECT_TRUE(RE::PartialMatch("az", re));
914
- EXPECT_TRUE(RE::PartialMatch("axyz", re));
915
- EXPECT_TRUE(RE::PartialMatch("baz", re));
916
- EXPECT_TRUE(RE::PartialMatch("azy", re));
917
- EXPECT_FALSE(RE::PartialMatch("zza", re));
918
- }
919
-
920
- #endif // GTEST_USES_POSIX_RE
921
-
922
- #if !GTEST_OS_WINDOWS_MOBILE
923
-
924
- TEST(CaptureTest, CapturesStdout) {
925
- CaptureStdout();
926
- fprintf(stdout, "abc");
927
- EXPECT_STREQ("abc", GetCapturedStdout().c_str());
928
-
929
- CaptureStdout();
930
- fprintf(stdout, "def%cghi", '\0');
931
- EXPECT_EQ(::std::string("def\0ghi", 7), ::std::string(GetCapturedStdout()));
932
- }
933
-
934
- TEST(CaptureTest, CapturesStderr) {
935
- CaptureStderr();
936
- fprintf(stderr, "jkl");
937
- EXPECT_STREQ("jkl", GetCapturedStderr().c_str());
938
-
939
- CaptureStderr();
940
- fprintf(stderr, "jkl%cmno", '\0');
941
- EXPECT_EQ(::std::string("jkl\0mno", 7), ::std::string(GetCapturedStderr()));
942
- }
943
-
944
- // Tests that stdout and stderr capture don't interfere with each other.
945
- TEST(CaptureTest, CapturesStdoutAndStderr) {
946
- CaptureStdout();
947
- CaptureStderr();
948
- fprintf(stdout, "pqr");
949
- fprintf(stderr, "stu");
950
- EXPECT_STREQ("pqr", GetCapturedStdout().c_str());
951
- EXPECT_STREQ("stu", GetCapturedStderr().c_str());
952
- }
953
-
954
- TEST(CaptureDeathTest, CannotReenterStdoutCapture) {
955
- CaptureStdout();
956
- EXPECT_DEATH_IF_SUPPORTED(CaptureStdout(),
957
- "Only one stdout capturer can exist at a time");
958
- GetCapturedStdout();
959
-
960
- // We cannot test stderr capturing using death tests as they use it
961
- // themselves.
962
- }
963
-
964
- #endif // !GTEST_OS_WINDOWS_MOBILE
965
-
966
- TEST(ThreadLocalTest, DefaultConstructorInitializesToDefaultValues) {
967
- ThreadLocal<int> t1;
968
- EXPECT_EQ(0, t1.get());
969
-
970
- ThreadLocal<void*> t2;
971
- EXPECT_TRUE(t2.get() == NULL);
972
- }
973
-
974
- TEST(ThreadLocalTest, SingleParamConstructorInitializesToParam) {
975
- ThreadLocal<int> t1(123);
976
- EXPECT_EQ(123, t1.get());
977
-
978
- int i = 0;
979
- ThreadLocal<int*> t2(&i);
980
- EXPECT_EQ(&i, t2.get());
981
- }
982
-
983
- class NoDefaultContructor {
984
- public:
985
- explicit NoDefaultContructor(const char*) {}
986
- NoDefaultContructor(const NoDefaultContructor&) {}
987
- };
988
-
989
- TEST(ThreadLocalTest, ValueDefaultContructorIsNotRequiredForParamVersion) {
990
- ThreadLocal<NoDefaultContructor> bar(NoDefaultContructor("foo"));
991
- bar.pointer();
992
- }
993
-
994
- TEST(ThreadLocalTest, GetAndPointerReturnSameValue) {
995
- ThreadLocal<std::string> thread_local_string;
996
-
997
- EXPECT_EQ(thread_local_string.pointer(), &(thread_local_string.get()));
998
-
999
- // Verifies the condition still holds after calling set.
1000
- thread_local_string.set("foo");
1001
- EXPECT_EQ(thread_local_string.pointer(), &(thread_local_string.get()));
1002
- }
1003
-
1004
- TEST(ThreadLocalTest, PointerAndConstPointerReturnSameValue) {
1005
- ThreadLocal<std::string> thread_local_string;
1006
- const ThreadLocal<std::string>& const_thread_local_string =
1007
- thread_local_string;
1008
-
1009
- EXPECT_EQ(thread_local_string.pointer(), const_thread_local_string.pointer());
1010
-
1011
- thread_local_string.set("foo");
1012
- EXPECT_EQ(thread_local_string.pointer(), const_thread_local_string.pointer());
1013
- }
1014
-
1015
- #if GTEST_IS_THREADSAFE
1016
-
1017
- void AddTwo(int* param) { *param += 2; }
1018
-
1019
- TEST(ThreadWithParamTest, ConstructorExecutesThreadFunc) {
1020
- int i = 40;
1021
- ThreadWithParam<int*> thread(&AddTwo, &i, NULL);
1022
- thread.Join();
1023
- EXPECT_EQ(42, i);
1024
- }
1025
-
1026
- TEST(MutexDeathTest, AssertHeldShouldAssertWhenNotLocked) {
1027
- // AssertHeld() is flaky only in the presence of multiple threads accessing
1028
- // the lock. In this case, the test is robust.
1029
- EXPECT_DEATH_IF_SUPPORTED({
1030
- Mutex m;
1031
- { MutexLock lock(&m); }
1032
- m.AssertHeld();
1033
- },
1034
- "thread .*hold");
1035
- }
1036
-
1037
- TEST(MutexTest, AssertHeldShouldNotAssertWhenLocked) {
1038
- Mutex m;
1039
- MutexLock lock(&m);
1040
- m.AssertHeld();
1041
- }
1042
-
1043
- class AtomicCounterWithMutex {
1044
- public:
1045
- explicit AtomicCounterWithMutex(Mutex* mutex) :
1046
- value_(0), mutex_(mutex), random_(42) {}
1047
-
1048
- void Increment() {
1049
- MutexLock lock(mutex_);
1050
- int temp = value_;
1051
- {
1052
- // We need to put up a memory barrier to prevent reads and writes to
1053
- // value_ rearranged with the call to SleepMilliseconds when observed
1054
- // from other threads.
1055
- #if GTEST_HAS_PTHREAD
1056
- // On POSIX, locking a mutex puts up a memory barrier. We cannot use
1057
- // Mutex and MutexLock here or rely on their memory barrier
1058
- // functionality as we are testing them here.
1059
- pthread_mutex_t memory_barrier_mutex;
1060
- GTEST_CHECK_POSIX_SUCCESS_(
1061
- pthread_mutex_init(&memory_barrier_mutex, NULL));
1062
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&memory_barrier_mutex));
1063
-
1064
- SleepMilliseconds(random_.Generate(30));
1065
-
1066
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&memory_barrier_mutex));
1067
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&memory_barrier_mutex));
1068
- #elif GTEST_OS_WINDOWS
1069
- // On Windows, performing an interlocked access puts up a memory barrier.
1070
- volatile LONG dummy = 0;
1071
- ::InterlockedIncrement(&dummy);
1072
- SleepMilliseconds(random_.Generate(30));
1073
- ::InterlockedIncrement(&dummy);
1074
- #else
1075
- # error "Memory barrier not implemented on this platform."
1076
- #endif // GTEST_HAS_PTHREAD
1077
- }
1078
- value_ = temp + 1;
1079
- }
1080
- int value() const { return value_; }
1081
-
1082
- private:
1083
- volatile int value_;
1084
- Mutex* const mutex_; // Protects value_.
1085
- Random random_;
1086
- };
1087
-
1088
- void CountingThreadFunc(pair<AtomicCounterWithMutex*, int> param) {
1089
- for (int i = 0; i < param.second; ++i)
1090
- param.first->Increment();
1091
- }
1092
-
1093
- // Tests that the mutex only lets one thread at a time to lock it.
1094
- TEST(MutexTest, OnlyOneThreadCanLockAtATime) {
1095
- Mutex mutex;
1096
- AtomicCounterWithMutex locked_counter(&mutex);
1097
-
1098
- typedef ThreadWithParam<pair<AtomicCounterWithMutex*, int> > ThreadType;
1099
- const int kCycleCount = 20;
1100
- const int kThreadCount = 7;
1101
- scoped_ptr<ThreadType> counting_threads[kThreadCount];
1102
- Notification threads_can_start;
1103
- // Creates and runs kThreadCount threads that increment locked_counter
1104
- // kCycleCount times each.
1105
- for (int i = 0; i < kThreadCount; ++i) {
1106
- counting_threads[i].reset(new ThreadType(&CountingThreadFunc,
1107
- make_pair(&locked_counter,
1108
- kCycleCount),
1109
- &threads_can_start));
1110
- }
1111
- threads_can_start.Notify();
1112
- for (int i = 0; i < kThreadCount; ++i)
1113
- counting_threads[i]->Join();
1114
-
1115
- // If the mutex lets more than one thread to increment the counter at a
1116
- // time, they are likely to encounter a race condition and have some
1117
- // increments overwritten, resulting in the lower then expected counter
1118
- // value.
1119
- EXPECT_EQ(kCycleCount * kThreadCount, locked_counter.value());
1120
- }
1121
-
1122
- template <typename T>
1123
- void RunFromThread(void (func)(T), T param) {
1124
- ThreadWithParam<T> thread(func, param, NULL);
1125
- thread.Join();
1126
- }
1127
-
1128
- void RetrieveThreadLocalValue(
1129
- pair<ThreadLocal<std::string>*, std::string*> param) {
1130
- *param.second = param.first->get();
1131
- }
1132
-
1133
- TEST(ThreadLocalTest, ParameterizedConstructorSetsDefault) {
1134
- ThreadLocal<std::string> thread_local_string("foo");
1135
- EXPECT_STREQ("foo", thread_local_string.get().c_str());
1136
-
1137
- thread_local_string.set("bar");
1138
- EXPECT_STREQ("bar", thread_local_string.get().c_str());
1139
-
1140
- std::string result;
1141
- RunFromThread(&RetrieveThreadLocalValue,
1142
- make_pair(&thread_local_string, &result));
1143
- EXPECT_STREQ("foo", result.c_str());
1144
- }
1145
-
1146
- // Keeps track of whether of destructors being called on instances of
1147
- // DestructorTracker. On Windows, waits for the destructor call reports.
1148
- class DestructorCall {
1149
- public:
1150
- DestructorCall() {
1151
- invoked_ = false;
1152
- #if GTEST_OS_WINDOWS
1153
- wait_event_.Reset(::CreateEvent(NULL, TRUE, FALSE, NULL));
1154
- GTEST_CHECK_(wait_event_.Get() != NULL);
1155
- #endif
1156
- }
1157
-
1158
- bool CheckDestroyed() const {
1159
- #if GTEST_OS_WINDOWS
1160
- if (::WaitForSingleObject(wait_event_.Get(), 1000) != WAIT_OBJECT_0)
1161
- return false;
1162
- #endif
1163
- return invoked_;
1164
- }
1165
-
1166
- void ReportDestroyed() {
1167
- invoked_ = true;
1168
- #if GTEST_OS_WINDOWS
1169
- ::SetEvent(wait_event_.Get());
1170
- #endif
1171
- }
1172
-
1173
- static std::vector<DestructorCall*>& List() { return *list_; }
1174
-
1175
- static void ResetList() {
1176
- for (size_t i = 0; i < list_->size(); ++i) {
1177
- delete list_->at(i);
1178
- }
1179
- list_->clear();
1180
- }
1181
-
1182
- private:
1183
- bool invoked_;
1184
- #if GTEST_OS_WINDOWS
1185
- AutoHandle wait_event_;
1186
- #endif
1187
- static std::vector<DestructorCall*>* const list_;
1188
-
1189
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DestructorCall);
1190
- };
1191
-
1192
- std::vector<DestructorCall*>* const DestructorCall::list_ =
1193
- new std::vector<DestructorCall*>;
1194
-
1195
- // DestructorTracker keeps track of whether its instances have been
1196
- // destroyed.
1197
- class DestructorTracker {
1198
- public:
1199
- DestructorTracker() : index_(GetNewIndex()) {}
1200
- DestructorTracker(const DestructorTracker& /* rhs */)
1201
- : index_(GetNewIndex()) {}
1202
- ~DestructorTracker() {
1203
- // We never access DestructorCall::List() concurrently, so we don't need
1204
- // to protect this access with a mutex.
1205
- DestructorCall::List()[index_]->ReportDestroyed();
1206
- }
1207
-
1208
- private:
1209
- static size_t GetNewIndex() {
1210
- DestructorCall::List().push_back(new DestructorCall);
1211
- return DestructorCall::List().size() - 1;
1212
- }
1213
- const size_t index_;
1214
-
1215
- GTEST_DISALLOW_ASSIGN_(DestructorTracker);
1216
- };
1217
-
1218
- typedef ThreadLocal<DestructorTracker>* ThreadParam;
1219
-
1220
- void CallThreadLocalGet(ThreadParam thread_local_param) {
1221
- thread_local_param->get();
1222
- }
1223
-
1224
- // Tests that when a ThreadLocal object dies in a thread, it destroys
1225
- // the managed object for that thread.
1226
- TEST(ThreadLocalTest, DestroysManagedObjectForOwnThreadWhenDying) {
1227
- DestructorCall::ResetList();
1228
-
1229
- {
1230
- ThreadLocal<DestructorTracker> thread_local_tracker;
1231
- ASSERT_EQ(0U, DestructorCall::List().size());
1232
-
1233
- // This creates another DestructorTracker object for the main thread.
1234
- thread_local_tracker.get();
1235
- ASSERT_EQ(1U, DestructorCall::List().size());
1236
- ASSERT_FALSE(DestructorCall::List()[0]->CheckDestroyed());
1237
- }
1238
-
1239
- // Now thread_local_tracker has died.
1240
- ASSERT_EQ(1U, DestructorCall::List().size());
1241
- EXPECT_TRUE(DestructorCall::List()[0]->CheckDestroyed());
1242
-
1243
- DestructorCall::ResetList();
1244
- }
1245
-
1246
- // Tests that when a thread exits, the thread-local object for that
1247
- // thread is destroyed.
1248
- TEST(ThreadLocalTest, DestroysManagedObjectAtThreadExit) {
1249
- DestructorCall::ResetList();
1250
-
1251
- {
1252
- ThreadLocal<DestructorTracker> thread_local_tracker;
1253
- ASSERT_EQ(0U, DestructorCall::List().size());
1254
-
1255
- // This creates another DestructorTracker object in the new thread.
1256
- ThreadWithParam<ThreadParam> thread(
1257
- &CallThreadLocalGet, &thread_local_tracker, NULL);
1258
- thread.Join();
1259
-
1260
- // The thread has exited, and we should have a DestroyedTracker
1261
- // instance created for it. But it may not have been destroyed yet.
1262
- ASSERT_EQ(1U, DestructorCall::List().size());
1263
- }
1264
-
1265
- // The thread has exited and thread_local_tracker has died.
1266
- ASSERT_EQ(1U, DestructorCall::List().size());
1267
- EXPECT_TRUE(DestructorCall::List()[0]->CheckDestroyed());
1268
-
1269
- DestructorCall::ResetList();
1270
- }
1271
-
1272
- TEST(ThreadLocalTest, ThreadLocalMutationsAffectOnlyCurrentThread) {
1273
- ThreadLocal<std::string> thread_local_string;
1274
- thread_local_string.set("Foo");
1275
- EXPECT_STREQ("Foo", thread_local_string.get().c_str());
1276
-
1277
- std::string result;
1278
- RunFromThread(&RetrieveThreadLocalValue,
1279
- make_pair(&thread_local_string, &result));
1280
- EXPECT_TRUE(result.empty());
1281
- }
1282
-
1283
- #endif // GTEST_IS_THREADSAFE
1284
-
1285
- #if GTEST_OS_WINDOWS
1286
- TEST(WindowsTypesTest, HANDLEIsVoidStar) {
1287
- StaticAssertTypeEq<HANDLE, void*>();
1288
- }
1289
-
1290
- #if GTEST_OS_WINDOWS_MINGW && !defined(__MINGW64_VERSION_MAJOR)
1291
- TEST(WindowsTypesTest, _CRITICAL_SECTIONIs_CRITICAL_SECTION) {
1292
- StaticAssertTypeEq<CRITICAL_SECTION, _CRITICAL_SECTION>();
1293
- }
1294
- #else
1295
- TEST(WindowsTypesTest, CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION) {
1296
- StaticAssertTypeEq<CRITICAL_SECTION, _RTL_CRITICAL_SECTION>();
1297
- }
1298
- #endif
1299
-
1300
- #endif // GTEST_OS_WINDOWS
1301
-
1302
- } // namespace internal
1303
- } // namespace testing