From 4310d6da1824a12ee70e897bcbed46d45e104a1e Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 2 Jun 2011 09:54:04 -0400 Subject: [PATCH] Use larger number pool in test Prior range was to stress-test collisions. Signed-off-by: Mathieu Desnoyers --- tests/test_urcu_rbtree.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_urcu_rbtree.c b/tests/test_urcu_rbtree.c index 1e7445d..89e1c90 100644 --- a/tests/test_urcu_rbtree.c +++ b/tests/test_urcu_rbtree.c @@ -358,8 +358,9 @@ void *thr_writer(void *_count) for (i = 0; i < NR_RAND; i++) { node = rbtree_alloc(); - //key[i] = (void *)(unsigned long)(rand() % 2048); - key[i] = (void *)(unsigned long)(rand() % 6); + key[i] = (void *)(unsigned long)(rand() % 2048); + //For more collisions + //key[i] = (void *)(unsigned long)(rand() % 6); node->begin = key[i]; node->end = (void *)((unsigned long) key[i] + 1); rcu_read_lock(); @@ -550,6 +551,8 @@ int main(int argc, char **argv) /* Insert items looked up by readers */ for (i = 0; i < global_items; i++) { node = rbtree_alloc(); + global_key[i] = (void *)(unsigned long)(rand() % 2048); + //For more collisions global_key[i] = (void *)(unsigned long)(rand() % 6); node->begin = global_key[i]; node->end = (void *)((unsigned long) global_key[i] + 1); -- 2.34.1