summaryrefslogtreecommitdiffstats
path: root/test/h5test.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/h5test.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/h5test.c')
-rw-r--r--test/h5test.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/h5test.c b/test/h5test.c
index 92b90c5..2ab8855 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -90,6 +90,9 @@ MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */
*/
static const char *multi_letters = "msbrglo";
+/* Length of multi-file VFD filename buffers */
+#define H5TEST_MULTI_FILENAME_LEN 1024
+
/* Previous error reporting function */
static H5E_auto2_t err_func = NULL;
@@ -867,7 +870,7 @@ h5_fileaccess(void)
HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
memb_fapl[mt] = H5P_DEFAULT;
- if(NULL == (sv[mt] = (char *)HDmalloc(1024)))
+ if(NULL == (sv[mt] = (char *)HDmalloc(H5TEST_MULTI_FILENAME_LEN)))
return -1;
HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv[mt];
@@ -1006,7 +1009,7 @@ h5_get_vfd_fapl(void)
HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES);
for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
memb_fapl[mt] = H5P_DEFAULT;
- sv[mt] = (char *)HDmalloc(1024);
+ sv[mt] = (char *)HDmalloc(H5TEST_MULTI_FILENAME_LEN);
HDassert(sv[mt]);
HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv[mt];