Skip to content

Commit bceeb2d

Browse files
authored
Merge pull request #439 from apache/bf_serde_compat_fix
Fix cross-lang tests for Bloom filter
2 parents 4e4a944 + 5a2706f commit bceeb2d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

filters/test/bloom_filter_deserialize_from_java_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "
3030

3131
TEST_CASE("bloom_filter", "[serde_compat]") {
3232
const uint64_t n_arr[] = {0, 10000, 2000000, 30000000};
33-
const double h_arr[] = {3, 5};
33+
const uint16_t h_arr[] = {3, 5};
3434
for (const uint64_t n: n_arr) {
3535
for (const uint16_t num_hashes: h_arr) {
3636
std::ifstream is;

filters/test/bloom_filter_serialize_for_java.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ namespace datasketches {
2727

2828
TEST_CASE("bloom filter generate", "[serialize_for_java]") {
2929
const uint64_t n_arr[] = {0, 10000, 2000000, 30000000};
30-
const double h_arr[] = {3, 5};
30+
const uint16_t h_arr[] = {3, 5};
3131
for (const uint64_t n: n_arr) {
3232
for (const uint16_t num_hashes: h_arr) {
3333
const uint64_t config_bits = std::max(n, static_cast<uint64_t>(1000)); // so empty still has valid bit size
34-
bloom_filter bf = bloom_filter_builder::create_by_size(config_bits, num_hashes);
34+
bloom_filter bf = bloom_filter::builder::create_by_size(config_bits, num_hashes);
3535
for (uint64_t i = 0; i < n / 10; ++i) bf.update(i); // note: n / 10 items into n bits
3636
if (n > 0) bf.update(std::nan("1")); // include a NaN if non-empty
3737
REQUIRE(bf.is_empty() == (n == 0));

0 commit comments

Comments
 (0)