]> mj.ucw.cz Git - libucw.git/blobdiff - lib/redblack-test.c
Polished the introductory comments in sorter.h.
[libucw.git] / lib / redblack-test.c
index cb722f33254bf80fb79462b9fb282ca7bf39d468..80a7a000ce8711603b11fce25877ca03fb46b4bb 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #include "lib/lib.h"
-#include "lib/conf.h"
+#include "lib/getopt.h"
 #include "lib/fastbuf.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -127,7 +127,7 @@ main(int argc, char **argv)
        struct my_tree t;
        struct my2_tree t2;
        int i;
-       cfdeffile = NULL;
+       cf_def_file = NULL;
        log_init(argv[0]);
        while ((opt = cf_getopt(argc, argv, options, CF_NO_LONG_OPTS, NULL)) >= 0)
                switch (opt)
@@ -175,7 +175,8 @@ main(int argc, char **argv)
        }
        for (i=0; i<100; i++)
        {
-               int res UNUSED = my_delete(&t, i);
+               int a = i/10, b = i%10, j = a*10 + (b + a) % 10;
+               int res UNUSED = my_delete(&t, j);
                ASSERT(res);
                my_dump(dump_fb, &t);
        }
@@ -190,13 +191,6 @@ main(int argc, char **argv)
                my_dump(NULL, &t);
        }
        my_dump(dump_fb, &t);
-       for (i=0; i<997; i++)
-       {
-               int res UNUSED = my_delete(&t, i*111 % 997);
-               ASSERT(res);
-               my_dump(NULL, &t);
-       }
-       my_dump(dump_fb, &t);
        i = 0;
        TREE_FOR_ALL(my, &t, n)
        {
@@ -204,6 +198,14 @@ main(int argc, char **argv)
                i++;
        }
        TREE_END_FOR;
+       ASSERT(i == 997);
+       for (i=0; i<997; i++)
+       {
+               int res UNUSED = my_delete(&t, i*111 % 997);
+               ASSERT(res);
+               my_dump(NULL, &t);
+       }
+       my_dump(dump_fb, &t);
        my_cleanup(&t);
        if (verbose > 0)
                bputs(fb, "Complete tree passed\n");