added 1 assert in ucx_avl_remove tests and fixed source code formatting

Mon, 18 May 2015 20:39:04 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 18 May 2015 20:39:04 +0200
changeset 203
3d999ea3f780
parent 202
4c84dd2408d7
child 204
4477987d40cd

added 1 assert in ucx_avl_remove tests and fixed source code formatting

test/avl_tests.c file | annotate | diff | comparison | revisions
ucx/avl.c file | annotate | diff | comparison | revisions
--- a/test/avl_tests.c	Mon May 18 20:32:29 2015 +0200
+++ b/test/avl_tests.c	Mon May 18 20:39:04 2015 +0200
@@ -199,6 +199,7 @@
         ucx_avl_remove(tree2, i);
         UCX_TEST_ASSERT(check_tree(tree2->root), "check_tree failed (tree2)");
     }
+    UCX_TEST_ASSERT(tree2->root == NULL, "root not NULL (tree2)");
     
     for(int i=0;i<100000;i++) {
         ucx_avl_put(tree3, i, data1);
--- a/ucx/avl.c	Mon May 18 20:32:29 2015 +0200
+++ b/ucx/avl.c	Mon May 18 20:39:04 2015 +0200
@@ -201,7 +201,7 @@
                 ucx_avl_connect(tree, p, n->right ? n->right:n->left, n->key);
             } else {
                 tree->root = n->right ? n->right : n->left;
-                if(tree->root) {
+                if (tree->root) {
                     tree->root->parent = NULL;
                 }
             }

mercurial