Skip to content

Commit

Permalink
fix type on num_hashes, change bloom_filter_filter to bloom_filter::b…
Browse files Browse the repository at this point in the history
…uilder
  • Loading branch information
Jon committed Aug 19, 2024
1 parent 4e4a944 commit 5a2706f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion filters/test/bloom_filter_deserialize_from_java_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions filters/test/bloom_filter_serialize_for_java.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint64_t>(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));
Expand Down

0 comments on commit 5a2706f

Please sign in to comment.