clickhouse-native 0.0.1

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 (260) hide show
  1. checksums.yaml +7 -0
  2. data/ext/clickhouse_native/client.cpp +847 -0
  3. data/ext/clickhouse_native/extconf.rb +101 -0
  4. data/ext/clickhouse_native/vendor/clickhouse-cpp/.clang-format +11 -0
  5. data/ext/clickhouse_native/vendor/clickhouse-cpp/.git +1 -0
  6. data/ext/clickhouse_native/vendor/clickhouse-cpp/.gitattributes +63 -0
  7. data/ext/clickhouse_native/vendor/clickhouse-cpp/.github/CODEOWNERS +1 -0
  8. data/ext/clickhouse_native/vendor/clickhouse-cpp/.github/workflows/linux.yml +139 -0
  9. data/ext/clickhouse_native/vendor/clickhouse-cpp/.github/workflows/macos.yml +87 -0
  10. data/ext/clickhouse_native/vendor/clickhouse-cpp/.github/workflows/windows_mingw.yml +102 -0
  11. data/ext/clickhouse_native/vendor/clickhouse-cpp/.github/workflows/windows_msvc.yml +74 -0
  12. data/ext/clickhouse_native/vendor/clickhouse-cpp/.gitignore +280 -0
  13. data/ext/clickhouse_native/vendor/clickhouse-cpp/.travis.yml +62 -0
  14. data/ext/clickhouse_native/vendor/clickhouse-cpp/CMakeLists.txt +157 -0
  15. data/ext/clickhouse_native/vendor/clickhouse-cpp/LICENSE +206 -0
  16. data/ext/clickhouse_native/vendor/clickhouse-cpp/README.md +260 -0
  17. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/CMakeLists.txt +246 -0
  18. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/buffer.h +10 -0
  19. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/compressed.cpp +258 -0
  20. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/compressed.h +48 -0
  21. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/endpoints_iterator.cpp +20 -0
  22. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/endpoints_iterator.h +34 -0
  23. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/input.cpp +96 -0
  24. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/input.h +103 -0
  25. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/open_telemetry.h +23 -0
  26. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/output.cpp +119 -0
  27. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/output.h +142 -0
  28. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/platform.cpp +1 -0
  29. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/platform.h +33 -0
  30. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/projected_iterator.h +55 -0
  31. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/singleton.h +11 -0
  32. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/socket.cpp +489 -0
  33. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/socket.h +177 -0
  34. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/sslsocket.cpp +307 -0
  35. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/sslsocket.h +111 -0
  36. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/string_utils.h +28 -0
  37. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/string_view.h +142 -0
  38. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/uuid.h +10 -0
  39. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/wire_format.cpp +177 -0
  40. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/base/wire_format.h +79 -0
  41. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/block.cpp +134 -0
  42. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/block.h +114 -0
  43. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/client.cpp +1269 -0
  44. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/client.h +320 -0
  45. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/array.cpp +175 -0
  46. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/array.h +321 -0
  47. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/column.cpp +24 -0
  48. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/column.h +107 -0
  49. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/date.cpp +365 -0
  50. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/date.h +245 -0
  51. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/decimal.cpp +255 -0
  52. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/decimal.h +50 -0
  53. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/enum.cpp +123 -0
  54. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/enum.h +65 -0
  55. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/factory.cpp +285 -0
  56. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/factory.h +14 -0
  57. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/geo.cpp +108 -0
  58. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/geo.h +79 -0
  59. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/ip4.cpp +117 -0
  60. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/ip4.h +71 -0
  61. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/ip6.cpp +108 -0
  62. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/ip6.h +66 -0
  63. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/itemview.cpp +101 -0
  64. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/itemview.h +86 -0
  65. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/lowcardinality.cpp +527 -0
  66. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/lowcardinality.h +221 -0
  67. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/lowcardinalityadaptor.h +63 -0
  68. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/map.cpp +87 -0
  69. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/map.h +257 -0
  70. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/nothing.h +87 -0
  71. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/nullable.cpp +109 -0
  72. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/nullable.h +153 -0
  73. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/numeric.cpp +126 -0
  74. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/numeric.h +88 -0
  75. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/string.cpp +333 -0
  76. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/string.h +145 -0
  77. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/time.cpp +155 -0
  78. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/time.h +118 -0
  79. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/tuple.cpp +106 -0
  80. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/tuple.h +178 -0
  81. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/utils.h +41 -0
  82. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/uuid.cpp +80 -0
  83. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/columns/uuid.h +58 -0
  84. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/error_codes.h +595 -0
  85. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/exceptions.h +66 -0
  86. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/protocol.h +54 -0
  87. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/query.cpp +25 -0
  88. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/query.h +246 -0
  89. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/server_exception.h +16 -0
  90. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/types/type_parser.cpp +314 -0
  91. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/types/type_parser.h +89 -0
  92. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/types/types.cpp +484 -0
  93. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/types/types.h +397 -0
  94. data/ext/clickhouse_native/vendor/clickhouse-cpp/clickhouse/version.h +14 -0
  95. data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/Findcityhash.cmake +26 -0
  96. data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/Findlz4.cmake +39 -0
  97. data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/Findzstd.cmake +39 -0
  98. data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/cpp17.cmake +8 -0
  99. data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/openssl.cmake +8 -0
  100. data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/subdirs.cmake +5 -0
  101. data/ext/clickhouse_native/vendor/clickhouse-cpp/cmake/version.cmake +87 -0
  102. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/CMakeLists.txt +9 -0
  103. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/attributes.h +682 -0
  104. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/config.h +714 -0
  105. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/internal/bits.h +219 -0
  106. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/macros.h +147 -0
  107. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/optimization.h +241 -0
  108. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/options.h +238 -0
  109. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/policy_checks.h +111 -0
  110. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/base/port.h +26 -0
  111. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/numeric/int128.cc +390 -0
  112. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/numeric/int128.h +1092 -0
  113. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/numeric/int128_have_intrinsic.inc +302 -0
  114. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/absl/absl/numeric/int128_no_intrinsic.inc +308 -0
  115. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/BUCK +13 -0
  116. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/CMakeLists.txt +7 -0
  117. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/COPYING +19 -0
  118. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/city.cc +469 -0
  119. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/city.h +90 -0
  120. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/citycrc.h +43 -0
  121. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/cityhash/cityhash/config.h +118 -0
  122. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/BUCK +14 -0
  123. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/CMakeLists.txt +4 -0
  124. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/LICENSE +28 -0
  125. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/README.md +1 -0
  126. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-death-test.h +346 -0
  127. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-matchers.h +930 -0
  128. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-message.h +219 -0
  129. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-param-test.h +507 -0
  130. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-printers.h +1029 -0
  131. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-spi.h +238 -0
  132. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-test-part.h +184 -0
  133. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest-typed-test.h +329 -0
  134. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest.h +2495 -0
  135. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest_pred_impl.h +359 -0
  136. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/gtest_prod.h +61 -0
  137. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/custom/README.md +56 -0
  138. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/custom/gtest-port.h +37 -0
  139. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/custom/gtest-printers.h +42 -0
  140. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/custom/gtest.h +37 -0
  141. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-death-test-internal.h +304 -0
  142. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-filepath.h +211 -0
  143. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-internal.h +1560 -0
  144. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-param-util.h +947 -0
  145. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-port-arch.h +114 -0
  146. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-port.h +2389 -0
  147. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-string.h +175 -0
  148. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/include/gtest/internal/gtest-type-util.h +183 -0
  149. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-all.cc +48 -0
  150. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-death-test.cc +1644 -0
  151. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-filepath.cc +369 -0
  152. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-internal-inl.h +1221 -0
  153. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-matchers.cc +97 -0
  154. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-port.cc +1433 -0
  155. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-printers.cc +533 -0
  156. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-test-part.cc +108 -0
  157. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest-typed-test.cc +107 -0
  158. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest.cc +6746 -0
  159. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/gtest/src/gtest_main.cc +54 -0
  160. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/BUCK +13 -0
  161. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/CMakeLists.txt +8 -0
  162. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/LICENSE +24 -0
  163. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/lz4.c +2402 -0
  164. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/lz4.h +764 -0
  165. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/lz4hc.c +1554 -0
  166. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/lz4/lz4/lz4hc.h +438 -0
  167. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/BUCK +232 -0
  168. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/CMakeLists.txt +115 -0
  169. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/LICENSE +30 -0
  170. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/allocations.h +55 -0
  171. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/bits.h +200 -0
  172. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/bitstream.h +437 -0
  173. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/compiler.h +358 -0
  174. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/cpu.h +213 -0
  175. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/debug.c +24 -0
  176. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/debug.h +107 -0
  177. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/entropy_common.c +340 -0
  178. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/error_private.c +63 -0
  179. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/error_private.h +159 -0
  180. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/fse.h +639 -0
  181. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/fse_decompress.c +311 -0
  182. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/huf.h +273 -0
  183. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/mem.h +435 -0
  184. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/pool.c +371 -0
  185. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/pool.h +90 -0
  186. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/portability_macros.h +156 -0
  187. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/threading.c +176 -0
  188. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/threading.h +150 -0
  189. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/xxhash.c +24 -0
  190. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/xxhash.h +5686 -0
  191. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/zstd_common.c +48 -0
  192. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/zstd_deps.h +111 -0
  193. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/zstd_internal.h +392 -0
  194. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/common/zstd_trace.h +163 -0
  195. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/clevels.h +134 -0
  196. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/fse_compress.c +624 -0
  197. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/hist.c +181 -0
  198. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/hist.h +75 -0
  199. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/huf_compress.c +1435 -0
  200. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress.c +7032 -0
  201. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_internal.h +1532 -0
  202. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_literals.c +235 -0
  203. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_literals.h +39 -0
  204. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_sequences.c +442 -0
  205. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_sequences.h +54 -0
  206. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_superblock.c +577 -0
  207. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_compress_superblock.h +32 -0
  208. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_cwksp.h +742 -0
  209. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_double_fast.c +758 -0
  210. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_double_fast.h +39 -0
  211. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_fast.c +960 -0
  212. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_fast.h +38 -0
  213. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_lazy.c +2157 -0
  214. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_lazy.h +127 -0
  215. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_ldm.c +724 -0
  216. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_ldm.h +117 -0
  217. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_ldm_geartab.h +106 -0
  218. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_opt.c +1472 -0
  219. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstd_opt.h +56 -0
  220. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstdmt_compress.c +1867 -0
  221. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/compress/zstdmt_compress.h +113 -0
  222. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/huf_decompress.c +1882 -0
  223. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/huf_decompress_amd64.S +576 -0
  224. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/zstd_ddict.c +244 -0
  225. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/zstd_ddict.h +44 -0
  226. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/zstd_decompress.c +2355 -0
  227. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/zstd_decompress_block.c +2192 -0
  228. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/zstd_decompress_block.h +73 -0
  229. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/decompress/zstd_decompress_internal.h +238 -0
  230. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/dictBuilder/cover.c +1257 -0
  231. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/dictBuilder/cover.h +158 -0
  232. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/dictBuilder/divsufsort.c +1913 -0
  233. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/dictBuilder/divsufsort.h +67 -0
  234. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/dictBuilder/fastcover.c +766 -0
  235. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/dictBuilder/zdict.c +1127 -0
  236. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_legacy.h +422 -0
  237. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v01.c +2125 -0
  238. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v01.h +94 -0
  239. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v02.c +3477 -0
  240. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v02.h +93 -0
  241. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v03.c +3117 -0
  242. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v03.h +93 -0
  243. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v04.c +3605 -0
  244. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v04.h +142 -0
  245. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v05.c +4004 -0
  246. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v05.h +162 -0
  247. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v06.c +4113 -0
  248. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v06.h +172 -0
  249. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v07.c +4498 -0
  250. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/legacy/zstd_v07.h +187 -0
  251. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/zdict.h +474 -0
  252. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/zstd.h +3020 -0
  253. data/ext/clickhouse_native/vendor/clickhouse-cpp/contrib/zstd/zstd/zstd_errors.h +114 -0
  254. data/lib/clickhouse_native/clickhouse_native.bundle +0 -0
  255. data/lib/clickhouse_native/client.rb +50 -0
  256. data/lib/clickhouse_native/errors.rb +23 -0
  257. data/lib/clickhouse_native/pool.rb +49 -0
  258. data/lib/clickhouse_native/version.rb +3 -0
  259. data/lib/clickhouse_native.rb +8 -0
  260. metadata +369 -0
