Skip to content

Commit

Permalink
improve unit testing for cleaner result output
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzprix committed Mar 27, 2016
1 parent 4038060 commit 08e0896
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions source/test/cdsl_bstree_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ BOOL cdsl_bstreeDoTest(void)
cdsl_bstreeNodeInit(&bst_nodepool[i],keys[i]);
cdsl_bstreeInsert(&root,&bst_nodepool[i]);
depth_temp = cdsl_bstreeMaxDepth(&root);
if(depth != depth_temp)
{
if(depth < depth_temp){
depth = depth_temp;
}
}
__dev_log("Max Depth of binary search Tree : %d @ N : %d\n",depth,i);

if(cdsl_bstreeSize(&root) != TEST_SIZE)
return FALSE;
Expand Down Expand Up @@ -80,7 +80,6 @@ BOOL cdsl_bstreeDoTest(void)
static int bstree_cb(int order,void* bst)
{
cb_count++;
__dev_log("#%d : %d\n", order, ((bstreeNode_t*) bst)->key);
if(order == 2000)
{
return BREAK_TRAVERSE;
Expand Down
4 changes: 2 additions & 2 deletions source/test/cdsl_rbtree_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ BOOL cdsl_rbtreeDoTest(void){
cdsl_rbtreeNodeInit(&node_pool[i],keys[i]);
cdsl_rbtreeInsert(&root,&node_pool[i]);
depth_temp = cdsl_rbtreeMaxDepth(&root);
if(depth != depth_temp){
__dev_log("Max Depth of Tree : %d @ N : %d\n",depth_temp,i);
if(depth < depth_temp){
depth = depth_temp;
}
}
__dev_log("Max Depth of Red-Black Tree : %d @ N : %d\n",depth,i);

if(TEST_SIZE != cdsl_rbtreeSize(&root))
return FALSE;
Expand Down
4 changes: 2 additions & 2 deletions source/test/cdsl_spltree_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ BOOL cdsl_spltreeDoTest(void){
cdsl_spltreeNodeInit(&nodes[i],keys[i]);
cdsl_spltreeInsert(&root,&nodes[i]);
depth_temp = cdsl_spltreeMaxDepth(&root);
if(depth != depth_temp){
__dev_log("Max Depth of Tree : %d @ N : %d\n",depth_temp,i);
if(depth < depth_temp){
depth = depth_temp;
}
}
__dev_log("Max Depth of Splay Tree : %d @ N : %d\n",depth,i);

if(cdsl_spltreeSize(&root) != TEST_SIZE)
return FALSE;
Expand Down

0 comments on commit 08e0896

Please sign in to comment.