summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2020-03-28 20:48:55 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2020-03-28 20:48:55 (GMT)
commite9e3e2f1d67ccf71cc5af711065d1f85761ab5b7 (patch)
tree176e0a4e9eefcbea3d050084b65adedabf41da91
parentf5cb547825e462c3299b6f41d03a71aa6faef950 (diff)
parent0eb562bc201a38f9b4a82e954bfc63daa6838d45 (diff)
downloadhdf5-e9e3e2f1d67ccf71cc5af711065d1f85761ab5b7.zip
hdf5-e9e3e2f1d67ccf71cc5af711065d1f85761ab5b7.tar.gz
hdf5-e9e3e2f1d67ccf71cc5af711065d1f85761ab5b7.tar.bz2
Merge pull request #2471 in HDFFV/hdf5 from alloc_stat_tests to develop
* commit '0eb562bc201a38f9b4a82e954bfc63daa6838d45': 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 539a027..6eb6872 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -5700,7 +5700,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 */
@@ -5721,16 +5731,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");
@@ -5745,24 +5745,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 */
@@ -5789,36 +5781,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() */