X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=ucw%2Ftrie-test.c;h=9114fe92cd61ffc6826e7357b90d40dd8aed2a83;hb=1d62db61c7a34454ee9380c08c0fc8ebcc262687;hp=cb9058c4629e6b496d0a1553b0a38874dff3788e;hpb=031256ad2e123eec58521f8e3eb9496c197641d2;p=libucw.git diff --git a/ucw/trie-test.c b/ucw/trie-test.c index cb9058c4..9114fe92 100644 --- a/ucw/trie-test.c +++ b/ucw/trie-test.c @@ -9,8 +9,8 @@ #undef LOCAL_DEBUG -#include "ucw/lib.h" -#include "ucw/getopt.h" +#include +#include #include #include @@ -26,7 +26,7 @@ #ifdef LOCAL_DEBUG #define TRIE_TRACE #endif -#include "ucw/trie.h" +#include static void basic_test(void) @@ -55,7 +55,7 @@ basic_test(void) #ifdef LOCAL_DEBUG #define TRIE_TRACE #endif -#include "ucw/trie.h" +#include static void dynamic_test(void) @@ -86,19 +86,19 @@ dynamic_test(void) #ifdef LOCAL_DEBUG #define TRIE_TRACE #endif -#include "ucw/trie.h" +#include #define MAX_STRINGS 200 -static uns count; +static uint count; static char *str[MAX_STRINGS]; static char * gen_string(void) { - uns l = random_max(11); + uint l = random_max(11); char *s = xmalloc(l + 1); - for (uns i = 0; i < l; i++) + for (uint i = 0; i < l; i++) s[i] = random_max('z' - 'a') + 'a'; s[l] = 0; return s; @@ -110,7 +110,7 @@ gen_unique_string(void) char *s; again: s = gen_string(); - for (uns i = 0; i < count; i++) + for (uint i = 0; i < count; i++) if (!strcmp(s, str[i])) { xfree(s); @@ -136,7 +136,7 @@ delete(void) { if (!count) return; - uns i = random_max(count); + uint i = random_max(count); DBG("remove '%s'", str[i]); random_remove(str[i]); random_audit(); @@ -157,7 +157,7 @@ find(void) } else { - uns i = random_max(count); + uint i = random_max(count); DBG("positive find '%s'", str[i]); if (random_find(str[i]) != str[i]) ASSERT(0); @@ -169,7 +169,7 @@ reset(void) { DBG("reset"); random_cleanup(); - for (uns i = 0; i < count; i++) + for (uint i = 0; i < count; i++) xfree(str[i]); count = 0; random_init(); @@ -180,7 +180,7 @@ static void random_test(void) { random_init(); - for (uns i = 0; i < 10000; i++) + for (uint i = 0; i < 10000; i++) { int r = random_max(1000); if ((r -= 300) < 0)