From: Mathieu Desnoyers Date: Thu, 2 Jun 2011 13:42:04 +0000 (-0400) Subject: Add search begin key test X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1c16a0d6986f3f87832323cc70dbe69c79377b06;p=urcu.git Add search begin key test Signed-off-by: Mathieu Desnoyers --- 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);