summaryrefslogtreecommitdiffstats
path: root/test/vfd_swmr.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-02-03 19:10:11 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-02-03 19:10:11 (GMT)
commit005bd89ad5fbe958e946ff4381bc9f97babc1896 (patch)
tree974f9de07ad9802c1df6cb8cb8935fdb27ad6121 /test/vfd_swmr.c
parent57fe4a52a265edb642855a5be11d0ccd7c4b1b97 (diff)
downloadhdf5-005bd89ad5fbe958e946ff4381bc9f97babc1896.zip
hdf5-005bd89ad5fbe958e946ff4381bc9f97babc1896.tar.gz
hdf5-005bd89ad5fbe958e946ff4381bc9f97babc1896.tar.bz2
Use FAIL_STACK_ERROR instead of TEST_ERROR after library calls, so that the
error stack will be reported. Use calloc instead of malloc+memset.
Diffstat (limited to 'test/vfd_swmr.c')
-rw-r--r--test/vfd_swmr.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/vfd_swmr.c b/test/vfd_swmr.c
index 3ba44b6..9cc481d 100644
--- a/test/vfd_swmr.c
+++ b/test/vfd_swmr.c
@@ -697,9 +697,8 @@ test_writer_create_open_flush(void)
TESTING("Create/Open/Flush an HDF5 file for VFD SWMR");
/* Allocate memory for the configuration structure */
- if((my_config = (H5F_vfd_swmr_config_t *)HDmalloc(sizeof(H5F_vfd_swmr_config_t))) == NULL)
+ if((my_config = HDcalloc(1, sizeof(H5F_vfd_swmr_config_t))) == NULL)
FAIL_STACK_ERROR;
- HDmemset(my_config, 0, sizeof(H5F_vfd_swmr_config_t));
/* Create a copy of the file access property list */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
@@ -735,7 +734,7 @@ test_writer_create_open_flush(void)
/* Verify info in metadata file when creating the HDF5 file */
if(H5F__vfd_swmr_writer_create_open_flush_test(fid, TRUE) < 0)
- TEST_ERROR
+ FAIL_STACK_ERROR;
#ifdef LATER /* Will activate the test when flush is implemented */
/* Flush the HDF5 file */
@@ -744,7 +743,7 @@ test_writer_create_open_flush(void)
/* Verify info in metadata file when flushing the HDF5 file */
if(H5F__vfd_swmr_writer_create_open_flush_test(fid, FALSE) < 0)
- TEST_ERROR
+ FAIL_STACK_ERROR
#endif
/* Close the file */
@@ -753,11 +752,11 @@ test_writer_create_open_flush(void)
/* Re-open the file as VFD SWMR writer */
if((fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl)) < 0)
- TEST_ERROR;
+ FAIL_STACK_ERROR;
/* Verify info in metadata file when reopening the HDF5 file */
if(H5F__vfd_swmr_writer_create_open_flush_test(fid, FALSE) < 0)
- TEST_ERROR
+ FAIL_STACK_ERROR;
/* Closing */
if(H5Fclose(fid) < 0)