diff options
Diffstat (limited to 'unittest/mysys/bitmap-t.c')
-rw-r--r-- | unittest/mysys/bitmap-t.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/unittest/mysys/bitmap-t.c b/unittest/mysys/bitmap-t.c index a9ea7927db3..2065e10b53f 100644 --- a/unittest/mysys/bitmap-t.c +++ b/unittest/mysys/bitmap-t.c @@ -77,6 +77,7 @@ error2: return TRUE; } + my_bool test_get_all_bits(MY_BITMAP *map, uint bitsize) { uint i; @@ -125,8 +126,8 @@ my_bool test_compare_operators(MY_BITMAP *map, uint bitsize) uint no_loops= bitsize > 128 ? 128 : bitsize; MY_BITMAP map2_obj, map3_obj; MY_BITMAP *map2= &map2_obj, *map3= &map3_obj; - uint32 map2buf[MAX_TESTED_BITMAP_SIZE]; - uint32 map3buf[MAX_TESTED_BITMAP_SIZE]; + my_bitmap_map map2buf[MAX_TESTED_BITMAP_SIZE]; + my_bitmap_map map3buf[MAX_TESTED_BITMAP_SIZE]; bitmap_init(&map2_obj, map2buf, bitsize, FALSE); bitmap_init(&map3_obj, map3buf, bitsize, FALSE); bitmap_clear_all(map2); @@ -478,7 +479,7 @@ error: my_bool do_test(uint bitsize) { MY_BITMAP map; - uint32 buf[MAX_TESTED_BITMAP_SIZE]; + my_bitmap_map buf[MAX_TESTED_BITMAP_SIZE]; if (bitmap_init(&map, buf, bitsize, FALSE)) { diag("init error for bitsize %d", bitsize); @@ -525,8 +526,14 @@ int main() int const max_size = MAX_TESTED_BITMAP_SIZE; MY_INIT("bitmap-t"); - plan(max_size - min_size); - for (i= min_size; i < max_size; i++) + plan((max_size - min_size)/7+1); + + /* + It's ok to do steps in 7, as i module 64 will go trough all values 1..63. + Any errors in the code should manifest as we are working with integers + of size 16, 32, or 64 bits... + */ + for (i= min_size; i < max_size; i+=7) ok(do_test(i) == 0, "bitmap size %d", i); return exit_status(); } |