summaryrefslogtreecommitdiff
path: root/test/test_rdxtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_rdxtree.c')
-rw-r--r--test/test_rdxtree.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/test_rdxtree.c b/test/test_rdxtree.c
index bfe7b43..c7de812 100644
--- a/test/test_rdxtree.c
+++ b/test/test_rdxtree.c
@@ -696,6 +696,30 @@ test_24(void)
destroy_tree(&tree);
}
+static void
+test_25(void)
+{
+ struct rdxtree tree;
+ struct obj *obj;
+ void **slot;
+ unsigned long i;
+ int error;
+
+ TITLE("insert_alloc_slot x3");
+
+ rdxtree_init(&tree);
+
+ for (i = 0; i < 3; i++) {
+ obj = obj_create(0);
+ error = rdxtree_insert_alloc_slot(&tree, obj, &obj->id, &slot);
+ assert(!error);
+ assert(obj->id == i);
+ assert(*slot == obj);
+ }
+
+ destroy_tree(&tree);
+}
+
int
main(int argc, char *argv[])
{
@@ -726,5 +750,6 @@ main(int argc, char *argv[])
test_22();
test_23();
test_24();
+ test_25();
return 0;
}