@@ -0,0 +1,507 @@
1
+ // Copyright 2008, Google Inc.
2
+ // All rights reserved.
3
+ //
4
+ // Redistribution and use in source and binary forms, with or without
5
+ // modification, are permitted provided that the following conditions are
6
+ // met:
7
+ //
8
+ // * Redistributions of source code must retain the above copyright
9
+ // notice, this list of conditions and the following disclaimer.
10
+ // * Redistributions in binary form must reproduce the above
11
+ // copyright notice, this list of conditions and the following disclaimer
12
+ // in the documentation and/or other materials provided with the
13
+ // distribution.
14
+ // * Neither the name of Google Inc. nor the names of its
15
+ // contributors may be used to endorse or promote products derived from
16
+ // this software without specific prior written permission.
17
+ //
18
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+ //
30
+ // Macros and functions for implementing parameterized tests
31
+ // in Google C++ Testing and Mocking Framework (Google Test)
32
+ //
33
+ // GOOGLETEST_CM0001 DO NOT DELETE
34
+ #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
35
+ #define GOOGLETEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
36
+
37
+ // Value-parameterized tests allow you to test your code with different
38
+ // parameters without writing multiple copies of the same test.
39
+ //
40
+ // Here is how you use value-parameterized tests:
41
+
42
+ #if 0
43
+
44
+ // To write value-parameterized tests, first you should define a fixture
45
+ // class. It is usually derived from testing::TestWithParam<T> (see below for
46
+ // another inheritance scheme that's sometimes useful in more complicated
47
+ // class hierarchies), where the type of your parameter values.
48
+ // TestWithParam<T> is itself derived from testing::Test. T can be any
49
+ // copyable type. If it's a raw pointer, you are responsible for managing the
50
+ // lifespan of the pointed values.
51
+
52
+ class FooTest : public ::testing::TestWithParam<const char*> {
53
+ // You can implement all the usual class fixture members here.
54
+ };
55
+
56
+ // Then, use the TEST_P macro to define as many parameterized tests
57
+ // for this fixture as you want. The _P suffix is for "parameterized"
58
+ // or "pattern", whichever you prefer to think.
59
+
60
+ TEST_P(FooTest, DoesBlah) {
61
+ // Inside a test, access the test parameter with the GetParam() method
62
+ // of the TestWithParam<T> class:
63
+ EXPECT_TRUE(foo.Blah(GetParam()));
64
+ ...
65
+ }
66
+
67
+ TEST_P(FooTest, HasBlahBlah) {
68
+ ...
69
+ }
70
+
71
+ // Finally, you can use INSTANTIATE_TEST_SUITE_P to instantiate the test
72
+ // case with any set of parameters you want. Google Test defines a number
73
+ // of functions for generating test parameters. They return what we call
74
+ // (surprise!) parameter generators. Here is a summary of them, which
75
+ // are all in the testing namespace:
76
+ //
77
+ //
78
+ // Range(begin, end [, step]) - Yields values {begin, begin+step,
79
+ // begin+step+step, ...}. The values do not
80
+ // include end. step defaults to 1.
81
+ // Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
82
+ // ValuesIn(container) - Yields values from a C-style array, an STL
83
+ // ValuesIn(begin,end) container, or an iterator range [begin, end).
84
+ // Bool() - Yields sequence {false, true}.
85
+ // Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
86
+ // for the math savvy) of the values generated
87
+ // by the N generators.
88
+ //
89
+ // For more details, see comments at the definitions of these functions below
90
+ // in this file.
91
+ //
92
+ // The following statement will instantiate tests from the FooTest test suite
93
+ // each with parameter values "meeny", "miny", and "moe".
94
+
95
+ INSTANTIATE_TEST_SUITE_P(InstantiationName,
96
+ FooTest,
97
+ Values("meeny", "miny", "moe"));
98
+
99
+ // To distinguish different instances of the pattern, (yes, you
100
+ // can instantiate it more than once) the first argument to the
101
+ // INSTANTIATE_TEST_SUITE_P macro is a prefix that will be added to the
102
+ // actual test suite name. Remember to pick unique prefixes for different
103
+ // instantiations. The tests from the instantiation above will have
104
+ // these names:
105
+ //
106
+ // * InstantiationName/FooTest.DoesBlah/0 for "meeny"
107
+ // * InstantiationName/FooTest.DoesBlah/1 for "miny"
108
+ // * InstantiationName/FooTest.DoesBlah/2 for "moe"
109
+ // * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
110
+ // * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
111
+ // * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
112
+ //
113
+ // You can use these names in --gtest_filter.
114
+ //
115
+ // This statement will instantiate all tests from FooTest again, each
116
+ // with parameter values "cat" and "dog":
117
+
118
+ const char* pets[] = {"cat", "dog"};
119
+ INSTANTIATE_TEST_SUITE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
120
+
121
+ // The tests from the instantiation above will have these names:
122
+ //
123
+ // * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
124
+ // * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
125
+ // * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
126
+ // * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
127
+ //
128
+ // Please note that INSTANTIATE_TEST_SUITE_P will instantiate all tests
129
+ // in the given test suite, whether their definitions come before or
130
+ // AFTER the INSTANTIATE_TEST_SUITE_P statement.
131
+ //
132
+ // Please also note that generator expressions (including parameters to the
133
+ // generators) are evaluated in InitGoogleTest(), after main() has started.
134
+ // This allows the user on one hand, to adjust generator parameters in order
135
+ // to dynamically determine a set of tests to run and on the other hand,
136
+ // give the user a chance to inspect the generated tests with Google Test
137
+ // reflection API before RUN_ALL_TESTS() is executed.
138
+ //
139
+ // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
140
+ // for more examples.
141
+ //
142
+ // In the future, we plan to publish the API for defining new parameter
143
+ // generators. But for now this interface remains part of the internal
144
+ // implementation and is subject to change.
145
+ //
146
+ //
147
+ // A parameterized test fixture must be derived from testing::Test and from
148
+ // testing::WithParamInterface<T>, where T is the type of the parameter
149
+ // values. Inheriting from TestWithParam<T> satisfies that requirement because
150
+ // TestWithParam<T> inherits from both Test and WithParamInterface. In more
151
+ // complicated hierarchies, however, it is occasionally useful to inherit
152
+ // separately from Test and WithParamInterface. For example:
153
+
154
+ class BaseTest : public ::testing::Test {
155
+ // You can inherit all the usual members for a non-parameterized test
156
+ // fixture here.
157
+ };
158
+
159
+ class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
160
+ // The usual test fixture members go here too.
161
+ };
162
+
163
+ TEST_F(BaseTest, HasFoo) {
164
+ // This is an ordinary non-parameterized test.
165
+ }
166
+
167
+ TEST_P(DerivedTest, DoesBlah) {
168
+ // GetParam works just the same here as if you inherit from TestWithParam.
169
+ EXPECT_TRUE(foo.Blah(GetParam()));
170
+ }
171
+
172
+ #endif // 0
173
+
174
+ #include <iterator>
175
+ #include <utility>
176
+
177
+ #include "gtest/internal/gtest-internal.h"
178
+ #include "gtest/internal/gtest-param-util.h"
179
+ #include "gtest/internal/gtest-port.h"
180
+
181
+ namespace testing {
182
+
183
+ // Functions producing parameter generators.
184
+ //
185
+ // Google Test uses these generators to produce parameters for value-
186
+ // parameterized tests. When a parameterized test suite is instantiated
187
+ // with a particular generator, Google Test creates and runs tests
188
+ // for each element in the sequence produced by the generator.
189
+ //
190
+ // In the following sample, tests from test suite FooTest are instantiated
191
+ // each three times with parameter values 3, 5, and 8:
192
+ //
193
+ // class FooTest : public TestWithParam<int> { ... };
194
+ //
195
+ // TEST_P(FooTest, TestThis) {
196
+ // }
197
+ // TEST_P(FooTest, TestThat) {
198
+ // }
199
+ // INSTANTIATE_TEST_SUITE_P(TestSequence, FooTest, Values(3, 5, 8));
200
+ //
201
+
202
+ // Range() returns generators providing sequences of values in a range.
203
+ //
204
+ // Synopsis:
205
+ // Range(start, end)
206
+ // - returns a generator producing a sequence of values {start, start+1,
207
+ // start+2, ..., }.
208
+ // Range(start, end, step)
209
+ // - returns a generator producing a sequence of values {start, start+step,
210
+ // start+step+step, ..., }.
211
+ // Notes:
212
+ // * The generated sequences never include end. For example, Range(1, 5)
213
+ // returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
214
+ // returns a generator producing {1, 3, 5, 7}.
215
+ // * start and end must have the same type. That type may be any integral or
216
+ // floating-point type or a user defined type satisfying these conditions:
217
+ // * It must be assignable (have operator=() defined).
218
+ // * It must have operator+() (operator+(int-compatible type) for
219
+ // two-operand version).
220
+ // * It must have operator<() defined.
221
+ // Elements in the resulting sequences will also have that type.
222
+ // * Condition start < end must be satisfied in order for resulting sequences
223
+ // to contain any elements.
224
+ //
225
+ template <typename T, typename IncrementT>
226
+ internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
227
+ return internal::ParamGenerator<T>(
228
+ new internal::RangeGenerator<T, IncrementT>(start, end, step));
229
+ }
230
+
231
+ template <typename T>
232
+ internal::ParamGenerator<T> Range(T start, T end) {
233
+ return Range(start, end, 1);
234
+ }
235
+
236
+ // ValuesIn() function allows generation of tests with parameters coming from
237
+ // a container.
238
+ //
239
+ // Synopsis:
240
+ // ValuesIn(const T (&array)[N])
241
+ // - returns a generator producing sequences with elements from
242
+ // a C-style array.
243
+ // ValuesIn(const Container& container)
244
+ // - returns a generator producing sequences with elements from
245
+ // an STL-style container.
246
+ // ValuesIn(Iterator begin, Iterator end)
247
+ // - returns a generator producing sequences with elements from
248
+ // a range [begin, end) defined by a pair of STL-style iterators. These
249
+ // iterators can also be plain C pointers.
250
+ //
251
+ // Please note that ValuesIn copies the values from the containers
252
+ // passed in and keeps them to generate tests in RUN_ALL_TESTS().
253
+ //
254
+ // Examples:
255
+ //
256
+ // This instantiates tests from test suite StringTest
257
+ // each with C-string values of "foo", "bar", and "baz":
258
+ //
259
+ // const char* strings[] = {"foo", "bar", "baz"};
260
+ // INSTANTIATE_TEST_SUITE_P(StringSequence, StringTest, ValuesIn(strings));
261
+ //
262
+ // This instantiates tests from test suite StlStringTest
263
+ // each with STL strings with values "a" and "b":
264
+ //
265
+ // ::std::vector< ::std::string> GetParameterStrings() {
266
+ // ::std::vector< ::std::string> v;
267
+ // v.push_back("a");
268
+ // v.push_back("b");
269
+ // return v;
270
+ // }
271
+ //
272
+ // INSTANTIATE_TEST_SUITE_P(CharSequence,
273
+ // StlStringTest,
274
+ // ValuesIn(GetParameterStrings()));
275
+ //
276
+ //
277
+ // This will also instantiate tests from CharTest
278
+ // each with parameter values 'a' and 'b':
279
+ //
280
+ // ::std::list<char> GetParameterChars() {
281
+ // ::std::list<char> list;
282
+ // list.push_back('a');
283
+ // list.push_back('b');
284
+ // return list;
285
+ // }
286
+ // ::std::list<char> l = GetParameterChars();
287
+ // INSTANTIATE_TEST_SUITE_P(CharSequence2,
288
+ // CharTest,
289
+ // ValuesIn(l.begin(), l.end()));
290
+ //
291
+ template <typename ForwardIterator>
292
+ internal::ParamGenerator<
293
+ typename std::iterator_traits<ForwardIterator>::value_type>
294
+ ValuesIn(ForwardIterator begin, ForwardIterator end) {
295
+ typedef typename std::iterator_traits<ForwardIterator>::value_type ParamType;
296
+ return internal::ParamGenerator<ParamType>(
297
+ new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
298
+ }
299
+
300
+ template <typename T, size_t N>
301
+ internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
302
+ return ValuesIn(array, array + N);
303
+ }
304
+
305
+ template <class Container>
306
+ internal::ParamGenerator<typename Container::value_type> ValuesIn(
307
+ const Container& container) {
308
+ return ValuesIn(container.begin(), container.end());
309
+ }
310
+
311
+ // Values() allows generating tests from explicitly specified list of
312
+ // parameters.
313
+ //
314
+ // Synopsis:
315
+ // Values(T v1, T v2, ..., T vN)
316
+ // - returns a generator producing sequences with elements v1, v2, ..., vN.
317
+ //
318
+ // For example, this instantiates tests from test suite BarTest each
319
+ // with values "one", "two", and "three":
320
+ //
321
+ // INSTANTIATE_TEST_SUITE_P(NumSequence,
322
+ // BarTest,
323
+ // Values("one", "two", "three"));
324
+ //
325
+ // This instantiates tests from test suite BazTest each with values 1, 2, 3.5.
326
+ // The exact type of values will depend on the type of parameter in BazTest.
327
+ //
328
+ // INSTANTIATE_TEST_SUITE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
329
+ //
330
+ //
331
+ template <typename... T>
332
+ internal::ValueArray<T...> Values(T... v) {
333
+ return internal::ValueArray<T...>(std::move(v)...);
334
+ }
335
+
336
+ // Bool() allows generating tests with parameters in a set of (false, true).
337
+ //
338
+ // Synopsis:
339
+ // Bool()
340
+ // - returns a generator producing sequences with elements {false, true}.
341
+ //
342
+ // It is useful when testing code that depends on Boolean flags. Combinations
343
+ // of multiple flags can be tested when several Bool()'s are combined using
344
+ // Combine() function.
345
+ //
346
+ // In the following example all tests in the test suite FlagDependentTest
347
+ // will be instantiated twice with parameters false and true.
348
+ //
349
+ // class FlagDependentTest : public testing::TestWithParam<bool> {
350
+ // virtual void SetUp() {
351
+ // external_flag = GetParam();
352
+ // }
353
+ // }
354
+ // INSTANTIATE_TEST_SUITE_P(BoolSequence, FlagDependentTest, Bool());
355
+ //
356
+ inline internal::ParamGenerator<bool> Bool() {
357
+ return Values(false, true);
358
+ }
359
+
360
+ // Combine() allows the user to combine two or more sequences to produce
361
+ // values of a Cartesian product of those sequences' elements.
362
+ //
363
+ // Synopsis:
364
+ // Combine(gen1, gen2, ..., genN)
365
+ // - returns a generator producing sequences with elements coming from
366
+ // the Cartesian product of elements from the sequences generated by
367
+ // gen1, gen2, ..., genN. The sequence elements will have a type of
368
+ // std::tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
369
+ // of elements from sequences produces by gen1, gen2, ..., genN.
370
+ //
371
+ // Example:
372
+ //
373
+ // This will instantiate tests in test suite AnimalTest each one with
374
+ // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
375
+ // tuple("dog", BLACK), and tuple("dog", WHITE):
376
+ //
377
+ // enum Color { BLACK, GRAY, WHITE };
378
+ // class AnimalTest
379
+ // : public testing::TestWithParam<std::tuple<const char*, Color> > {...};
380
+ //
381
+ // TEST_P(AnimalTest, AnimalLooksNice) {...}
382
+ //
383
+ // INSTANTIATE_TEST_SUITE_P(AnimalVariations, AnimalTest,
384
+ // Combine(Values("cat", "dog"),
385
+ // Values(BLACK, WHITE)));
386
+ //
387
+ // This will instantiate tests in FlagDependentTest with all variations of two
388
+ // Boolean flags:
389
+ //
390
+ // class FlagDependentTest
391
+ // : public testing::TestWithParam<std::tuple<bool, bool> > {
392
+ // virtual void SetUp() {
393
+ // // Assigns external_flag_1 and external_flag_2 values from the tuple.
394
+ // std::tie(external_flag_1, external_flag_2) = GetParam();
395
+ // }
396
+ // };
397
+ //
398
+ // TEST_P(FlagDependentTest, TestFeature1) {
399
+ // // Test your code using external_flag_1 and external_flag_2 here.
400
+ // }
401
+ // INSTANTIATE_TEST_SUITE_P(TwoBoolSequence, FlagDependentTest,
402
+ // Combine(Bool(), Bool()));
403
+ //
404
+ template <typename... Generator>
405
+ internal::CartesianProductHolder<Generator...> Combine(const Generator&... g) {
406
+ return internal::CartesianProductHolder<Generator...>(g...);
407
+ }
408
+
409
+ #define TEST_P(test_suite_name, test_name) \
410
+ class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
411
+ : public test_suite_name { \
412
+ public: \
413
+ GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \
414
+ void TestBody() override; \
415
+ \
416
+ private: \
417
+ static int AddToRegistry() { \
418
+ ::testing::UnitTest::GetInstance() \
419
+ ->parameterized_test_registry() \
420
+ .GetTestSuitePatternHolder<test_suite_name>( \
421
+ GTEST_STRINGIFY_(test_suite_name), \
422
+ ::testing::internal::CodeLocation(__FILE__, __LINE__)) \
423
+ ->AddTestPattern( \
424
+ GTEST_STRINGIFY_(test_suite_name), GTEST_STRINGIFY_(test_name), \
425
+ new ::testing::internal::TestMetaFactory<GTEST_TEST_CLASS_NAME_( \
426
+ test_suite_name, test_name)>(), \
427
+ ::testing::internal::CodeLocation(__FILE__, __LINE__)); \
428
+ return 0; \
429
+ } \
430
+ static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
431
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \
432
+ test_name)); \
433
+ }; \
434
+ int GTEST_TEST_CLASS_NAME_(test_suite_name, \
435
+ test_name)::gtest_registering_dummy_ = \
436
+ GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::AddToRegistry(); \
437
+ void GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::TestBody()
438
+
439
+ // The last argument to INSTANTIATE_TEST_SUITE_P allows the user to specify
440
+ // generator and an optional function or functor that generates custom test name
441
+ // suffixes based on the test parameters. Such a function or functor should
442
+ // accept one argument of type testing::TestParamInfo<class ParamType>, and
443
+ // return std::string.
444
+ //
445
+ // testing::PrintToStringParamName is a builtin test suffix generator that
446
+ // returns the value of testing::PrintToString(GetParam()).
447
+ //
448
+ // Note: test names must be non-empty, unique, and may only contain ASCII
449
+ // alphanumeric characters or underscore. Because PrintToString adds quotes
450
+ // to std::string and C strings, it won't work for these types.
451
+
452
+ #define GTEST_EXPAND_(arg) arg
453
+ #define GTEST_GET_FIRST_(first, ...) first
454
+ #define GTEST_GET_SECOND_(first, second, ...) second
455
+
456
+ #define INSTANTIATE_TEST_SUITE_P(prefix, test_suite_name, ...) \
457
+ static ::testing::internal::ParamGenerator<test_suite_name::ParamType> \
458
+ gtest_##prefix##test_suite_name##_EvalGenerator_() { \
459
+ return GTEST_EXPAND_(GTEST_GET_FIRST_(__VA_ARGS__, DUMMY_PARAM_)); \
460
+ } \
461
+ static ::std::string gtest_##prefix##test_suite_name##_EvalGenerateName_( \
462
+ const ::testing::TestParamInfo<test_suite_name::ParamType>& info) { \
463
+ if (::testing::internal::AlwaysFalse()) { \
464
+ ::testing::internal::TestNotEmpty(GTEST_EXPAND_(GTEST_GET_SECOND_( \
465
+ __VA_ARGS__, \
466
+ ::testing::internal::DefaultParamName<test_suite_name::ParamType>, \
467
+ DUMMY_PARAM_))); \
468
+ auto t = std::make_tuple(__VA_ARGS__); \
469
+ static_assert(std::tuple_size<decltype(t)>::value <= 2, \
470
+ "Too Many Args!"); \
471
+ } \
472
+ return ((GTEST_EXPAND_(GTEST_GET_SECOND_( \
473
+ __VA_ARGS__, \
474
+ ::testing::internal::DefaultParamName<test_suite_name::ParamType>, \
475
+ DUMMY_PARAM_))))(info); \
476
+ } \
477
+ static int gtest_##prefix##test_suite_name##_dummy_ \
478
+ GTEST_ATTRIBUTE_UNUSED_ = \
479
+ ::testing::UnitTest::GetInstance() \
480
+ ->parameterized_test_registry() \
481
+ .GetTestSuitePatternHolder<test_suite_name>( \
482
+ GTEST_STRINGIFY_(test_suite_name), \
483
+ ::testing::internal::CodeLocation(__FILE__, __LINE__)) \
484
+ ->AddTestSuiteInstantiation( \
485
+ GTEST_STRINGIFY_(prefix), \
486
+ &gtest_##prefix##test_suite_name##_EvalGenerator_, \
487
+ &gtest_##prefix##test_suite_name##_EvalGenerateName_, \
488
+ __FILE__, __LINE__)
489
+
490
+
491
+ // Allow Marking a Parameterized test class as not needing to be instantiated.
492
+ #define GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(T) \
493
+ namespace gtest_do_not_use_outside_namespace_scope {} \
494
+ static const ::testing::internal::MarkAsIgnored gtest_allow_ignore_##T( \
495
+ GTEST_STRINGIFY_(T))
496
+
497
+ // Legacy API is deprecated but still available
498
+ #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
499
+ #define INSTANTIATE_TEST_CASE_P \
500
+ static_assert(::testing::internal::InstantiateTestCase_P_IsDeprecated(), \
501
+ ""); \
502
+ INSTANTIATE_TEST_SUITE_P
503
+ #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
504
+
505
+ } // namespace testing
506
+
507
+ #endif // GOOGLETEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_