From 1c16a0d6986f3f87832323cc70dbe69c79377b06 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 2 Jun 2011 09:42:04 -0400 Subject: [PATCH] Add search begin key test Signed-off-by: Mathieu Desnoyers --- tests/test_urcu_rbtree.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/test_urcu_rbtree.c b/tests/test_urcu_rbtree.c index f110462..1e7445d 100644 --- a/tests/test_urcu_rbtree.c +++ b/tests/test_urcu_rbtree.c @@ -257,7 +257,7 @@ void *thr_reader(void *_count) assert(!rcu_rbtree_is_nil(&rbtree, node)); rcu_read_unlock(); } -#if 0 + /* search range */ for (i = 0; i < global_items; i++) { rcu_read_lock(); @@ -268,7 +268,17 @@ void *thr_reader(void *_count) assert(!rcu_rbtree_is_nil(&rbtree, node)); rcu_read_unlock(); } -#endif //0 + + /* search begin key */ + for (i = 0; i < global_items; i++) { + rcu_read_lock(); + node = rcu_rbtree_search_begin_key(&rbtree, + rcu_dereference(rbtree.root), + global_key[i]); + assert(!rcu_rbtree_is_nil(&rbtree, node)); + rcu_read_unlock(); + } + /* min + next */ memset(lookup_hit, 0, sizeof(*lookup_hit) * global_items); -- 2.34.1