aboutsummaryrefslogtreecommitdiffstats
path: root/test/c/binarytrees.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/c/binarytrees.c')
-rw-r--r--test/c/binarytrees.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/c/binarytrees.c b/test/c/binarytrees.c
index b4b10232..f2921d9a 100644
--- a/test/c/binarytrees.c
+++ b/test/c/binarytrees.c
@@ -7,6 +7,7 @@
icc -O3 -ip -unroll -static binary-trees.c -lm
*/
+#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
@@ -24,6 +25,7 @@ treeNode* NewTreeNode(treeNode* left, treeNode* right, long item)
treeNode* new;
new = (treeNode*)malloc(sizeof(treeNode));
+ assert(new != NULL && "NewTreeNode: new malloc failed");
new->left = left;
new->right = right;
@@ -73,7 +75,7 @@ int main(int argc, char* argv[])
unsigned N, depth, minDepth, maxDepth, stretchDepth;
treeNode *stretchTree, *longLivedTree, *tempTree;
- N = argc < 2 ? 12 : atol(argv[1]);
+ N = argc < 2 ? 8 : atol(argv[1]);
minDepth = 4;