summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2020-03-26 16:51:26 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-20 14:31:57 (GMT)
commit358558ad036e107510790c839bced7f7008d8563 (patch)
treec36553383ab7626c443c7e0a5713dd0f54ce0e5b
parent5b17d4512094f861777fee8c11c1d0371e3dce81 (diff)
downloadhdf5-358558ad036e107510790c839bced7f7008d8563.zip
hdf5-358558ad036e107510790c839bced7f7008d8563.tar.gz
hdf5-358558ad036e107510790c839bced7f7008d8563.tar.bz2
Refactor to reduce verbosity.
-rw-r--r--test/tmisc.c88
1 files changed, 33 insertions, 55 deletions
diff --git a/test/tmisc.c b/test/tmisc.c
index 98a1634..f35daac 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -5701,7 +5701,17 @@ test_misc35(void)
{
hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
hsize_t dims[] = {MISC35_SPACE_DIM1, MISC35_SPACE_DIM2, MISC35_SPACE_DIM3}; /* Dataspace dims */
- hsize_t coord[MISC35_NPOINTS][MISC35_SPACE_RANK]; /* Coordinates for point selection */
+ hsize_t coord[MISC35_NPOINTS][MISC35_SPACE_RANK] = /* Coordinates for point selection */
+ {{0,10, 5},
+ {1, 2, 7},
+ {2, 4, 9},
+ {0, 6,11},
+ {1, 8,13},
+ {2,12, 0},
+ {0,14, 2},
+ {1, 0, 4},
+ {2, 1, 6},
+ {0, 3, 8}};
size_t reg_size_start; /* Initial amount of regular memory allocated */
size_t arr_size_start; /* Initial amount of array memory allocated */
size_t blk_size_start; /* Initial amount of block memory allocated */
@@ -5722,16 +5732,6 @@ test_misc35(void)
CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
/* Select sequence of ten points */
- coord[0][0]=0; coord[0][1]=10; coord[0][2]= 5;
- coord[1][0]=1; coord[1][1]= 2; coord[1][2]= 7;
- coord[2][0]=2; coord[2][1]= 4; coord[2][2]= 9;
- coord[3][0]=0; coord[3][1]= 6; coord[3][2]=11;
- coord[4][0]=1; coord[4][1]= 8; coord[4][2]=13;
- coord[5][0]=2; coord[5][1]=12; coord[5][2]= 0;
- coord[6][0]=0; coord[6][1]=14; coord[6][2]= 2;
- coord[7][0]=1; coord[7][1]= 0; coord[7][2]= 4;
- coord[8][0]=2; coord[8][1]= 1; coord[8][2]= 6;
- coord[9][0]=0; coord[9][1]= 3; coord[9][2]= 8;
ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)MISC35_NPOINTS, (const hsize_t *)coord);
CHECK(ret, FAIL, "H5Sselect_elements");
@@ -5746,24 +5746,16 @@ test_misc35(void)
#if !defined H5_USING_MEMCHECKER
/* All the free list values should be >0 */
- if(0 == reg_size_start)
- ERROR("reg_size_start == 0");
- if(0 == arr_size_start)
- ERROR("arr_size_start == 0");
- if(0 == blk_size_start)
- ERROR("blk_size_start == 0");
- if(0 == fac_size_start)
- ERROR("fac_size_start == 0");
+ CHECK(reg_size_start, 0, "H5get_free_list_sizes");
+ CHECK(arr_size_start, 0, "H5get_free_list_sizes");
+ CHECK(blk_size_start, 0, "H5get_free_list_sizes");
+ CHECK(fac_size_start, 0, "H5get_free_list_sizes");
#else /* H5_MEMORY_ALLOC_SANITY_CHECK */
/* All the values should be == 0 */
- if(0 != reg_size_start)
- ERROR("reg_size_start != 0");
- if(0 != arr_size_start)
- ERROR("arr_size_start != 0");
- if(0 != blk_size_start)
- ERROR("blk_size_start != 0");
- if(0 != fac_size_start)
- ERROR("fac_size_start != 0");
+ VERIFY(reg_size_start, 0, "H5get_free_list_sizes");
+ VERIFY(arr_size_start, 0, "H5get_free_list_sizes");
+ VERIFY(blk_size_start, 0, "H5get_free_list_sizes");
+ VERIFY(fac_size_start, 0, "H5get_free_list_sizes");
#endif /* H5_MEMORY_ALLOC_SANITY_CHECK */
/* Garbage collect the free lists */
@@ -5790,36 +5782,22 @@ test_misc35(void)
#if defined H5_MEMORY_ALLOC_SANITY_CHECK
/* All the values should be >0 */
- if(0 == alloc_stats.total_alloc_bytes)
- ERROR("alloc_stats.total_alloc_bytes == 0");
- if(0 == alloc_stats.curr_alloc_bytes)
- ERROR("alloc_stats.curr_alloc_bytes == 0");
- if(0 == alloc_stats.peak_alloc_bytes)
- ERROR("alloc_stats.peak_alloc_bytes == 0");
- if(0 == alloc_stats.max_block_size)
- ERROR("alloc_stats.max_block_size == 0");
- if(0 == alloc_stats.total_alloc_blocks_count)
- ERROR("alloc_stats.total_alloc_blocks_count == 0");
- if(0 == alloc_stats.curr_alloc_blocks_count)
- ERROR("alloc_stats.curr_alloc_blocks_count == 0");
- if(0 == alloc_stats.peak_alloc_blocks_count)
- ERROR("alloc_stats.peak_alloc_blocks_count == 0");
+ CHECK(alloc_stats.total_alloc_bytes, 0, "H5get_alloc_stats");
+ CHECK(alloc_stats.curr_alloc_bytes, 0, "H5get_alloc_stats");
+ CHECK(alloc_stats.peak_alloc_bytes, 0, "H5get_alloc_stats");
+ CHECK(alloc_stats.max_block_size, 0, "H5get_alloc_stats");
+ CHECK(alloc_stats.total_alloc_blocks_count, 0, "H5get_alloc_stats");
+ CHECK(alloc_stats.curr_alloc_blocks_count, 0, "H5get_alloc_stats");
+ CHECK(alloc_stats.peak_alloc_blocks_count, 0, "H5get_alloc_stats");
#else /* H5_MEMORY_ALLOC_SANITY_CHECK */
/* All the values should be == 0 */
- if(0 != alloc_stats.total_alloc_bytes)
- ERROR("alloc_stats.total_alloc_bytes != 0");
- if(0 != alloc_stats.curr_alloc_bytes)
- ERROR("alloc_stats.curr_alloc_bytes != 0");
- if(0 != alloc_stats.peak_alloc_bytes)
- ERROR("alloc_stats.peak_alloc_bytes != 0");
- if(0 != alloc_stats.max_block_size)
- ERROR("alloc_stats.max_block_size != 0");
- if(0 != alloc_stats.total_alloc_blocks_count)
- ERROR("alloc_stats.total_alloc_blocks_count != 0");
- if(0 != alloc_stats.curr_alloc_blocks_count)
- ERROR("alloc_stats.curr_alloc_blocks_count != 0");
- if(0 != alloc_stats.peak_alloc_blocks_count)
- ERROR("alloc_stats.peak_alloc_blocks_count != 0");
+ VERIFY(alloc_stats.total_alloc_bytes, 0, "H5get_alloc_stats");
+ VERIFY(alloc_stats.curr_alloc_bytes, 0, "H5get_alloc_stats");
+ VERIFY(alloc_stats.peak_alloc_bytes, 0, "H5get_alloc_stats");
+ VERIFY(alloc_stats.max_block_size, 0, "H5get_alloc_stats");
+ VERIFY(alloc_stats.total_alloc_blocks_count, 0, "H5get_alloc_stats");
+ VERIFY(alloc_stats.curr_alloc_blocks_count, 0, "H5get_alloc_stats");
+ VERIFY(alloc_stats.peak_alloc_blocks_count, 0, "H5get_alloc_stats");
#endif /* H5_MEMORY_ALLOC_SANITY_CHECK */
} /* end test_misc35() */