summaryrefslogtreecommitdiffstats
path: root/test/theap.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2016-09-29 20:17:55 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2016-09-29 20:17:55 (GMT)
commit5a7880183025f56421cf6f2274d9f1ac36f59641 (patch)
tree0cdce0036d5b02df97b3a2fcdf875184b6886e67 /test/theap.c
parent1853868fdc9433f29adae5418d1fd0d65a45fabe (diff)
downloadhdf5-5a7880183025f56421cf6f2274d9f1ac36f59641.zip
hdf5-5a7880183025f56421cf6f2274d9f1ac36f59641.tar.gz
hdf5-5a7880183025f56421cf6f2274d9f1ac36f59641.tar.bz2
Clean up hardcoded constants and check return values better. (Comments from
group code review)
Diffstat (limited to 'test/theap.c')
-rw-r--r--test/theap.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/theap.c b/test/theap.c
index b19e08f..9c509a1 100644
--- a/test/theap.c
+++ b/test/theap.c
@@ -90,11 +90,11 @@ test_heap_init(void)
/* Allocate arrays */
rand_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS);
- HDassert(rand_num);
+ CHECK(rand_num, NULL, "HDmalloc");
inc_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS);
- HDassert(inc_sort_num);
+ CHECK(inc_sort_num, NULL, "HDmalloc");
dec_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS);
- HDassert(dec_sort_num);
+ CHECK(dec_sort_num, NULL, "HDmalloc");
/* Create randomized set of numbers */
curr_time = HDtime(NULL);
@@ -1039,9 +1039,12 @@ static void
test_heap_term(void)
{
/* Release arrays */
- HDfree(rand_num);
- HDfree(inc_sort_num);
- HDfree(dec_sort_num);
+ if(rand_num)
+ HDfree(rand_num);
+ if(inc_sort_num)
+ HDfree(inc_sort_num);
+ if(dec_sort_num)
+ HDfree(dec_sort_num);
} /* end test_tst_term() */
/****************************************************************