extended ucx_avl_remove tests

Mon, 18 May 2015 20:17:16 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 18 May 2015 20:17:16 +0200
changeset 201
45810f5b7b84
parent 200
e3aad99d2d80
child 202
4c84dd2408d7

extended ucx_avl_remove tests

test/avl_tests.c file | annotate | diff | comparison | revisions
--- a/test/avl_tests.c	Mon May 18 19:52:03 2015 +0200
+++ b/test/avl_tests.c	Mon May 18 20:17:16 2015 +0200
@@ -160,8 +160,20 @@
     void *val = ucx_avl_remove(tree1, 3);
     
     UCX_TEST_ASSERT(check_tree(tree1->root), "check_tree failed (tree1)");
-    UCX_TEST_ASSERT(val == data3, "wrong return value (tree1)");
+    UCX_TEST_ASSERT(
+            val == data3,
+            "wrong return value for key: 1 (tree1)");
     UCX_TEST_ASSERT(ucx_avl_get(tree1, 3) == NULL, "value not removed (tree1)");
+    UCX_TEST_ASSERT(
+            ucx_avl_remove(tree1, 2) == data2,
+            "wrong return value for key: 2 (tree1)");
+    UCX_TEST_ASSERT(check_tree(tree1->root), "check_tree failed (tree1)");
+    UCX_TEST_ASSERT(
+            ucx_avl_remove(tree1, 1) == data1,
+            "wrong return value for key: 1 (tree1)");
+    UCX_TEST_ASSERT(check_tree(tree1->root), "check_tree failed (tree1)");
+    UCX_TEST_ASSERT(tree1->root == NULL, "root not NULL (tree1)");
+    
     
     for(int i=0;i<20;i++) {
         if(i==10) {

mercurial