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