summaryrefslogtreecommitdiff
path: root/unittest/mysys
diff options
context:
space:
mode:
authorunknown <mats@mysql.com>2006-04-11 20:29:34 +0200
committerunknown <mats@mysql.com>2006-04-11 20:29:34 +0200
commita14de3b2dbed4f3ec84d73f30266c0d9294f30c7 (patch)
tree000dd44bbd07c4a208131be0858eb8b4fb714538 /unittest/mysys
parent4f99f11e9c798225fd5906c23dc26da01ae4f20e (diff)
downloadmariadb-git-a14de3b2dbed4f3ec84d73f30266c0d9294f30c7.tar.gz
WL#3206 (Add unit tests):
More changes according to review comments. unittest/README.txt: Changes to manifest. unittest/mysys/bitmap.t.c: Removed unused functions and variables. Marked unused parameters as unused. No need to test every size up to 4096 bits, testing to 1024, but I think this is too much as well. unittest/unit.pl: Added test for version-specific function.
Diffstat (limited to 'unittest/mysys')
-rw-r--r--unittest/mysys/bitmap.t.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/unittest/mysys/bitmap.t.c b/unittest/mysys/bitmap.t.c
index 3df5c29c9ee..d5683baff66 100644
--- a/unittest/mysys/bitmap.t.c
+++ b/unittest/mysys/bitmap.t.c
@@ -24,15 +24,7 @@
#include <my_global.h>
#include <my_bitmap.h>
-static void bitmap_print(MY_BITMAP *map)
-{
- uint32 *to= map->bitmap, *end= map->last_word_ptr;
- while (to <= end)
- {
- fprintf(stderr,"0x%x ", *to++);
- }
- fprintf(stderr,"\n");
-}
+#include <string.h>
uint get_rand_bit(uint bitsize)
{
@@ -85,7 +77,8 @@ error2:
return TRUE;
}
-bool test_operators(MY_BITMAP *map, uint bitsize)
+bool test_operators(MY_BITMAP *map __attribute__((unused)),
+ uint bitsize __attribute__((unused)))
{
return FALSE;
}
@@ -266,7 +259,7 @@ error2:
bool test_get_first_bit(MY_BITMAP *map, uint bitsize)
{
- uint i, j, test_bit;
+ uint i, test_bit;
uint no_loops= bitsize > 128 ? 128 : bitsize;
for (i=0; i < no_loops; i++)
{
@@ -385,8 +378,10 @@ error:
int main()
{
int i;
- plan(4095);
- for (i= 1; i < 4096; i++)
+ int const min_size = 1;
+ int const max_size = 1024;
+ plan(max_size - min_size);
+ for (i= min_size; i < max_size; i++)
ok(do_test(i) == 0, "bitmap size %d", i);
return exit_status();
}