| 93 | NB(16384) \ |
| 94 | |
| 95 | static void |
| 96 | test_bitmap_initializer_body(const bitmap_info_t *binfo, size_t nbits) { |
| 97 | bitmap_info_t binfo_dyn; |
| 98 | bitmap_info_init(&binfo_dyn, nbits); |
| 99 | |
| 100 | assert_zu_eq(bitmap_size(binfo), bitmap_size(&binfo_dyn), |
| 101 | "Unexpected difference between static and dynamic initialization, " |
| 102 | "nbits=%zu", nbits); |
| 103 | assert_zu_eq(binfo->nbits, binfo_dyn.nbits, |
| 104 | "Unexpected difference between static and dynamic initialization, " |
| 105 | "nbits=%zu", nbits); |
| 106 | #ifdef BITMAP_USE_TREE |
| 107 | assert_u_eq(binfo->nlevels, binfo_dyn.nlevels, |
| 108 | "Unexpected difference between static and dynamic initialization, " |
| 109 | "nbits=%zu", nbits); |
| 110 | { |
| 111 | unsigned i; |
| 112 | |
| 113 | for (i = 0; i < binfo->nlevels; i++) { |
| 114 | assert_zu_eq(binfo->levels[i].group_offset, |
| 115 | binfo_dyn.levels[i].group_offset, |
| 116 | "Unexpected difference between static and dynamic " |
| 117 | "initialization, nbits=%zu, level=%u", nbits, i); |
| 118 | } |
| 119 | } |
| 120 | #else |
| 121 | assert_zu_eq(binfo->ngroups, binfo_dyn.ngroups, |
| 122 | "Unexpected difference between static and dynamic initialization"); |
| 123 | #endif |
| 124 | } |
| 125 | |
| 126 | TEST_BEGIN(test_bitmap_initializer) { |
| 127 | #define NB(nbits) { \ |
nothing calls this directly
no test coverage detected