Skip to content

Commit

Permalink
Adding a single test.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Sep 24, 2023
1 parent 8fc18ac commit afa0167
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/toplevel_unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -4572,10 +4572,26 @@ DEFINE_TEST(convert_to_bitset) {
roaring_bitmap_free(r1);
}

// simple execution test
DEFINE_TEST(simple_roaring_bitmap_or_many) {
roaring_bitmap_t ** roaring_bitmaps;
roaring_bitmaps = (roaring_bitmap_t**) malloc(2 * sizeof(roaring_bitmap_t*));
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);
free(roaring_bitmaps);
}

int main() {
tellmeall();

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

0 comments on commit afa0167

Please sign in to comment.