Mon, 18 May 2015 20:17:16 +0200
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) {