diff options
author | Quincey Koziol <koziol@lbl.gov> | 2016-09-29 20:17:55 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@lbl.gov> | 2016-09-29 20:17:55 (GMT) |
commit | 5a7880183025f56421cf6f2274d9f1ac36f59641 (patch) | |
tree | 0cdce0036d5b02df97b3a2fcdf875184b6886e67 /test/tskiplist.c | |
parent | 1853868fdc9433f29adae5418d1fd0d65a45fabe (diff) | |
download | hdf5-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/tskiplist.c')
-rw-r--r-- | test/tskiplist.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/tskiplist.c b/test/tskiplist.c index 5738aad..f30948e 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -68,11 +68,11 @@ test_skiplist_init(void) /* Allocate arrays */ rand_num = (int *)HDmalloc(sizeof(int) * NUM_ELEMS); - HDassert(rand_num); + CHECK(rand_num, NULL, "HDmalloc"); sort_rand_num = (int *)HDmalloc(sizeof(int) * NUM_ELEMS); - HDassert(sort_rand_num); + CHECK(sort_rand_num, NULL, "HDmalloc"); rev_sort_rand_num = (int *)HDmalloc(sizeof(int) * NUM_ELEMS); - HDassert(rev_sort_rand_num); + CHECK(rev_sort_rand_num, NULL, "HDmalloc"); /* Initialize random number seed */ curr_time = HDtime(NULL); @@ -1762,9 +1762,12 @@ static void test_skiplist_term(void) { /* Release arrays */ - HDfree(rand_num); - HDfree(sort_rand_num); - HDfree(rev_sort_rand_num); + if(rand_num) + HDfree(rand_num); + if(sort_rand_num) + HDfree(sort_rand_num); + if(rev_sort_rand_num) + HDfree(rev_sort_rand_num); } /* end test_skiplist_term() */ /**************************************************************** |