summaryrefslogtreecommitdiff
path: root/test/test_rdxtree.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2015-05-03 16:39:04 +0200
committerRichard Braun <rbraun@sceen.net>2015-05-03 16:39:04 +0200
commitdfa5452a4c29e35fe659873e956183268a22ef4c (patch)
tree666cc05aba5c3ddd94d56c02eb482cbf627ff095 /test/test_rdxtree.c
parentf27f7643491fe8303aa939bb539bb9a490f7b3ad (diff)
rdxtree: support lockless tree walking
Diffstat (limited to 'test/test_rdxtree.c')
-rw-r--r--test/test_rdxtree.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/test_rdxtree.c b/test/test_rdxtree.c
index b971628..f5f84a0 100644
--- a/test/test_rdxtree.c
+++ b/test/test_rdxtree.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Richard Braun.
+ * Copyright (c) 2011-2015 Richard Braun.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -245,6 +245,29 @@ test_5(void)
}
static void
+test_5_1(void)
+{
+ struct rdxtree tree;
+ struct obj *obj;
+ int error;
+
+ TITLE("insert 0, 256 and 4096");
+
+ rdxtree_init(&tree);
+ obj = obj_create(0);
+ error = rdxtree_insert(&tree, obj->id, obj);
+ assert(!error);
+ obj = obj_create(256);
+ error = rdxtree_insert(&tree, obj->id, obj);
+ assert(!error);
+ obj = obj_create(4096);
+ error = rdxtree_insert(&tree, obj->id, obj);
+ assert(!error);
+ print_tree(&tree);
+ destroy_tree(&tree);
+}
+
+static void
test_6(void)
{
struct rdxtree tree;
@@ -970,6 +993,7 @@ main(int argc, char *argv[])
test_3();
test_4();
test_5();
+ test_5_1();
test_6();
test_7();
test_8();