]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
test_maple_tree: Add seqential test for adding 1000 entries
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 31 Jan 2019 15:53:33 +0000 (10:53 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 31 Jul 2019 14:52:38 +0000 (10:52 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/test_maple_tree.c

index 807160e282b6190a2464c0fd15995e8b517f35e9..8ee3c56e3513debed74ae58324368aaf625ba1b8 100644 (file)
@@ -189,18 +189,20 @@ static noinline void check_new_node(struct maple_tree *mt)
        mtree_unlock(mt);
        mtree_destroy(mt);
 }
-static noinline void check_seq(struct maple_tree *mt)
+static noinline void check_seq(struct maple_tree *mt, unsigned long max)
 {
-       int i, j;
+       unsigned long i, j;
 
        MT_BUG_ON(mt, !mtree_empty(mt));
 
-       for (i = 0; i < 16; i++) {
+       for (i = 0; i <= max; i++) {
                MT_BUG_ON(mt, mtree_insert_index(mt, i, GFP_KERNEL));
-               for (j = 0; j <= i; j++)
+               for (j = 0; j <= i; j++) {
                        check_index_load(mt, j);
+               }
                check_load(mt, i + 1, NULL);
        }
+       //mt_dump(mt);
        mtree_destroy(mt);
 }
 
@@ -267,6 +269,7 @@ static int maple_tree_seed(void)
        pr_info("\nTEST STARTING\n\n");
 
        mtree_init(&tree);
+       check_seq(&tree, 1000);
        check_new_node(&tree);
        check_lower_bound_split(&tree);
        check_upper_bound_split(&tree);
@@ -388,7 +391,7 @@ static int maple_tree_seed(void)
        mtree_destroy(&tree);
 
        check_nomem(&tree);
-       check_seq(&tree);
+       check_seq(&tree, 16);
 
        printk("maple_tree: %u of %u tests passed\n", tests_passed, tests_run);
        return (tests_run == tests_passed) ? 0 : -EINVAL;