From 5a2706f3a9a7871ee504f6ca94a88a14c5deb4e9 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 19 Aug 2024 00:29:01 -0700 Subject: [PATCH] fix type on num_hashes, change bloom_filter_filter to bloom_filter::builder --- filters/test/bloom_filter_deserialize_from_java_test.cpp | 2 +- filters/test/bloom_filter_serialize_for_java.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/filters/test/bloom_filter_deserialize_from_java_test.cpp b/filters/test/bloom_filter_deserialize_from_java_test.cpp index 259eb4ff..126bac0c 100644 --- a/filters/test/bloom_filter_deserialize_from_java_test.cpp +++ b/filters/test/bloom_filter_deserialize_from_java_test.cpp @@ -30,7 +30,7 @@ static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + " TEST_CASE("bloom_filter", "[serde_compat]") { const uint64_t n_arr[] = {0, 10000, 2000000, 30000000}; - const double h_arr[] = {3, 5}; + const uint16_t h_arr[] = {3, 5}; for (const uint64_t n: n_arr) { for (const uint16_t num_hashes: h_arr) { std::ifstream is; diff --git a/filters/test/bloom_filter_serialize_for_java.cpp b/filters/test/bloom_filter_serialize_for_java.cpp index be4e62b1..cf9ac30d 100644 --- a/filters/test/bloom_filter_serialize_for_java.cpp +++ b/filters/test/bloom_filter_serialize_for_java.cpp @@ -27,11 +27,11 @@ namespace datasketches { TEST_CASE("bloom filter generate", "[serialize_for_java]") { const uint64_t n_arr[] = {0, 10000, 2000000, 30000000}; - const double h_arr[] = {3, 5}; + const uint16_t h_arr[] = {3, 5}; for (const uint64_t n: n_arr) { for (const uint16_t num_hashes: h_arr) { const uint64_t config_bits = std::max(n, static_cast(1000)); // so empty still has valid bit size - bloom_filter bf = bloom_filter_builder::create_by_size(config_bits, num_hashes); + bloom_filter bf = bloom_filter::builder::create_by_size(config_bits, num_hashes); for (uint64_t i = 0; i < n / 10; ++i) bf.update(i); // note: n / 10 items into n bits if (n > 0) bf.update(std::nan("1")); // include a NaN if non-empty REQUIRE(bf.is_empty() == (n == 0));