Test the case when previous key is in the same node that
straight lookup failed in.

Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
---
 test/vm/radix-tree-test.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/test/vm/radix-tree-test.c b/test/vm/radix-tree-test.c
index e50e949..1a8d70b 100644
--- a/test/vm/radix-tree-test.c
+++ b/test/vm/radix-tree-test.c
@@ -53,3 +53,17 @@ void test_tree_remove()
 
        free_radix_tree(tree);
 }
+
+void test_tree_lookup_previous_in_the_same_node(void)
+{
+       struct radix_tree *tree;
+       void *result;
+
+       tree = alloc_radix_tree(8, 16);
+
+       radix_tree_insert(tree, 1, (void*)0xcafebabe);
+       result = radix_tree_lookup_prev(tree, 100);
+       assert_ptr_equals((void*)0xcafebabe, result);
+
+       free_radix_tree(tree);
+}
-- 
1.6.0.6


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to