Lines Matching refs:nbits

96 test_bitmap_initializer_body(const bitmap_info_t *binfo, size_t nbits) {  in test_bitmap_initializer_body()  argument
98 bitmap_info_init(&binfo_dyn, nbits); in test_bitmap_initializer_body()
102 "nbits=%zu", nbits); in test_bitmap_initializer_body()
103 assert_zu_eq(binfo->nbits, binfo_dyn.nbits, in test_bitmap_initializer_body()
105 "nbits=%zu", nbits); in test_bitmap_initializer_body()
109 "nbits=%zu", nbits); in test_bitmap_initializer_body()
117 "initialization, nbits=%zu, level=%u", nbits, i); in test_bitmap_initializer_body()
127 #define NB(nbits) { \ in TEST_BEGIN() argument
128 if (nbits <= BITMAP_MAXBITS) { \ in TEST_BEGIN()
130 BITMAP_INFO_INITIALIZER(nbits); \ in TEST_BEGIN()
131 test_bitmap_initializer_body(&binfo, nbits); \ in TEST_BEGIN()
140 test_bitmap_size_body(const bitmap_info_t *binfo, size_t nbits, in test_bitmap_size_body() argument
143 assert_zu_ge(size, (nbits >> 3), in test_bitmap_size_body()
150 size_t nbits, prev_size; in TEST_BEGIN() local
153 for (nbits = 1; nbits <= BITMAP_MAXBITS; nbits++) { in TEST_BEGIN()
155 bitmap_info_init(&binfo, nbits); in TEST_BEGIN()
156 prev_size = test_bitmap_size_body(&binfo, nbits, prev_size); in TEST_BEGIN()
158 #define NB(nbits) { \ in TEST_BEGIN() argument
159 bitmap_info_t binfo = BITMAP_INFO_INITIALIZER(nbits); \ in TEST_BEGIN()
160 prev_size = test_bitmap_size_body(&binfo, nbits, \ in TEST_BEGIN()
170 test_bitmap_init_body(const bitmap_info_t *binfo, size_t nbits) { in test_bitmap_init_body() argument
176 for (i = 0; i < nbits; i++) { in test_bitmap_init_body()
182 for (i = 0; i < nbits; i++) { in test_bitmap_init_body()
190 size_t nbits; in TEST_BEGIN() local
192 for (nbits = 1; nbits <= BITMAP_MAXBITS; nbits++) { in TEST_BEGIN()
194 bitmap_info_init(&binfo, nbits); in TEST_BEGIN()
195 test_bitmap_init_body(&binfo, nbits); in TEST_BEGIN()
197 #define NB(nbits) { \ in TEST_BEGIN() argument
198 bitmap_info_t binfo = BITMAP_INFO_INITIALIZER(nbits); \ in TEST_BEGIN()
199 test_bitmap_init_body(&binfo, nbits); \ in TEST_BEGIN()
207 test_bitmap_set_body(const bitmap_info_t *binfo, size_t nbits) { in test_bitmap_set_body() argument
213 for (i = 0; i < nbits; i++) { in test_bitmap_set_body()
221 size_t nbits; in TEST_BEGIN() local
223 for (nbits = 1; nbits <= BITMAP_MAXBITS; nbits++) { in TEST_BEGIN()
225 bitmap_info_init(&binfo, nbits); in TEST_BEGIN()
226 test_bitmap_set_body(&binfo, nbits); in TEST_BEGIN()
228 #define NB(nbits) { \ in TEST_BEGIN() argument
229 bitmap_info_t binfo = BITMAP_INFO_INITIALIZER(nbits); \ in TEST_BEGIN()
230 test_bitmap_set_body(&binfo, nbits); \ in TEST_BEGIN()
238 test_bitmap_unset_body(const bitmap_info_t *binfo, size_t nbits) { in test_bitmap_unset_body() argument
244 for (i = 0; i < nbits; i++) { in test_bitmap_unset_body()
248 for (i = 0; i < nbits; i++) { in test_bitmap_unset_body()
251 for (i = 0; i < nbits; i++) { in test_bitmap_unset_body()
259 size_t nbits; in TEST_BEGIN() local
261 for (nbits = 1; nbits <= BITMAP_MAXBITS; nbits++) { in TEST_BEGIN()
263 bitmap_info_init(&binfo, nbits); in TEST_BEGIN()
264 test_bitmap_unset_body(&binfo, nbits); in TEST_BEGIN()
266 #define NB(nbits) { \ in TEST_BEGIN() argument
267 bitmap_info_t binfo = BITMAP_INFO_INITIALIZER(nbits); \ in TEST_BEGIN()
268 test_bitmap_unset_body(&binfo, nbits); \ in TEST_BEGIN()
276 test_bitmap_xfu_body(const bitmap_info_t *binfo, size_t nbits) { in test_bitmap_xfu_body() argument
282 for (size_t i = 0; i < nbits; i++) { in test_bitmap_xfu_body()
302 for (size_t i = nbits - 1; i < nbits; i--) { /* (nbits..0] */ in test_bitmap_xfu_body()
320 for (size_t i = 1; i < nbits; i++) { in test_bitmap_xfu_body()
336 assert_zu_eq(bitmap_ffu(bitmap, binfo, 0), nbits - 1, in test_bitmap_xfu_body()
338 assert_zu_eq(bitmap_ffu(bitmap, binfo, (nbits > 1) ? nbits-2 : nbits-1), in test_bitmap_xfu_body()
339 nbits - 1, "First unset bit should be the last bit"); in test_bitmap_xfu_body()
340 assert_zu_eq(bitmap_ffu(bitmap, binfo, nbits - 1), nbits - 1, in test_bitmap_xfu_body()
342 assert_zu_eq(bitmap_sfu(bitmap, binfo), nbits - 1, in test_bitmap_xfu_body()
350 if (nbits >= 3) { in test_bitmap_xfu_body()
351 for (size_t i = 0; i < nbits-2; i++) { in test_bitmap_xfu_body()
364 if (i + 3 < nbits) { in test_bitmap_xfu_body()
366 nbits, "Unexpected first unset bit"); in test_bitmap_xfu_body()
380 if (nbits >= 3) { in test_bitmap_xfu_body()
381 bitmap_unset(bitmap, binfo, nbits-1); in test_bitmap_xfu_body()
382 for (size_t i = 0; i < nbits-1; i++) { in test_bitmap_xfu_body()
390 assert_zu_eq(bitmap_ffu(bitmap, binfo, i+1), nbits-1, in test_bitmap_xfu_body()
392 assert_zu_eq(bitmap_ffu(bitmap, binfo, nbits-1), in test_bitmap_xfu_body()
393 nbits-1, "Unexpected first unset bit"); in test_bitmap_xfu_body()
398 assert_zu_eq(bitmap_sfu(bitmap, binfo), nbits-1, in test_bitmap_xfu_body()
406 size_t nbits; in TEST_BEGIN() local
408 for (nbits = 1; nbits <= BITMAP_MAXBITS; nbits++) { in TEST_BEGIN()
410 bitmap_info_init(&binfo, nbits); in TEST_BEGIN()
411 test_bitmap_xfu_body(&binfo, nbits); in TEST_BEGIN()
413 #define NB(nbits) { \ in TEST_BEGIN() argument
414 bitmap_info_t binfo = BITMAP_INFO_INITIALIZER(nbits); \ in TEST_BEGIN()
415 test_bitmap_xfu_body(&binfo, nbits); \ in TEST_BEGIN()