Lines Matching refs:binfo
96 test_bitmap_initializer_body(const bitmap_info_t *binfo, size_t nbits) { in test_bitmap_initializer_body() argument
100 assert_zu_eq(bitmap_size(binfo), bitmap_size(&binfo_dyn), in test_bitmap_initializer_body()
103 assert_zu_eq(binfo->nbits, binfo_dyn.nbits, in test_bitmap_initializer_body()
107 assert_u_eq(binfo->nlevels, binfo_dyn.nlevels, in test_bitmap_initializer_body()
113 for (i = 0; i < binfo->nlevels; i++) { in test_bitmap_initializer_body()
114 assert_zu_eq(binfo->levels[i].group_offset, in test_bitmap_initializer_body()
121 assert_zu_eq(binfo->ngroups, binfo_dyn.ngroups, in test_bitmap_initializer_body()
129 bitmap_info_t binfo = \ 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
142 size_t size = bitmap_size(binfo); in test_bitmap_size_body()
154 bitmap_info_t binfo; in TEST_BEGIN() local
155 bitmap_info_init(&binfo, nbits); in TEST_BEGIN()
156 prev_size = test_bitmap_size_body(&binfo, nbits, prev_size); in TEST_BEGIN()
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
172 bitmap_t *bitmap = (bitmap_t *)malloc(bitmap_size(binfo)); in test_bitmap_init_body()
175 bitmap_init(bitmap, binfo, false); in test_bitmap_init_body()
177 assert_false(bitmap_get(bitmap, binfo, i), in test_bitmap_init_body()
181 bitmap_init(bitmap, binfo, true); in test_bitmap_init_body()
183 assert_true(bitmap_get(bitmap, binfo, i), "Bit should be set"); in test_bitmap_init_body()
193 bitmap_info_t binfo; in TEST_BEGIN() local
194 bitmap_info_init(&binfo, nbits); in TEST_BEGIN()
195 test_bitmap_init_body(&binfo, nbits); in TEST_BEGIN()
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
209 bitmap_t *bitmap = (bitmap_t *)malloc(bitmap_size(binfo)); in test_bitmap_set_body()
211 bitmap_init(bitmap, binfo, false); in test_bitmap_set_body()
214 bitmap_set(bitmap, binfo, i); in test_bitmap_set_body()
216 assert_true(bitmap_full(bitmap, binfo), "All bits should be set"); in test_bitmap_set_body()
224 bitmap_info_t binfo; in TEST_BEGIN() local
225 bitmap_info_init(&binfo, nbits); in TEST_BEGIN()
226 test_bitmap_set_body(&binfo, nbits); in TEST_BEGIN()
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
240 bitmap_t *bitmap = (bitmap_t *)malloc(bitmap_size(binfo)); in test_bitmap_unset_body()
242 bitmap_init(bitmap, binfo, false); in test_bitmap_unset_body()
245 bitmap_set(bitmap, binfo, i); in test_bitmap_unset_body()
247 assert_true(bitmap_full(bitmap, binfo), "All bits should be set"); in test_bitmap_unset_body()
249 bitmap_unset(bitmap, binfo, i); in test_bitmap_unset_body()
252 bitmap_set(bitmap, binfo, i); in test_bitmap_unset_body()
254 assert_true(bitmap_full(bitmap, binfo), "All bits should be set"); in test_bitmap_unset_body()
262 bitmap_info_t binfo; in TEST_BEGIN() local
263 bitmap_info_init(&binfo, nbits); in TEST_BEGIN()
264 test_bitmap_unset_body(&binfo, nbits); in TEST_BEGIN()
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
277 bitmap_t *bitmap = (bitmap_t *)malloc(bitmap_size(binfo)); in test_bitmap_xfu_body()
279 bitmap_init(bitmap, binfo, false); in test_bitmap_xfu_body()
283 assert_zu_eq(bitmap_ffu(bitmap, binfo, 0), i, in test_bitmap_xfu_body()
286 assert_zu_eq(bitmap_ffu(bitmap, binfo, (i > 0) ? i-1 : i), i, in test_bitmap_xfu_body()
289 assert_zu_eq(bitmap_ffu(bitmap, binfo, i), i, in test_bitmap_xfu_body()
292 assert_zu_eq(bitmap_sfu(bitmap, binfo), i, in test_bitmap_xfu_body()
296 assert_true(bitmap_full(bitmap, binfo), "All bits should be set"); in test_bitmap_xfu_body()
303 bitmap_unset(bitmap, binfo, i); in test_bitmap_xfu_body()
304 assert_zu_eq(bitmap_ffu(bitmap, binfo, 0), i, in test_bitmap_xfu_body()
306 assert_zu_eq(bitmap_ffu(bitmap, binfo, (i > 0) ? i-1 : i), i, in test_bitmap_xfu_body()
308 assert_zu_eq(bitmap_ffu(bitmap, binfo, i), i, in test_bitmap_xfu_body()
310 assert_zu_eq(bitmap_sfu(bitmap, binfo), i, in test_bitmap_xfu_body()
312 bitmap_unset(bitmap, binfo, i); in test_bitmap_xfu_body()
314 assert_false(bitmap_get(bitmap, binfo, 0), "Bit should be unset"); in test_bitmap_xfu_body()
321 bitmap_set(bitmap, binfo, i - 1); in test_bitmap_xfu_body()
322 assert_zu_eq(bitmap_ffu(bitmap, binfo, 0), i, in test_bitmap_xfu_body()
325 assert_zu_eq(bitmap_ffu(bitmap, binfo, (i > 0) ? i-1 : i), i, in test_bitmap_xfu_body()
328 assert_zu_eq(bitmap_ffu(bitmap, binfo, i), i, in test_bitmap_xfu_body()
331 assert_zu_eq(bitmap_sfu(bitmap, binfo), i, in test_bitmap_xfu_body()
334 bitmap_unset(bitmap, binfo, 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()
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()
344 assert_true(bitmap_full(bitmap, binfo), "All bits should be set"); in test_bitmap_xfu_body()
352 bitmap_unset(bitmap, binfo, i); in test_bitmap_xfu_body()
353 bitmap_unset(bitmap, binfo, i+2); in test_bitmap_xfu_body()
355 assert_zu_eq(bitmap_ffu(bitmap, binfo, i-1), i, in test_bitmap_xfu_body()
358 assert_zu_eq(bitmap_ffu(bitmap, binfo, i), i, in test_bitmap_xfu_body()
360 assert_zu_eq(bitmap_ffu(bitmap, binfo, i+1), i+2, in test_bitmap_xfu_body()
362 assert_zu_eq(bitmap_ffu(bitmap, binfo, i+2), i+2, in test_bitmap_xfu_body()
365 assert_zu_eq(bitmap_ffu(bitmap, binfo, i+3), in test_bitmap_xfu_body()
368 assert_zu_eq(bitmap_sfu(bitmap, binfo), i, in test_bitmap_xfu_body()
370 assert_zu_eq(bitmap_sfu(bitmap, binfo), i+2, in test_bitmap_xfu_body()
381 bitmap_unset(bitmap, binfo, nbits-1); in test_bitmap_xfu_body()
383 bitmap_unset(bitmap, binfo, i); in test_bitmap_xfu_body()
385 assert_zu_eq(bitmap_ffu(bitmap, binfo, i-1), i, in test_bitmap_xfu_body()
388 assert_zu_eq(bitmap_ffu(bitmap, binfo, i), 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()
395 assert_zu_eq(bitmap_sfu(bitmap, binfo), i, in test_bitmap_xfu_body()
398 assert_zu_eq(bitmap_sfu(bitmap, binfo), nbits-1, in test_bitmap_xfu_body()
409 bitmap_info_t binfo; in TEST_BEGIN() local
410 bitmap_info_init(&binfo, nbits); in TEST_BEGIN()
411 test_bitmap_xfu_body(&binfo, nbits); in TEST_BEGIN()
414 bitmap_info_t binfo = BITMAP_INFO_INITIALIZER(nbits); \ in TEST_BEGIN()
415 test_bitmap_xfu_body(&binfo, nbits); \ in TEST_BEGIN()