Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cross-lang tests for Bloom filter #439

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading