Skip to content

Commit

Permalink
Adding a single test. (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire authored Sep 28, 2023
1 parent 0feb468 commit 1853e0d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/toplevel_unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -4595,6 +4595,18 @@ DEFINE_TEST(convert_to_bitset) {
roaring_bitmap_free(r1);
}

// simple execution test
DEFINE_TEST(simple_roaring_bitmap_or_many) {
roaring_bitmap_t * roaring_bitmaps[2];
roaring_bitmaps[0] = roaring_bitmap_create();
roaring_bitmaps[1] = roaring_bitmap_create();
for (uint32_t i = 100; i < 1000; i++) roaring_bitmap_add(roaring_bitmaps[0], i);
for (uint32_t i = 1000; i < 2000; i++) roaring_bitmap_add(roaring_bitmaps[1], i);
roaring_bitmap_t *bigunion = roaring_bitmap_or_many(2, (const roaring_bitmap_t**)roaring_bitmaps);
roaring_bitmap_free(roaring_bitmaps[0]);
roaring_bitmap_free(roaring_bitmaps[1]);
roaring_bitmap_free(bigunion);
}

bool deserialization_test(const char *data, size_t size) {
// We test that deserialization never fails.
Expand Down Expand Up @@ -4630,12 +4642,14 @@ DEFINE_TEST(robust_deserialization) {
// contains a run container that overflows the 16-bit boundary.
const char test1[] = "\x3b\x30\x00\x00\x01\x00\x00\xfa\x2e\x01\x00\x00\x02\xff\xff";
assert_true(deserialization_test(test1, sizeof(test1)));
>>>>>>> master
}

int main() {
tellmeall();

const struct CMUnitTest tests[] = {
cmocka_unit_test(simple_roaring_bitmap_or_many),
cmocka_unit_test(robust_deserialization),
cmocka_unit_test(issue457),
cmocka_unit_test(convert_to_bitset),
Expand Down

0 comments on commit 1853e0d

Please sign in to comment.