@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,1575 +0,0 @@
1
- // Copyright 2007, Google Inc.
2
- // All rights reserved.
3
- //
4
- // Redistribution and use in source and binary forms, with or without
5
- // modification, are permitted provided that the following conditions are
6
- // met:
7
- //
8
- // * Redistributions of source code must retain the above copyright
9
- // notice, this list of conditions and the following disclaimer.
10
- // * Redistributions in binary form must reproduce the above
11
- // copyright notice, this list of conditions and the following disclaimer
12
- // in the documentation and/or other materials provided with the
13
- // distribution.
14
- // * Neither the name of Google Inc. nor the names of its
15
- // contributors may be used to endorse or promote products derived from
16
- // this software without specific prior written permission.
17
- //
18
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
- //
30
- // Author: wan@google.com (Zhanyong Wan)
31
-
32
- // Google Mock - a framework for writing C++ mock classes.
33
- //
34
- // This file tests the built-in actions.
35
-
36
- // Silence C4800 (C4800: 'int *const ': forcing value
37
- // to bool 'true' or 'false') for MSVC 14,15
38
- #ifdef _MSC_VER
39
- #if _MSC_VER <= 1900
40
- # pragma warning(push)
41
- # pragma warning(disable:4800)
42
- #endif
43
- #endif
44
-
45
- #include "gmock/gmock-actions.h"
46
- #include <algorithm>
47
- #include <iterator>
48
- #include <memory>
49
- #include <string>
50
- #include "gmock/gmock.h"
51
- #include "gmock/internal/gmock-port.h"
52
- #include "gtest/gtest.h"
53
- #include "gtest/gtest-spi.h"
54
-
55
- namespace {
56
-
57
- // This list should be kept sorted.
58
- using testing::Action;
59
- using testing::ActionInterface;
60
- using testing::Assign;
61
- using testing::ByMove;
62
- using testing::ByRef;
63
- using testing::DefaultValue;
64
- using testing::DoDefault;
65
- using testing::IgnoreResult;
66
- using testing::Invoke;
67
- using testing::InvokeWithoutArgs;
68
- using testing::MakePolymorphicAction;
69
- using testing::Ne;
70
- using testing::PolymorphicAction;
71
- using testing::Return;
72
- using testing::ReturnNull;
73
- using testing::ReturnRef;
74
- using testing::ReturnRefOfCopy;
75
- using testing::SetArgPointee;
76
- using testing::SetArgumentPointee;
77
- using testing::Unused;
78
- using testing::_;
79
- using testing::get;
80
- using testing::internal::BuiltInDefaultValue;
81
- using testing::internal::Int64;
82
- using testing::internal::UInt64;
83
- using testing::make_tuple;
84
- using testing::tuple;
85
- using testing::tuple_element;
86
-
87
- #if !GTEST_OS_WINDOWS_MOBILE
88
- using testing::SetErrnoAndReturn;
89
- #endif
90
-
91
- #if GTEST_HAS_PROTOBUF_
92
- using testing::internal::TestMessage;
93
- #endif // GTEST_HAS_PROTOBUF_
94
-
95
- // Tests that BuiltInDefaultValue<T*>::Get() returns NULL.
96
- TEST(BuiltInDefaultValueTest, IsNullForPointerTypes) {
97
- EXPECT_TRUE(BuiltInDefaultValue<int*>::Get() == NULL);
98
- EXPECT_TRUE(BuiltInDefaultValue<const char*>::Get() == NULL);
99
- EXPECT_TRUE(BuiltInDefaultValue<void*>::Get() == NULL);
100
- }
101
-
102
- // Tests that BuiltInDefaultValue<T*>::Exists() return true.
103
- TEST(BuiltInDefaultValueTest, ExistsForPointerTypes) {
104
- EXPECT_TRUE(BuiltInDefaultValue<int*>::Exists());
105
- EXPECT_TRUE(BuiltInDefaultValue<const char*>::Exists());
106
- EXPECT_TRUE(BuiltInDefaultValue<void*>::Exists());
107
- }
108
-
109
- // Tests that BuiltInDefaultValue<T>::Get() returns 0 when T is a
110
- // built-in numeric type.
111
- TEST(BuiltInDefaultValueTest, IsZeroForNumericTypes) {
112
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned char>::Get());
113
- EXPECT_EQ(0, BuiltInDefaultValue<signed char>::Get());
114
- EXPECT_EQ(0, BuiltInDefaultValue<char>::Get());
115
- #if GMOCK_HAS_SIGNED_WCHAR_T_
116
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned wchar_t>::Get());
117
- EXPECT_EQ(0, BuiltInDefaultValue<signed wchar_t>::Get());
118
- #endif
119
- #if GMOCK_WCHAR_T_IS_NATIVE_
120
- #if !defined(__WCHAR_UNSIGNED__)
121
- EXPECT_EQ(0, BuiltInDefaultValue<wchar_t>::Get());
122
- #else
123
- EXPECT_EQ(0U, BuiltInDefaultValue<wchar_t>::Get());
124
- #endif
125
- #endif
126
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned short>::Get()); // NOLINT
127
- EXPECT_EQ(0, BuiltInDefaultValue<signed short>::Get()); // NOLINT
128
- EXPECT_EQ(0, BuiltInDefaultValue<short>::Get()); // NOLINT
129
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned int>::Get());
130
- EXPECT_EQ(0, BuiltInDefaultValue<signed int>::Get());
131
- EXPECT_EQ(0, BuiltInDefaultValue<int>::Get());
132
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned long>::Get()); // NOLINT
133
- EXPECT_EQ(0, BuiltInDefaultValue<signed long>::Get()); // NOLINT
134
- EXPECT_EQ(0, BuiltInDefaultValue<long>::Get()); // NOLINT
135
- EXPECT_EQ(0U, BuiltInDefaultValue<UInt64>::Get());
136
- EXPECT_EQ(0, BuiltInDefaultValue<Int64>::Get());
137
- EXPECT_EQ(0, BuiltInDefaultValue<float>::Get());
138
- EXPECT_EQ(0, BuiltInDefaultValue<double>::Get());
139
- }
140
-
141
- // Tests that BuiltInDefaultValue<T>::Exists() returns true when T is a
142
- // built-in numeric type.
143
- TEST(BuiltInDefaultValueTest, ExistsForNumericTypes) {
144
- EXPECT_TRUE(BuiltInDefaultValue<unsigned char>::Exists());
145
- EXPECT_TRUE(BuiltInDefaultValue<signed char>::Exists());
146
- EXPECT_TRUE(BuiltInDefaultValue<char>::Exists());
147
- #if GMOCK_HAS_SIGNED_WCHAR_T_
148
- EXPECT_TRUE(BuiltInDefaultValue<unsigned wchar_t>::Exists());
149
- EXPECT_TRUE(BuiltInDefaultValue<signed wchar_t>::Exists());
150
- #endif
151
- #if GMOCK_WCHAR_T_IS_NATIVE_
152
- EXPECT_TRUE(BuiltInDefaultValue<wchar_t>::Exists());
153
- #endif
154
- EXPECT_TRUE(BuiltInDefaultValue<unsigned short>::Exists()); // NOLINT
155
- EXPECT_TRUE(BuiltInDefaultValue<signed short>::Exists()); // NOLINT
156
- EXPECT_TRUE(BuiltInDefaultValue<short>::Exists()); // NOLINT
157
- EXPECT_TRUE(BuiltInDefaultValue<unsigned int>::Exists());
158
- EXPECT_TRUE(BuiltInDefaultValue<signed int>::Exists());
159
- EXPECT_TRUE(BuiltInDefaultValue<int>::Exists());
160
- EXPECT_TRUE(BuiltInDefaultValue<unsigned long>::Exists()); // NOLINT
161
- EXPECT_TRUE(BuiltInDefaultValue<signed long>::Exists()); // NOLINT
162
- EXPECT_TRUE(BuiltInDefaultValue<long>::Exists()); // NOLINT
163
- EXPECT_TRUE(BuiltInDefaultValue<UInt64>::Exists());
164
- EXPECT_TRUE(BuiltInDefaultValue<Int64>::Exists());
165
- EXPECT_TRUE(BuiltInDefaultValue<float>::Exists());
166
- EXPECT_TRUE(BuiltInDefaultValue<double>::Exists());
167
- }
168
-
169
- // Tests that BuiltInDefaultValue<bool>::Get() returns false.
170
- TEST(BuiltInDefaultValueTest, IsFalseForBool) {
171
- EXPECT_FALSE(BuiltInDefaultValue<bool>::Get());
172
- }
173
-
174
- // Tests that BuiltInDefaultValue<bool>::Exists() returns true.
175
- TEST(BuiltInDefaultValueTest, BoolExists) {
176
- EXPECT_TRUE(BuiltInDefaultValue<bool>::Exists());
177
- }
178
-
179
- // Tests that BuiltInDefaultValue<T>::Get() returns "" when T is a
180
- // string type.
181
- TEST(BuiltInDefaultValueTest, IsEmptyStringForString) {
182
- #if GTEST_HAS_GLOBAL_STRING
183
- EXPECT_EQ("", BuiltInDefaultValue< ::string>::Get());
184
- #endif // GTEST_HAS_GLOBAL_STRING
185
-
186
- EXPECT_EQ("", BuiltInDefaultValue< ::std::string>::Get());
187
- }
188
-
189
- // Tests that BuiltInDefaultValue<T>::Exists() returns true when T is a
190
- // string type.
191
- TEST(BuiltInDefaultValueTest, ExistsForString) {
192
- #if GTEST_HAS_GLOBAL_STRING
193
- EXPECT_TRUE(BuiltInDefaultValue< ::string>::Exists());
194
- #endif // GTEST_HAS_GLOBAL_STRING
195
-
196
- EXPECT_TRUE(BuiltInDefaultValue< ::std::string>::Exists());
197
- }
198
-
199
- // Tests that BuiltInDefaultValue<const T>::Get() returns the same
200
- // value as BuiltInDefaultValue<T>::Get() does.
201
- TEST(BuiltInDefaultValueTest, WorksForConstTypes) {
202
- EXPECT_EQ("", BuiltInDefaultValue<const std::string>::Get());
203
- EXPECT_EQ(0, BuiltInDefaultValue<const int>::Get());
204
- EXPECT_TRUE(BuiltInDefaultValue<char* const>::Get() == NULL);
205
- EXPECT_FALSE(BuiltInDefaultValue<const bool>::Get());
206
- }
207
-
208
- // A type that's default constructible.
209
- class MyDefaultConstructible {
210
- public:
211
- MyDefaultConstructible() : value_(42) {}
212
-
213
- int value() const { return value_; }
214
-
215
- private:
216
- int value_;
217
- };
218
-
219
- // A type that's not default constructible.
220
- class MyNonDefaultConstructible {
221
- public:
222
- // Does not have a default ctor.
223
- explicit MyNonDefaultConstructible(int a_value) : value_(a_value) {}
224
-
225
- int value() const { return value_; }
226
-
227
- private:
228
- int value_;
229
- };
230
-
231
- #if GTEST_LANG_CXX11
232
-
233
- TEST(BuiltInDefaultValueTest, ExistsForDefaultConstructibleType) {
234
- EXPECT_TRUE(BuiltInDefaultValue<MyDefaultConstructible>::Exists());
235
- }
236
-
237
- TEST(BuiltInDefaultValueTest, IsDefaultConstructedForDefaultConstructibleType) {
238
- EXPECT_EQ(42, BuiltInDefaultValue<MyDefaultConstructible>::Get().value());
239
- }
240
-
241
- #endif // GTEST_LANG_CXX11
242
-
243
- TEST(BuiltInDefaultValueTest, DoesNotExistForNonDefaultConstructibleType) {
244
- EXPECT_FALSE(BuiltInDefaultValue<MyNonDefaultConstructible>::Exists());
245
- }
246
-
247
- // Tests that BuiltInDefaultValue<T&>::Get() aborts the program.
248
- TEST(BuiltInDefaultValueDeathTest, IsUndefinedForReferences) {
249
- EXPECT_DEATH_IF_SUPPORTED({
250
- BuiltInDefaultValue<int&>::Get();
251
- }, "");
252
- EXPECT_DEATH_IF_SUPPORTED({
253
- BuiltInDefaultValue<const char&>::Get();
254
- }, "");
255
- }
256
-
257
- TEST(BuiltInDefaultValueDeathTest, IsUndefinedForNonDefaultConstructibleType) {
258
- EXPECT_DEATH_IF_SUPPORTED({
259
- BuiltInDefaultValue<MyNonDefaultConstructible>::Get();
260
- }, "");
261
- }
262
-
263
- // Tests that DefaultValue<T>::IsSet() is false initially.
264
- TEST(DefaultValueTest, IsInitiallyUnset) {
265
- EXPECT_FALSE(DefaultValue<int>::IsSet());
266
- EXPECT_FALSE(DefaultValue<MyDefaultConstructible>::IsSet());
267
- EXPECT_FALSE(DefaultValue<const MyNonDefaultConstructible>::IsSet());
268
- }
269
-
270
- // Tests that DefaultValue<T> can be set and then unset.
271
- TEST(DefaultValueTest, CanBeSetAndUnset) {
272
- EXPECT_TRUE(DefaultValue<int>::Exists());
273
- EXPECT_FALSE(DefaultValue<const MyNonDefaultConstructible>::Exists());
274
-
275
- DefaultValue<int>::Set(1);
276
- DefaultValue<const MyNonDefaultConstructible>::Set(
277
- MyNonDefaultConstructible(42));
278
-
279
- EXPECT_EQ(1, DefaultValue<int>::Get());
280
- EXPECT_EQ(42, DefaultValue<const MyNonDefaultConstructible>::Get().value());
281
-
282
- EXPECT_TRUE(DefaultValue<int>::Exists());
283
- EXPECT_TRUE(DefaultValue<const MyNonDefaultConstructible>::Exists());
284
-
285
- DefaultValue<int>::Clear();
286
- DefaultValue<const MyNonDefaultConstructible>::Clear();
287
-
288
- EXPECT_FALSE(DefaultValue<int>::IsSet());
289
- EXPECT_FALSE(DefaultValue<const MyNonDefaultConstructible>::IsSet());
290
-
291
- EXPECT_TRUE(DefaultValue<int>::Exists());
292
- EXPECT_FALSE(DefaultValue<const MyNonDefaultConstructible>::Exists());
293
- }
294
-
295
- // Tests that DefaultValue<T>::Get() returns the
296
- // BuiltInDefaultValue<T>::Get() when DefaultValue<T>::IsSet() is
297
- // false.
298
- TEST(DefaultValueDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {
299
- EXPECT_FALSE(DefaultValue<int>::IsSet());
300
- EXPECT_TRUE(DefaultValue<int>::Exists());
301
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible>::IsSet());
302
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible>::Exists());
303
-
304
- EXPECT_EQ(0, DefaultValue<int>::Get());
305
-
306
- EXPECT_DEATH_IF_SUPPORTED({
307
- DefaultValue<MyNonDefaultConstructible>::Get();
308
- }, "");
309
- }
310
-
311
- #if GTEST_HAS_STD_UNIQUE_PTR_
312
- TEST(DefaultValueTest, GetWorksForMoveOnlyIfSet) {
313
- EXPECT_TRUE(DefaultValue<std::unique_ptr<int>>::Exists());
314
- EXPECT_TRUE(DefaultValue<std::unique_ptr<int>>::Get() == NULL);
315
- DefaultValue<std::unique_ptr<int>>::SetFactory([] {
316
- return std::unique_ptr<int>(new int(42));
317
- });
318
- EXPECT_TRUE(DefaultValue<std::unique_ptr<int>>::Exists());
319
- std::unique_ptr<int> i = DefaultValue<std::unique_ptr<int>>::Get();
320
- EXPECT_EQ(42, *i);
321
- }
322
- #endif // GTEST_HAS_STD_UNIQUE_PTR_
323
-
324
- // Tests that DefaultValue<void>::Get() returns void.
325
- TEST(DefaultValueTest, GetWorksForVoid) {
326
- return DefaultValue<void>::Get();
327
- }
328
-
329
- // Tests using DefaultValue with a reference type.
330
-
331
- // Tests that DefaultValue<T&>::IsSet() is false initially.
332
- TEST(DefaultValueOfReferenceTest, IsInitiallyUnset) {
333
- EXPECT_FALSE(DefaultValue<int&>::IsSet());
334
- EXPECT_FALSE(DefaultValue<MyDefaultConstructible&>::IsSet());
335
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::IsSet());
336
- }
337
-
338
- // Tests that DefaultValue<T&>::Exists is false initiallly.
339
- TEST(DefaultValueOfReferenceTest, IsInitiallyNotExisting) {
340
- EXPECT_FALSE(DefaultValue<int&>::Exists());
341
- EXPECT_FALSE(DefaultValue<MyDefaultConstructible&>::Exists());
342
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::Exists());
343
- }
344
-
345
- // Tests that DefaultValue<T&> can be set and then unset.
346
- TEST(DefaultValueOfReferenceTest, CanBeSetAndUnset) {
347
- int n = 1;
348
- DefaultValue<const int&>::Set(n);
349
- MyNonDefaultConstructible x(42);
350
- DefaultValue<MyNonDefaultConstructible&>::Set(x);
351
-
352
- EXPECT_TRUE(DefaultValue<const int&>::Exists());
353
- EXPECT_TRUE(DefaultValue<MyNonDefaultConstructible&>::Exists());
354
-
355
- EXPECT_EQ(&n, &(DefaultValue<const int&>::Get()));
356
- EXPECT_EQ(&x, &(DefaultValue<MyNonDefaultConstructible&>::Get()));
357
-
358
- DefaultValue<const int&>::Clear();
359
- DefaultValue<MyNonDefaultConstructible&>::Clear();
360
-
361
- EXPECT_FALSE(DefaultValue<const int&>::Exists());
362
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::Exists());
363
-
364
- EXPECT_FALSE(DefaultValue<const int&>::IsSet());
365
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::IsSet());
366
- }
367
-
368
- // Tests that DefaultValue<T&>::Get() returns the
369
- // BuiltInDefaultValue<T&>::Get() when DefaultValue<T&>::IsSet() is
370
- // false.
371
- TEST(DefaultValueOfReferenceDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {
372
- EXPECT_FALSE(DefaultValue<int&>::IsSet());
373
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::IsSet());
374
-
375
- EXPECT_DEATH_IF_SUPPORTED({
376
- DefaultValue<int&>::Get();
377
- }, "");
378
- EXPECT_DEATH_IF_SUPPORTED({
379
- DefaultValue<MyNonDefaultConstructible>::Get();
380
- }, "");
381
- }
382
-
383
- // Tests that ActionInterface can be implemented by defining the
384
- // Perform method.
385
-
386
- typedef int MyGlobalFunction(bool, int);
387
-
388
- class MyActionImpl : public ActionInterface<MyGlobalFunction> {
389
- public:
390
- virtual int Perform(const tuple<bool, int>& args) {
391
- return get<0>(args) ? get<1>(args) : 0;
392
- }
393
- };
394
-
395
- TEST(ActionInterfaceTest, CanBeImplementedByDefiningPerform) {
396
- MyActionImpl my_action_impl;
397
- (void)my_action_impl;
398
- }
399
-
400
- TEST(ActionInterfaceTest, MakeAction) {
401
- Action<MyGlobalFunction> action = MakeAction(new MyActionImpl);
402
-
403
- // When exercising the Perform() method of Action<F>, we must pass
404
- // it a tuple whose size and type are compatible with F's argument
405
- // types. For example, if F is int(), then Perform() takes a
406
- // 0-tuple; if F is void(bool, int), then Perform() takes a
407
- // tuple<bool, int>, and so on.
408
- EXPECT_EQ(5, action.Perform(make_tuple(true, 5)));
409
- }
410
-
411
- // Tests that Action<F> can be contructed from a pointer to
412
- // ActionInterface<F>.
413
- TEST(ActionTest, CanBeConstructedFromActionInterface) {
414
- Action<MyGlobalFunction> action(new MyActionImpl);
415
- }
416
-
417
- // Tests that Action<F> delegates actual work to ActionInterface<F>.
418
- TEST(ActionTest, DelegatesWorkToActionInterface) {
419
- const Action<MyGlobalFunction> action(new MyActionImpl);
420
-
421
- EXPECT_EQ(5, action.Perform(make_tuple(true, 5)));
422
- EXPECT_EQ(0, action.Perform(make_tuple(false, 1)));
423
- }
424
-
425
- // Tests that Action<F> can be copied.
426
- TEST(ActionTest, IsCopyable) {
427
- Action<MyGlobalFunction> a1(new MyActionImpl);
428
- Action<MyGlobalFunction> a2(a1); // Tests the copy constructor.
429
-
430
- // a1 should continue to work after being copied from.
431
- EXPECT_EQ(5, a1.Perform(make_tuple(true, 5)));
432
- EXPECT_EQ(0, a1.Perform(make_tuple(false, 1)));
433
-
434
- // a2 should work like the action it was copied from.
435
- EXPECT_EQ(5, a2.Perform(make_tuple(true, 5)));
436
- EXPECT_EQ(0, a2.Perform(make_tuple(false, 1)));
437
-
438
- a2 = a1; // Tests the assignment operator.
439
-
440
- // a1 should continue to work after being copied from.
441
- EXPECT_EQ(5, a1.Perform(make_tuple(true, 5)));
442
- EXPECT_EQ(0, a1.Perform(make_tuple(false, 1)));
443
-
444
- // a2 should work like the action it was copied from.
445
- EXPECT_EQ(5, a2.Perform(make_tuple(true, 5)));
446
- EXPECT_EQ(0, a2.Perform(make_tuple(false, 1)));
447
- }
448
-
449
- // Tests that an Action<From> object can be converted to a
450
- // compatible Action<To> object.
451
-
452
- class IsNotZero : public ActionInterface<bool(int)> { // NOLINT
453
- public:
454
- virtual bool Perform(const tuple<int>& arg) {
455
- return get<0>(arg) != 0;
456
- }
457
- };
458
-
459
- #if !GTEST_OS_SYMBIAN
460
- // Compiling this test on Nokia's Symbian compiler fails with:
461
- // 'Result' is not a member of class 'testing::internal::Function<int>'
462
- // (point of instantiation: '@unnamed@gmock_actions_test_cc@::
463
- // ActionTest_CanBeConvertedToOtherActionType_Test::TestBody()')
464
- // with no obvious fix.
465
- TEST(ActionTest, CanBeConvertedToOtherActionType) {
466
- const Action<bool(int)> a1(new IsNotZero); // NOLINT
467
- const Action<int(char)> a2 = Action<int(char)>(a1); // NOLINT
468
- EXPECT_EQ(1, a2.Perform(make_tuple('a')));
469
- EXPECT_EQ(0, a2.Perform(make_tuple('\0')));
470
- }
471
- #endif // !GTEST_OS_SYMBIAN
472
-
473
- // The following two classes are for testing MakePolymorphicAction().
474
-
475
- // Implements a polymorphic action that returns the second of the
476
- // arguments it receives.
477
- class ReturnSecondArgumentAction {
478
- public:
479
- // We want to verify that MakePolymorphicAction() can work with a
480
- // polymorphic action whose Perform() method template is either
481
- // const or not. This lets us verify the non-const case.
482
- template <typename Result, typename ArgumentTuple>
483
- Result Perform(const ArgumentTuple& args) { return get<1>(args); }
484
- };
485
-
486
- // Implements a polymorphic action that can be used in a nullary
487
- // function to return 0.
488
- class ReturnZeroFromNullaryFunctionAction {
489
- public:
490
- // For testing that MakePolymorphicAction() works when the
491
- // implementation class' Perform() method template takes only one
492
- // template parameter.
493
- //
494
- // We want to verify that MakePolymorphicAction() can work with a
495
- // polymorphic action whose Perform() method template is either
496
- // const or not. This lets us verify the const case.
497
- template <typename Result>
498
- Result Perform(const tuple<>&) const { return 0; }
499
- };
500
-
501
- // These functions verify that MakePolymorphicAction() returns a
502
- // PolymorphicAction<T> where T is the argument's type.
503
-
504
- PolymorphicAction<ReturnSecondArgumentAction> ReturnSecondArgument() {
505
- return MakePolymorphicAction(ReturnSecondArgumentAction());
506
- }
507
-
508
- PolymorphicAction<ReturnZeroFromNullaryFunctionAction>
509
- ReturnZeroFromNullaryFunction() {
510
- return MakePolymorphicAction(ReturnZeroFromNullaryFunctionAction());
511
- }
512
-
513
- // Tests that MakePolymorphicAction() turns a polymorphic action
514
- // implementation class into a polymorphic action.
515
- TEST(MakePolymorphicActionTest, ConstructsActionFromImpl) {
516
- Action<int(bool, int, double)> a1 = ReturnSecondArgument(); // NOLINT
517
- EXPECT_EQ(5, a1.Perform(make_tuple(false, 5, 2.0)));
518
- }
519
-
520
- // Tests that MakePolymorphicAction() works when the implementation
521
- // class' Perform() method template has only one template parameter.
522
- TEST(MakePolymorphicActionTest, WorksWhenPerformHasOneTemplateParameter) {
523
- Action<int()> a1 = ReturnZeroFromNullaryFunction();
524
- EXPECT_EQ(0, a1.Perform(make_tuple()));
525
-
526
- Action<void*()> a2 = ReturnZeroFromNullaryFunction();
527
- EXPECT_TRUE(a2.Perform(make_tuple()) == NULL);
528
- }
529
-
530
- // Tests that Return() works as an action for void-returning
531
- // functions.
532
- TEST(ReturnTest, WorksForVoid) {
533
- const Action<void(int)> ret = Return(); // NOLINT
534
- return ret.Perform(make_tuple(1));
535
- }
536
-
537
- // Tests that Return(v) returns v.
538
- TEST(ReturnTest, ReturnsGivenValue) {
539
- Action<int()> ret = Return(1); // NOLINT
540
- EXPECT_EQ(1, ret.Perform(make_tuple()));
541
-
542
- ret = Return(-5);
543
- EXPECT_EQ(-5, ret.Perform(make_tuple()));
544
- }
545
-
546
- // Tests that Return("string literal") works.
547
- TEST(ReturnTest, AcceptsStringLiteral) {
548
- Action<const char*()> a1 = Return("Hello");
549
- EXPECT_STREQ("Hello", a1.Perform(make_tuple()));
550
-
551
- Action<std::string()> a2 = Return("world");
552
- EXPECT_EQ("world", a2.Perform(make_tuple()));
553
- }
554
-
555
- // Test struct which wraps a vector of integers. Used in
556
- // 'SupportsWrapperReturnType' test.
557
- struct IntegerVectorWrapper {
558
- std::vector<int> * v;
559
- IntegerVectorWrapper(std::vector<int>& _v) : v(&_v) {} // NOLINT
560
- };
561
-
562
- // Tests that Return() works when return type is a wrapper type.
563
- TEST(ReturnTest, SupportsWrapperReturnType) {
564
- // Initialize vector of integers.
565
- std::vector<int> v;
566
- for (int i = 0; i < 5; ++i) v.push_back(i);
567
-
568
- // Return() called with 'v' as argument. The Action will return the same data
569
- // as 'v' (copy) but it will be wrapped in an IntegerVectorWrapper.
570
- Action<IntegerVectorWrapper()> a = Return(v);
571
- const std::vector<int>& result = *(a.Perform(make_tuple()).v);
572
- EXPECT_THAT(result, ::testing::ElementsAre(0, 1, 2, 3, 4));
573
- }
574
-
575
- // Tests that Return(v) is covaraint.
576
-
577
- struct Base {
578
- bool operator==(const Base&) { return true; }
579
- };
580
-
581
- struct Derived : public Base {
582
- bool operator==(const Derived&) { return true; }
583
- };
584
-
585
- TEST(ReturnTest, IsCovariant) {
586
- Base base;
587
- Derived derived;
588
- Action<Base*()> ret = Return(&base);
589
- EXPECT_EQ(&base, ret.Perform(make_tuple()));
590
-
591
- ret = Return(&derived);
592
- EXPECT_EQ(&derived, ret.Perform(make_tuple()));
593
- }
594
-
595
- // Tests that the type of the value passed into Return is converted into T
596
- // when the action is cast to Action<T(...)> rather than when the action is
597
- // performed. See comments on testing::internal::ReturnAction in
598
- // gmock-actions.h for more information.
599
- class FromType {
600
- public:
601
- explicit FromType(bool* is_converted) : converted_(is_converted) {}
602
- bool* converted() const { return converted_; }
603
-
604
- private:
605
- bool* const converted_;
606
-
607
- GTEST_DISALLOW_ASSIGN_(FromType);
608
- };
609
-
610
- class ToType {
611
- public:
612
- // Must allow implicit conversion due to use in ImplicitCast_<T>.
613
- ToType(const FromType& x) { *x.converted() = true; } // NOLINT
614
- };
615
-
616
- TEST(ReturnTest, ConvertsArgumentWhenConverted) {
617
- bool converted = false;
618
- FromType x(&converted);
619
- Action<ToType()> action(Return(x));
620
- EXPECT_TRUE(converted) << "Return must convert its argument in its own "
621
- << "conversion operator.";
622
- converted = false;
623
- action.Perform(tuple<>());
624
- EXPECT_FALSE(converted) << "Action must NOT convert its argument "
625
- << "when performed.";
626
- }
627
-
628
- class DestinationType {};
629
-
630
- class SourceType {
631
- public:
632
- // Note: a non-const typecast operator.
633
- operator DestinationType() { return DestinationType(); }
634
- };
635
-
636
- TEST(ReturnTest, CanConvertArgumentUsingNonConstTypeCastOperator) {
637
- SourceType s;
638
- Action<DestinationType()> action(Return(s));
639
- }
640
-
641
- // Tests that ReturnNull() returns NULL in a pointer-returning function.
642
- TEST(ReturnNullTest, WorksInPointerReturningFunction) {
643
- const Action<int*()> a1 = ReturnNull();
644
- EXPECT_TRUE(a1.Perform(make_tuple()) == NULL);
645
-
646
- const Action<const char*(bool)> a2 = ReturnNull(); // NOLINT
647
- EXPECT_TRUE(a2.Perform(make_tuple(true)) == NULL);
648
- }
649
-
650
- #if GTEST_HAS_STD_UNIQUE_PTR_
651
- // Tests that ReturnNull() returns NULL for shared_ptr and unique_ptr returning
652
- // functions.
653
- TEST(ReturnNullTest, WorksInSmartPointerReturningFunction) {
654
- const Action<std::unique_ptr<const int>()> a1 = ReturnNull();
655
- EXPECT_TRUE(a1.Perform(make_tuple()) == nullptr);
656
-
657
- const Action<std::shared_ptr<int>(std::string)> a2 = ReturnNull();
658
- EXPECT_TRUE(a2.Perform(make_tuple("foo")) == nullptr);
659
- }
660
- #endif // GTEST_HAS_STD_UNIQUE_PTR_
661
-
662
- // Tests that ReturnRef(v) works for reference types.
663
- TEST(ReturnRefTest, WorksForReference) {
664
- const int n = 0;
665
- const Action<const int&(bool)> ret = ReturnRef(n); // NOLINT
666
-
667
- EXPECT_EQ(&n, &ret.Perform(make_tuple(true)));
668
- }
669
-
670
- // Tests that ReturnRef(v) is covariant.
671
- TEST(ReturnRefTest, IsCovariant) {
672
- Base base;
673
- Derived derived;
674
- Action<Base&()> a = ReturnRef(base);
675
- EXPECT_EQ(&base, &a.Perform(make_tuple()));
676
-
677
- a = ReturnRef(derived);
678
- EXPECT_EQ(&derived, &a.Perform(make_tuple()));
679
- }
680
-
681
- // Tests that ReturnRefOfCopy(v) works for reference types.
682
- TEST(ReturnRefOfCopyTest, WorksForReference) {
683
- int n = 42;
684
- const Action<const int&()> ret = ReturnRefOfCopy(n);
685
-
686
- EXPECT_NE(&n, &ret.Perform(make_tuple()));
687
- EXPECT_EQ(42, ret.Perform(make_tuple()));
688
-
689
- n = 43;
690
- EXPECT_NE(&n, &ret.Perform(make_tuple()));
691
- EXPECT_EQ(42, ret.Perform(make_tuple()));
692
- }
693
-
694
- // Tests that ReturnRefOfCopy(v) is covariant.
695
- TEST(ReturnRefOfCopyTest, IsCovariant) {
696
- Base base;
697
- Derived derived;
698
- Action<Base&()> a = ReturnRefOfCopy(base);
699
- EXPECT_NE(&base, &a.Perform(make_tuple()));
700
-
701
- a = ReturnRefOfCopy(derived);
702
- EXPECT_NE(&derived, &a.Perform(make_tuple()));
703
- }
704
-
705
- // Tests that DoDefault() does the default action for the mock method.
706
-
707
- class MockClass {
708
- public:
709
- MockClass() {}
710
-
711
- MOCK_METHOD1(IntFunc, int(bool flag)); // NOLINT
712
- MOCK_METHOD0(Foo, MyNonDefaultConstructible());
713
- #if GTEST_HAS_STD_UNIQUE_PTR_
714
- MOCK_METHOD0(MakeUnique, std::unique_ptr<int>());
715
- MOCK_METHOD0(MakeUniqueBase, std::unique_ptr<Base>());
716
- MOCK_METHOD0(MakeVectorUnique, std::vector<std::unique_ptr<int>>());
717
- MOCK_METHOD1(TakeUnique, int(std::unique_ptr<int>));
718
- MOCK_METHOD2(TakeUnique,
719
- int(const std::unique_ptr<int>&, std::unique_ptr<int>));
720
- #endif
721
-
722
- private:
723
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockClass);
724
- };
725
-
726
- // Tests that DoDefault() returns the built-in default value for the
727
- // return type by default.
728
- TEST(DoDefaultTest, ReturnsBuiltInDefaultValueByDefault) {
729
- MockClass mock;
730
- EXPECT_CALL(mock, IntFunc(_))
731
- .WillOnce(DoDefault());
732
- EXPECT_EQ(0, mock.IntFunc(true));
733
- }
734
-
735
- // Tests that DoDefault() throws (when exceptions are enabled) or aborts
736
- // the process when there is no built-in default value for the return type.
737
- TEST(DoDefaultDeathTest, DiesForUnknowType) {
738
- MockClass mock;
739
- EXPECT_CALL(mock, Foo())
740
- .WillRepeatedly(DoDefault());
741
- #if GTEST_HAS_EXCEPTIONS
742
- EXPECT_ANY_THROW(mock.Foo());
743
- #else
744
- EXPECT_DEATH_IF_SUPPORTED({
745
- mock.Foo();
746
- }, "");
747
- #endif
748
- }
749
-
750
- // Tests that using DoDefault() inside a composite action leads to a
751
- // run-time error.
752
-
753
- void VoidFunc(bool /* flag */) {}
754
-
755
- TEST(DoDefaultDeathTest, DiesIfUsedInCompositeAction) {
756
- MockClass mock;
757
- EXPECT_CALL(mock, IntFunc(_))
758
- .WillRepeatedly(DoAll(Invoke(VoidFunc),
759
- DoDefault()));
760
-
761
- // Ideally we should verify the error message as well. Sadly,
762
- // EXPECT_DEATH() can only capture stderr, while Google Mock's
763
- // errors are printed on stdout. Therefore we have to settle for
764
- // not verifying the message.
765
- EXPECT_DEATH_IF_SUPPORTED({
766
- mock.IntFunc(true);
767
- }, "");
768
- }
769
-
770
- // Tests that DoDefault() returns the default value set by
771
- // DefaultValue<T>::Set() when it's not overriden by an ON_CALL().
772
- TEST(DoDefaultTest, ReturnsUserSpecifiedPerTypeDefaultValueWhenThereIsOne) {
773
- DefaultValue<int>::Set(1);
774
- MockClass mock;
775
- EXPECT_CALL(mock, IntFunc(_))
776
- .WillOnce(DoDefault());
777
- EXPECT_EQ(1, mock.IntFunc(false));
778
- DefaultValue<int>::Clear();
779
- }
780
-
781
- // Tests that DoDefault() does the action specified by ON_CALL().
782
- TEST(DoDefaultTest, DoesWhatOnCallSpecifies) {
783
- MockClass mock;
784
- ON_CALL(mock, IntFunc(_))
785
- .WillByDefault(Return(2));
786
- EXPECT_CALL(mock, IntFunc(_))
787
- .WillOnce(DoDefault());
788
- EXPECT_EQ(2, mock.IntFunc(false));
789
- }
790
-
791
- // Tests that using DoDefault() in ON_CALL() leads to a run-time failure.
792
- TEST(DoDefaultTest, CannotBeUsedInOnCall) {
793
- MockClass mock;
794
- EXPECT_NONFATAL_FAILURE({ // NOLINT
795
- ON_CALL(mock, IntFunc(_))
796
- .WillByDefault(DoDefault());
797
- }, "DoDefault() cannot be used in ON_CALL()");
798
- }
799
-
800
- // Tests that SetArgPointee<N>(v) sets the variable pointed to by
801
- // the N-th (0-based) argument to v.
802
- TEST(SetArgPointeeTest, SetsTheNthPointee) {
803
- typedef void MyFunction(bool, int*, char*);
804
- Action<MyFunction> a = SetArgPointee<1>(2);
805
-
806
- int n = 0;
807
- char ch = '\0';
808
- a.Perform(make_tuple(true, &n, &ch));
809
- EXPECT_EQ(2, n);
810
- EXPECT_EQ('\0', ch);
811
-
812
- a = SetArgPointee<2>('a');
813
- n = 0;
814
- ch = '\0';
815
- a.Perform(make_tuple(true, &n, &ch));
816
- EXPECT_EQ(0, n);
817
- EXPECT_EQ('a', ch);
818
- }
819
-
820
- #if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)
821
- // Tests that SetArgPointee<N>() accepts a string literal.
822
- // GCC prior to v4.0 and the Symbian compiler do not support this.
823
- TEST(SetArgPointeeTest, AcceptsStringLiteral) {
824
- typedef void MyFunction(std::string*, const char**);
825
- Action<MyFunction> a = SetArgPointee<0>("hi");
826
- std::string str;
827
- const char* ptr = NULL;
828
- a.Perform(make_tuple(&str, &ptr));
829
- EXPECT_EQ("hi", str);
830
- EXPECT_TRUE(ptr == NULL);
831
-
832
- a = SetArgPointee<1>("world");
833
- str = "";
834
- a.Perform(make_tuple(&str, &ptr));
835
- EXPECT_EQ("", str);
836
- EXPECT_STREQ("world", ptr);
837
- }
838
-
839
- TEST(SetArgPointeeTest, AcceptsWideStringLiteral) {
840
- typedef void MyFunction(const wchar_t**);
841
- Action<MyFunction> a = SetArgPointee<0>(L"world");
842
- const wchar_t* ptr = NULL;
843
- a.Perform(make_tuple(&ptr));
844
- EXPECT_STREQ(L"world", ptr);
845
-
846
- # if GTEST_HAS_STD_WSTRING
847
-
848
- typedef void MyStringFunction(std::wstring*);
849
- Action<MyStringFunction> a2 = SetArgPointee<0>(L"world");
850
- std::wstring str = L"";
851
- a2.Perform(make_tuple(&str));
852
- EXPECT_EQ(L"world", str);
853
-
854
- # endif
855
- }
856
- #endif
857
-
858
- // Tests that SetArgPointee<N>() accepts a char pointer.
859
- TEST(SetArgPointeeTest, AcceptsCharPointer) {
860
- typedef void MyFunction(bool, std::string*, const char**);
861
- const char* const hi = "hi";
862
- Action<MyFunction> a = SetArgPointee<1>(hi);
863
- std::string str;
864
- const char* ptr = NULL;
865
- a.Perform(make_tuple(true, &str, &ptr));
866
- EXPECT_EQ("hi", str);
867
- EXPECT_TRUE(ptr == NULL);
868
-
869
- char world_array[] = "world";
870
- char* const world = world_array;
871
- a = SetArgPointee<2>(world);
872
- str = "";
873
- a.Perform(make_tuple(true, &str, &ptr));
874
- EXPECT_EQ("", str);
875
- EXPECT_EQ(world, ptr);
876
- }
877
-
878
- TEST(SetArgPointeeTest, AcceptsWideCharPointer) {
879
- typedef void MyFunction(bool, const wchar_t**);
880
- const wchar_t* const hi = L"hi";
881
- Action<MyFunction> a = SetArgPointee<1>(hi);
882
- const wchar_t* ptr = NULL;
883
- a.Perform(make_tuple(true, &ptr));
884
- EXPECT_EQ(hi, ptr);
885
-
886
- # if GTEST_HAS_STD_WSTRING
887
-
888
- typedef void MyStringFunction(bool, std::wstring*);
889
- wchar_t world_array[] = L"world";
890
- wchar_t* const world = world_array;
891
- Action<MyStringFunction> a2 = SetArgPointee<1>(world);
892
- std::wstring str;
893
- a2.Perform(make_tuple(true, &str));
894
- EXPECT_EQ(world_array, str);
895
- # endif
896
- }
897
-
898
- #if GTEST_HAS_PROTOBUF_
899
-
900
- // Tests that SetArgPointee<N>(proto_buffer) sets the v1 protobuf
901
- // variable pointed to by the N-th (0-based) argument to proto_buffer.
902
- TEST(SetArgPointeeTest, SetsTheNthPointeeOfProtoBufferType) {
903
- TestMessage* const msg = new TestMessage;
904
- msg->set_member("yes");
905
- TestMessage orig_msg;
906
- orig_msg.CopyFrom(*msg);
907
-
908
- Action<void(bool, TestMessage*)> a = SetArgPointee<1>(*msg);
909
- // SetArgPointee<N>(proto_buffer) makes a copy of proto_buffer
910
- // s.t. the action works even when the original proto_buffer has
911
- // died. We ensure this behavior by deleting msg before using the
912
- // action.
913
- delete msg;
914
-
915
- TestMessage dest;
916
- EXPECT_FALSE(orig_msg.Equals(dest));
917
- a.Perform(make_tuple(true, &dest));
918
- EXPECT_TRUE(orig_msg.Equals(dest));
919
- }
920
-
921
- // Tests that SetArgPointee<N>(proto_buffer) sets the
922
- // ::ProtocolMessage variable pointed to by the N-th (0-based)
923
- // argument to proto_buffer.
924
- TEST(SetArgPointeeTest, SetsTheNthPointeeOfProtoBufferBaseType) {
925
- TestMessage* const msg = new TestMessage;
926
- msg->set_member("yes");
927
- TestMessage orig_msg;
928
- orig_msg.CopyFrom(*msg);
929
-
930
- Action<void(bool, ::ProtocolMessage*)> a = SetArgPointee<1>(*msg);
931
- // SetArgPointee<N>(proto_buffer) makes a copy of proto_buffer
932
- // s.t. the action works even when the original proto_buffer has
933
- // died. We ensure this behavior by deleting msg before using the
934
- // action.
935
- delete msg;
936
-
937
- TestMessage dest;
938
- ::ProtocolMessage* const dest_base = &dest;
939
- EXPECT_FALSE(orig_msg.Equals(dest));
940
- a.Perform(make_tuple(true, dest_base));
941
- EXPECT_TRUE(orig_msg.Equals(dest));
942
- }
943
-
944
- // Tests that SetArgPointee<N>(proto2_buffer) sets the v2
945
- // protobuf variable pointed to by the N-th (0-based) argument to
946
- // proto2_buffer.
947
- TEST(SetArgPointeeTest, SetsTheNthPointeeOfProto2BufferType) {
948
- using testing::internal::FooMessage;
949
- FooMessage* const msg = new FooMessage;
950
- msg->set_int_field(2);
951
- msg->set_string_field("hi");
952
- FooMessage orig_msg;
953
- orig_msg.CopyFrom(*msg);
954
-
955
- Action<void(bool, FooMessage*)> a = SetArgPointee<1>(*msg);
956
- // SetArgPointee<N>(proto2_buffer) makes a copy of
957
- // proto2_buffer s.t. the action works even when the original
958
- // proto2_buffer has died. We ensure this behavior by deleting msg
959
- // before using the action.
960
- delete msg;
961
-
962
- FooMessage dest;
963
- dest.set_int_field(0);
964
- a.Perform(make_tuple(true, &dest));
965
- EXPECT_EQ(2, dest.int_field());
966
- EXPECT_EQ("hi", dest.string_field());
967
- }
968
-
969
- // Tests that SetArgPointee<N>(proto2_buffer) sets the
970
- // proto2::Message variable pointed to by the N-th (0-based) argument
971
- // to proto2_buffer.
972
- TEST(SetArgPointeeTest, SetsTheNthPointeeOfProto2BufferBaseType) {
973
- using testing::internal::FooMessage;
974
- FooMessage* const msg = new FooMessage;
975
- msg->set_int_field(2);
976
- msg->set_string_field("hi");
977
- FooMessage orig_msg;
978
- orig_msg.CopyFrom(*msg);
979
-
980
- Action<void(bool, ::proto2::Message*)> a = SetArgPointee<1>(*msg);
981
- // SetArgPointee<N>(proto2_buffer) makes a copy of
982
- // proto2_buffer s.t. the action works even when the original
983
- // proto2_buffer has died. We ensure this behavior by deleting msg
984
- // before using the action.
985
- delete msg;
986
-
987
- FooMessage dest;
988
- dest.set_int_field(0);
989
- ::proto2::Message* const dest_base = &dest;
990
- a.Perform(make_tuple(true, dest_base));
991
- EXPECT_EQ(2, dest.int_field());
992
- EXPECT_EQ("hi", dest.string_field());
993
- }
994
-
995
- #endif // GTEST_HAS_PROTOBUF_
996
-
997
- // Tests that SetArgumentPointee<N>(v) sets the variable pointed to by
998
- // the N-th (0-based) argument to v.
999
- TEST(SetArgumentPointeeTest, SetsTheNthPointee) {
1000
- typedef void MyFunction(bool, int*, char*);
1001
- Action<MyFunction> a = SetArgumentPointee<1>(2);
1002
-
1003
- int n = 0;
1004
- char ch = '\0';
1005
- a.Perform(make_tuple(true, &n, &ch));
1006
- EXPECT_EQ(2, n);
1007
- EXPECT_EQ('\0', ch);
1008
-
1009
- a = SetArgumentPointee<2>('a');
1010
- n = 0;
1011
- ch = '\0';
1012
- a.Perform(make_tuple(true, &n, &ch));
1013
- EXPECT_EQ(0, n);
1014
- EXPECT_EQ('a', ch);
1015
- }
1016
-
1017
- #if GTEST_HAS_PROTOBUF_
1018
-
1019
- // Tests that SetArgumentPointee<N>(proto_buffer) sets the v1 protobuf
1020
- // variable pointed to by the N-th (0-based) argument to proto_buffer.
1021
- TEST(SetArgumentPointeeTest, SetsTheNthPointeeOfProtoBufferType) {
1022
- TestMessage* const msg = new TestMessage;
1023
- msg->set_member("yes");
1024
- TestMessage orig_msg;
1025
- orig_msg.CopyFrom(*msg);
1026
-
1027
- Action<void(bool, TestMessage*)> a = SetArgumentPointee<1>(*msg);
1028
- // SetArgumentPointee<N>(proto_buffer) makes a copy of proto_buffer
1029
- // s.t. the action works even when the original proto_buffer has
1030
- // died. We ensure this behavior by deleting msg before using the
1031
- // action.
1032
- delete msg;
1033
-
1034
- TestMessage dest;
1035
- EXPECT_FALSE(orig_msg.Equals(dest));
1036
- a.Perform(make_tuple(true, &dest));
1037
- EXPECT_TRUE(orig_msg.Equals(dest));
1038
- }
1039
-
1040
- // Tests that SetArgumentPointee<N>(proto_buffer) sets the
1041
- // ::ProtocolMessage variable pointed to by the N-th (0-based)
1042
- // argument to proto_buffer.
1043
- TEST(SetArgumentPointeeTest, SetsTheNthPointeeOfProtoBufferBaseType) {
1044
- TestMessage* const msg = new TestMessage;
1045
- msg->set_member("yes");
1046
- TestMessage orig_msg;
1047
- orig_msg.CopyFrom(*msg);
1048
-
1049
- Action<void(bool, ::ProtocolMessage*)> a = SetArgumentPointee<1>(*msg);
1050
- // SetArgumentPointee<N>(proto_buffer) makes a copy of proto_buffer
1051
- // s.t. the action works even when the original proto_buffer has
1052
- // died. We ensure this behavior by deleting msg before using the
1053
- // action.
1054
- delete msg;
1055
-
1056
- TestMessage dest;
1057
- ::ProtocolMessage* const dest_base = &dest;
1058
- EXPECT_FALSE(orig_msg.Equals(dest));
1059
- a.Perform(make_tuple(true, dest_base));
1060
- EXPECT_TRUE(orig_msg.Equals(dest));
1061
- }
1062
-
1063
- // Tests that SetArgumentPointee<N>(proto2_buffer) sets the v2
1064
- // protobuf variable pointed to by the N-th (0-based) argument to
1065
- // proto2_buffer.
1066
- TEST(SetArgumentPointeeTest, SetsTheNthPointeeOfProto2BufferType) {
1067
- using testing::internal::FooMessage;
1068
- FooMessage* const msg = new FooMessage;
1069
- msg->set_int_field(2);
1070
- msg->set_string_field("hi");
1071
- FooMessage orig_msg;
1072
- orig_msg.CopyFrom(*msg);
1073
-
1074
- Action<void(bool, FooMessage*)> a = SetArgumentPointee<1>(*msg);
1075
- // SetArgumentPointee<N>(proto2_buffer) makes a copy of
1076
- // proto2_buffer s.t. the action works even when the original
1077
- // proto2_buffer has died. We ensure this behavior by deleting msg
1078
- // before using the action.
1079
- delete msg;
1080
-
1081
- FooMessage dest;
1082
- dest.set_int_field(0);
1083
- a.Perform(make_tuple(true, &dest));
1084
- EXPECT_EQ(2, dest.int_field());
1085
- EXPECT_EQ("hi", dest.string_field());
1086
- }
1087
-
1088
- // Tests that SetArgumentPointee<N>(proto2_buffer) sets the
1089
- // proto2::Message variable pointed to by the N-th (0-based) argument
1090
- // to proto2_buffer.
1091
- TEST(SetArgumentPointeeTest, SetsTheNthPointeeOfProto2BufferBaseType) {
1092
- using testing::internal::FooMessage;
1093
- FooMessage* const msg = new FooMessage;
1094
- msg->set_int_field(2);
1095
- msg->set_string_field("hi");
1096
- FooMessage orig_msg;
1097
- orig_msg.CopyFrom(*msg);
1098
-
1099
- Action<void(bool, ::proto2::Message*)> a = SetArgumentPointee<1>(*msg);
1100
- // SetArgumentPointee<N>(proto2_buffer) makes a copy of
1101
- // proto2_buffer s.t. the action works even when the original
1102
- // proto2_buffer has died. We ensure this behavior by deleting msg
1103
- // before using the action.
1104
- delete msg;
1105
-
1106
- FooMessage dest;
1107
- dest.set_int_field(0);
1108
- ::proto2::Message* const dest_base = &dest;
1109
- a.Perform(make_tuple(true, dest_base));
1110
- EXPECT_EQ(2, dest.int_field());
1111
- EXPECT_EQ("hi", dest.string_field());
1112
- }
1113
-
1114
- #endif // GTEST_HAS_PROTOBUF_
1115
-
1116
- // Sample functions and functors for testing Invoke() and etc.
1117
- int Nullary() { return 1; }
1118
-
1119
- class NullaryFunctor {
1120
- public:
1121
- int operator()() { return 2; }
1122
- };
1123
-
1124
- bool g_done = false;
1125
- void VoidNullary() { g_done = true; }
1126
-
1127
- class VoidNullaryFunctor {
1128
- public:
1129
- void operator()() { g_done = true; }
1130
- };
1131
-
1132
- class Foo {
1133
- public:
1134
- Foo() : value_(123) {}
1135
-
1136
- int Nullary() const { return value_; }
1137
-
1138
- private:
1139
- int value_;
1140
- };
1141
-
1142
- // Tests InvokeWithoutArgs(function).
1143
- TEST(InvokeWithoutArgsTest, Function) {
1144
- // As an action that takes one argument.
1145
- Action<int(int)> a = InvokeWithoutArgs(Nullary); // NOLINT
1146
- EXPECT_EQ(1, a.Perform(make_tuple(2)));
1147
-
1148
- // As an action that takes two arguments.
1149
- Action<int(int, double)> a2 = InvokeWithoutArgs(Nullary); // NOLINT
1150
- EXPECT_EQ(1, a2.Perform(make_tuple(2, 3.5)));
1151
-
1152
- // As an action that returns void.
1153
- Action<void(int)> a3 = InvokeWithoutArgs(VoidNullary); // NOLINT
1154
- g_done = false;
1155
- a3.Perform(make_tuple(1));
1156
- EXPECT_TRUE(g_done);
1157
- }
1158
-
1159
- // Tests InvokeWithoutArgs(functor).
1160
- TEST(InvokeWithoutArgsTest, Functor) {
1161
- // As an action that takes no argument.
1162
- Action<int()> a = InvokeWithoutArgs(NullaryFunctor()); // NOLINT
1163
- EXPECT_EQ(2, a.Perform(make_tuple()));
1164
-
1165
- // As an action that takes three arguments.
1166
- Action<int(int, double, char)> a2 = // NOLINT
1167
- InvokeWithoutArgs(NullaryFunctor());
1168
- EXPECT_EQ(2, a2.Perform(make_tuple(3, 3.5, 'a')));
1169
-
1170
- // As an action that returns void.
1171
- Action<void()> a3 = InvokeWithoutArgs(VoidNullaryFunctor());
1172
- g_done = false;
1173
- a3.Perform(make_tuple());
1174
- EXPECT_TRUE(g_done);
1175
- }
1176
-
1177
- // Tests InvokeWithoutArgs(obj_ptr, method).
1178
- TEST(InvokeWithoutArgsTest, Method) {
1179
- Foo foo;
1180
- Action<int(bool, char)> a = // NOLINT
1181
- InvokeWithoutArgs(&foo, &Foo::Nullary);
1182
- EXPECT_EQ(123, a.Perform(make_tuple(true, 'a')));
1183
- }
1184
-
1185
- // Tests using IgnoreResult() on a polymorphic action.
1186
- TEST(IgnoreResultTest, PolymorphicAction) {
1187
- Action<void(int)> a = IgnoreResult(Return(5)); // NOLINT
1188
- a.Perform(make_tuple(1));
1189
- }
1190
-
1191
- // Tests using IgnoreResult() on a monomorphic action.
1192
-
1193
- int ReturnOne() {
1194
- g_done = true;
1195
- return 1;
1196
- }
1197
-
1198
- TEST(IgnoreResultTest, MonomorphicAction) {
1199
- g_done = false;
1200
- Action<void()> a = IgnoreResult(Invoke(ReturnOne));
1201
- a.Perform(make_tuple());
1202
- EXPECT_TRUE(g_done);
1203
- }
1204
-
1205
- // Tests using IgnoreResult() on an action that returns a class type.
1206
-
1207
- MyNonDefaultConstructible ReturnMyNonDefaultConstructible(double /* x */) {
1208
- g_done = true;
1209
- return MyNonDefaultConstructible(42);
1210
- }
1211
-
1212
- TEST(IgnoreResultTest, ActionReturningClass) {
1213
- g_done = false;
1214
- Action<void(int)> a =
1215
- IgnoreResult(Invoke(ReturnMyNonDefaultConstructible)); // NOLINT
1216
- a.Perform(make_tuple(2));
1217
- EXPECT_TRUE(g_done);
1218
- }
1219
-
1220
- TEST(AssignTest, Int) {
1221
- int x = 0;
1222
- Action<void(int)> a = Assign(&x, 5);
1223
- a.Perform(make_tuple(0));
1224
- EXPECT_EQ(5, x);
1225
- }
1226
-
1227
- TEST(AssignTest, String) {
1228
- ::std::string x;
1229
- Action<void(void)> a = Assign(&x, "Hello, world");
1230
- a.Perform(make_tuple());
1231
- EXPECT_EQ("Hello, world", x);
1232
- }
1233
-
1234
- TEST(AssignTest, CompatibleTypes) {
1235
- double x = 0;
1236
- Action<void(int)> a = Assign(&x, 5);
1237
- a.Perform(make_tuple(0));
1238
- EXPECT_DOUBLE_EQ(5, x);
1239
- }
1240
-
1241
- #if !GTEST_OS_WINDOWS_MOBILE
1242
-
1243
- class SetErrnoAndReturnTest : public testing::Test {
1244
- protected:
1245
- virtual void SetUp() { errno = 0; }
1246
- virtual void TearDown() { errno = 0; }
1247
- };
1248
-
1249
- TEST_F(SetErrnoAndReturnTest, Int) {
1250
- Action<int(void)> a = SetErrnoAndReturn(ENOTTY, -5);
1251
- EXPECT_EQ(-5, a.Perform(make_tuple()));
1252
- EXPECT_EQ(ENOTTY, errno);
1253
- }
1254
-
1255
- TEST_F(SetErrnoAndReturnTest, Ptr) {
1256
- int x;
1257
- Action<int*(void)> a = SetErrnoAndReturn(ENOTTY, &x);
1258
- EXPECT_EQ(&x, a.Perform(make_tuple()));
1259
- EXPECT_EQ(ENOTTY, errno);
1260
- }
1261
-
1262
- TEST_F(SetErrnoAndReturnTest, CompatibleTypes) {
1263
- Action<double()> a = SetErrnoAndReturn(EINVAL, 5);
1264
- EXPECT_DOUBLE_EQ(5.0, a.Perform(make_tuple()));
1265
- EXPECT_EQ(EINVAL, errno);
1266
- }
1267
-
1268
- #endif // !GTEST_OS_WINDOWS_MOBILE
1269
-
1270
- // Tests ByRef().
1271
-
1272
- // Tests that ReferenceWrapper<T> is copyable.
1273
- TEST(ByRefTest, IsCopyable) {
1274
- const std::string s1 = "Hi";
1275
- const std::string s2 = "Hello";
1276
-
1277
- ::testing::internal::ReferenceWrapper<const std::string> ref_wrapper =
1278
- ByRef(s1);
1279
- const std::string& r1 = ref_wrapper;
1280
- EXPECT_EQ(&s1, &r1);
1281
-
1282
- // Assigns a new value to ref_wrapper.
1283
- ref_wrapper = ByRef(s2);
1284
- const std::string& r2 = ref_wrapper;
1285
- EXPECT_EQ(&s2, &r2);
1286
-
1287
- ::testing::internal::ReferenceWrapper<const std::string> ref_wrapper1 =
1288
- ByRef(s1);
1289
- // Copies ref_wrapper1 to ref_wrapper.
1290
- ref_wrapper = ref_wrapper1;
1291
- const std::string& r3 = ref_wrapper;
1292
- EXPECT_EQ(&s1, &r3);
1293
- }
1294
-
1295
- // Tests using ByRef() on a const value.
1296
- TEST(ByRefTest, ConstValue) {
1297
- const int n = 0;
1298
- // int& ref = ByRef(n); // This shouldn't compile - we have a
1299
- // negative compilation test to catch it.
1300
- const int& const_ref = ByRef(n);
1301
- EXPECT_EQ(&n, &const_ref);
1302
- }
1303
-
1304
- // Tests using ByRef() on a non-const value.
1305
- TEST(ByRefTest, NonConstValue) {
1306
- int n = 0;
1307
-
1308
- // ByRef(n) can be used as either an int&,
1309
- int& ref = ByRef(n);
1310
- EXPECT_EQ(&n, &ref);
1311
-
1312
- // or a const int&.
1313
- const int& const_ref = ByRef(n);
1314
- EXPECT_EQ(&n, &const_ref);
1315
- }
1316
-
1317
- // Tests explicitly specifying the type when using ByRef().
1318
- TEST(ByRefTest, ExplicitType) {
1319
- int n = 0;
1320
- const int& r1 = ByRef<const int>(n);
1321
- EXPECT_EQ(&n, &r1);
1322
-
1323
- // ByRef<char>(n); // This shouldn't compile - we have a negative
1324
- // compilation test to catch it.
1325
-
1326
- Derived d;
1327
- Derived& r2 = ByRef<Derived>(d);
1328
- EXPECT_EQ(&d, &r2);
1329
-
1330
- const Derived& r3 = ByRef<const Derived>(d);
1331
- EXPECT_EQ(&d, &r3);
1332
-
1333
- Base& r4 = ByRef<Base>(d);
1334
- EXPECT_EQ(&d, &r4);
1335
-
1336
- const Base& r5 = ByRef<const Base>(d);
1337
- EXPECT_EQ(&d, &r5);
1338
-
1339
- // The following shouldn't compile - we have a negative compilation
1340
- // test for it.
1341
- //
1342
- // Base b;
1343
- // ByRef<Derived>(b);
1344
- }
1345
-
1346
- // Tests that Google Mock prints expression ByRef(x) as a reference to x.
1347
- TEST(ByRefTest, PrintsCorrectly) {
1348
- int n = 42;
1349
- ::std::stringstream expected, actual;
1350
- testing::internal::UniversalPrinter<const int&>::Print(n, &expected);
1351
- testing::internal::UniversalPrint(ByRef(n), &actual);
1352
- EXPECT_EQ(expected.str(), actual.str());
1353
- }
1354
-
1355
- #if GTEST_HAS_STD_UNIQUE_PTR_
1356
-
1357
- std::unique_ptr<int> UniquePtrSource() {
1358
- return std::unique_ptr<int>(new int(19));
1359
- }
1360
-
1361
- std::vector<std::unique_ptr<int>> VectorUniquePtrSource() {
1362
- std::vector<std::unique_ptr<int>> out;
1363
- out.emplace_back(new int(7));
1364
- return out;
1365
- }
1366
-
1367
- TEST(MockMethodTest, CanReturnMoveOnlyValue_Return) {
1368
- MockClass mock;
1369
- std::unique_ptr<int> i(new int(19));
1370
- EXPECT_CALL(mock, MakeUnique()).WillOnce(Return(ByMove(std::move(i))));
1371
- EXPECT_CALL(mock, MakeVectorUnique())
1372
- .WillOnce(Return(ByMove(VectorUniquePtrSource())));
1373
- Derived* d = new Derived;
1374
- EXPECT_CALL(mock, MakeUniqueBase())
1375
- .WillOnce(Return(ByMove(std::unique_ptr<Derived>(d))));
1376
-
1377
- std::unique_ptr<int> result1 = mock.MakeUnique();
1378
- EXPECT_EQ(19, *result1);
1379
-
1380
- std::vector<std::unique_ptr<int>> vresult = mock.MakeVectorUnique();
1381
- EXPECT_EQ(1u, vresult.size());
1382
- EXPECT_NE(nullptr, vresult[0]);
1383
- EXPECT_EQ(7, *vresult[0]);
1384
-
1385
- std::unique_ptr<Base> result2 = mock.MakeUniqueBase();
1386
- EXPECT_EQ(d, result2.get());
1387
- }
1388
-
1389
- TEST(MockMethodTest, CanReturnMoveOnlyValue_DoAllReturn) {
1390
- testing::MockFunction<void()> mock_function;
1391
- MockClass mock;
1392
- std::unique_ptr<int> i(new int(19));
1393
- EXPECT_CALL(mock_function, Call());
1394
- EXPECT_CALL(mock, MakeUnique()).WillOnce(DoAll(
1395
- InvokeWithoutArgs(&mock_function, &testing::MockFunction<void()>::Call),
1396
- Return(ByMove(std::move(i)))));
1397
-
1398
- std::unique_ptr<int> result1 = mock.MakeUnique();
1399
- EXPECT_EQ(19, *result1);
1400
- }
1401
-
1402
- TEST(MockMethodTest, CanReturnMoveOnlyValue_Invoke) {
1403
- MockClass mock;
1404
-
1405
- // Check default value
1406
- DefaultValue<std::unique_ptr<int>>::SetFactory([] {
1407
- return std::unique_ptr<int>(new int(42));
1408
- });
1409
- EXPECT_EQ(42, *mock.MakeUnique());
1410
-
1411
- EXPECT_CALL(mock, MakeUnique()).WillRepeatedly(Invoke(UniquePtrSource));
1412
- EXPECT_CALL(mock, MakeVectorUnique())
1413
- .WillRepeatedly(Invoke(VectorUniquePtrSource));
1414
- std::unique_ptr<int> result1 = mock.MakeUnique();
1415
- EXPECT_EQ(19, *result1);
1416
- std::unique_ptr<int> result2 = mock.MakeUnique();
1417
- EXPECT_EQ(19, *result2);
1418
- EXPECT_NE(result1, result2);
1419
-
1420
- std::vector<std::unique_ptr<int>> vresult = mock.MakeVectorUnique();
1421
- EXPECT_EQ(1u, vresult.size());
1422
- EXPECT_NE(nullptr, vresult[0]);
1423
- EXPECT_EQ(7, *vresult[0]);
1424
- }
1425
-
1426
- TEST(MockMethodTest, CanTakeMoveOnlyValue) {
1427
- MockClass mock;
1428
- auto make = [](int i) { return std::unique_ptr<int>(new int(i)); };
1429
-
1430
- EXPECT_CALL(mock, TakeUnique(_)).WillRepeatedly([](std::unique_ptr<int> i) {
1431
- return *i;
1432
- });
1433
- // DoAll() does not compile, since it would move from its arguments twice.
1434
- // EXPECT_CALL(mock, TakeUnique(_, _))
1435
- // .WillRepeatedly(DoAll(Invoke([](std::unique_ptr<int> j) {}),
1436
- // Return(1)));
1437
- EXPECT_CALL(mock, TakeUnique(testing::Pointee(7)))
1438
- .WillOnce(Return(-7))
1439
- .RetiresOnSaturation();
1440
- EXPECT_CALL(mock, TakeUnique(testing::IsNull()))
1441
- .WillOnce(Return(-1))
1442
- .RetiresOnSaturation();
1443
-
1444
- EXPECT_EQ(5, mock.TakeUnique(make(5)));
1445
- EXPECT_EQ(-7, mock.TakeUnique(make(7)));
1446
- EXPECT_EQ(7, mock.TakeUnique(make(7)));
1447
- EXPECT_EQ(7, mock.TakeUnique(make(7)));
1448
- EXPECT_EQ(-1, mock.TakeUnique({}));
1449
-
1450
- // Some arguments are moved, some passed by reference.
1451
- auto lvalue = make(6);
1452
- EXPECT_CALL(mock, TakeUnique(_, _))
1453
- .WillOnce([](const std::unique_ptr<int>& i, std::unique_ptr<int> j) {
1454
- return *i * *j;
1455
- });
1456
- EXPECT_EQ(42, mock.TakeUnique(lvalue, make(7)));
1457
-
1458
- // The unique_ptr can be saved by the action.
1459
- std::unique_ptr<int> saved;
1460
- EXPECT_CALL(mock, TakeUnique(_)).WillOnce([&saved](std::unique_ptr<int> i) {
1461
- saved = std::move(i);
1462
- return 0;
1463
- });
1464
- EXPECT_EQ(0, mock.TakeUnique(make(42)));
1465
- EXPECT_EQ(42, *saved);
1466
- }
1467
-
1468
- #endif // GTEST_HAS_STD_UNIQUE_PTR_
1469
-
1470
- #if GTEST_LANG_CXX11
1471
- // Tests for std::function based action.
1472
-
1473
- int Add(int val, int& ref, int* ptr) { // NOLINT
1474
- int result = val + ref + *ptr;
1475
- ref = 42;
1476
- *ptr = 43;
1477
- return result;
1478
- }
1479
-
1480
- int Deref(std::unique_ptr<int> ptr) { return *ptr; }
1481
-
1482
- struct Double {
1483
- template <typename T>
1484
- T operator()(T t) { return 2 * t; }
1485
- };
1486
-
1487
- std::unique_ptr<int> UniqueInt(int i) {
1488
- return std::unique_ptr<int>(new int(i));
1489
- }
1490
-
1491
- TEST(FunctorActionTest, ActionFromFunction) {
1492
- Action<int(int, int&, int*)> a = &Add;
1493
- int x = 1, y = 2, z = 3;
1494
- EXPECT_EQ(6, a.Perform(std::forward_as_tuple(x, y, &z)));
1495
- EXPECT_EQ(42, y);
1496
- EXPECT_EQ(43, z);
1497
-
1498
- Action<int(std::unique_ptr<int>)> a1 = &Deref;
1499
- EXPECT_EQ(7, a1.Perform(std::make_tuple(UniqueInt(7))));
1500
- }
1501
-
1502
- TEST(FunctorActionTest, ActionFromLambda) {
1503
- Action<int(bool, int)> a1 = [](bool b, int i) { return b ? i : 0; };
1504
- EXPECT_EQ(5, a1.Perform(make_tuple(true, 5)));
1505
- EXPECT_EQ(0, a1.Perform(make_tuple(false, 5)));
1506
-
1507
- std::unique_ptr<int> saved;
1508
- Action<void(std::unique_ptr<int>)> a2 = [&saved](std::unique_ptr<int> p) {
1509
- saved = std::move(p);
1510
- };
1511
- a2.Perform(make_tuple(UniqueInt(5)));
1512
- EXPECT_EQ(5, *saved);
1513
- }
1514
-
1515
- TEST(FunctorActionTest, PolymorphicFunctor) {
1516
- Action<int(int)> ai = Double();
1517
- EXPECT_EQ(2, ai.Perform(make_tuple(1)));
1518
- Action<double(double)> ad = Double(); // Double? Double double!
1519
- EXPECT_EQ(3.0, ad.Perform(make_tuple(1.5)));
1520
- }
1521
-
1522
- TEST(FunctorActionTest, TypeConversion) {
1523
- // Numeric promotions are allowed.
1524
- const Action<bool(int)> a1 = [](int i) { return i > 1; };
1525
- const Action<int(bool)> a2 = Action<int(bool)>(a1);
1526
- EXPECT_EQ(1, a1.Perform(make_tuple(42)));
1527
- EXPECT_EQ(0, a2.Perform(make_tuple(42)));
1528
-
1529
- // Implicit constructors are allowed.
1530
- const Action<bool(std::string)> s1 = [](std::string s) { return !s.empty(); };
1531
- const Action<int(const char*)> s2 = Action<int(const char*)>(s1);
1532
- EXPECT_EQ(0, s2.Perform(make_tuple("")));
1533
- EXPECT_EQ(1, s2.Perform(make_tuple("hello")));
1534
-
1535
- // Also between the lambda and the action itself.
1536
- const Action<bool(std::string)> x = [](Unused) { return 42; };
1537
- EXPECT_TRUE(x.Perform(make_tuple("hello")));
1538
- }
1539
-
1540
- TEST(FunctorActionTest, UnusedArguments) {
1541
- // Verify that users can ignore uninteresting arguments.
1542
- Action<int(int, double y, double z)> a =
1543
- [](int i, Unused, Unused) { return 2 * i; };
1544
- tuple<int, double, double> dummy = make_tuple(3, 7.3, 9.44);
1545
- EXPECT_EQ(6, a.Perform(dummy));
1546
- }
1547
-
1548
- // Test that basic built-in actions work with move-only arguments.
1549
- // TODO(rburny): Currently, almost all ActionInterface-based actions will not
1550
- // work, even if they only try to use other, copyable arguments. Implement them
1551
- // if necessary (but note that DoAll cannot work on non-copyable types anyway -
1552
- // so maybe it's better to make users use lambdas instead.
1553
- TEST(MoveOnlyArgumentsTest, ReturningActions) {
1554
- Action<int(std::unique_ptr<int>)> a = Return(1);
1555
- EXPECT_EQ(1, a.Perform(make_tuple(nullptr)));
1556
-
1557
- a = testing::WithoutArgs([]() { return 7; });
1558
- EXPECT_EQ(7, a.Perform(make_tuple(nullptr)));
1559
-
1560
- Action<void(std::unique_ptr<int>, int*)> a2 = testing::SetArgPointee<1>(3);
1561
- int x = 0;
1562
- a2.Perform(make_tuple(nullptr, &x));
1563
- EXPECT_EQ(x, 3);
1564
- }
1565
-
1566
- #endif // GTEST_LANG_CXX11
1567
-
1568
- } // Unnamed namespace
1569
-
1570
- #ifdef _MSC_VER
1571
- #if _MSC_VER == 1900
1572
- # pragma warning(pop)
1573
- #endif
1574
- #endif
1575
-