summaryrefslogtreecommitdiffstats
path: root/test/vfd.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2021-04-16 18:47:32 (GMT)
committerGitHub <noreply@github.com>2021-04-16 18:47:32 (GMT)
commitd5c449248f74886529b9fad09473dd73d60a34fd (patch)
treeca3495dbf738c1561ad6501920a9d54680251664 /test/vfd.c
parente21f7aaac4a4d34a8a5aa1330fb2ed6814532cfb (diff)
downloadhdf5-d5c449248f74886529b9fad09473dd73d60a34fd.zip
hdf5-d5c449248f74886529b9fad09473dd73d60a34fd.tar.gz
hdf5-d5c449248f74886529b9fad09473dd73d60a34fd.tar.bz2
Brings the native implementation of H5Fdelete() from Bitbucket (#524)
* Committing clang-format changes * Brings the native VFD H5Fdelete() implementation from Bitbucket Only brings the 'del' callbacks, not the 'open/close' scheme. * Formatter changes * Committing clang-format changes * Fixes direct VFD callback name * Removes UNUSED macro from family API call * Adds barrier and rank 0 check to MPI-I/O VFD delete * Revert "Adds barrier and rank 0 check to MPI-I/O VFD delete" This reverts commit 909765f759d9d96e84f4b8b1cc14f7d2b3ac8143. * Revert "Revert "Adds barrier and rank 0 check to MPI-I/O VFD delete"" This reverts commit 9b04bef1157853fc79fcb8fcc3e8ba1371091702. * Adds a second barrier after the delete in MPI-I/O VFD * Only delete files in the core VFD when the backing store flag is set * Fixes string issues in multi VFD Also, h5test.c cleanup code now uses H5Fdelete(). * Formatted source * Rework fapl checks for MPI-I/O VFD delete callback Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test/vfd.c')
-rw-r--r--test/vfd.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/test/vfd.c b/test/vfd.c
index f129c5d..6b851a2 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -340,7 +340,7 @@ test_core(void)
if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR;
- /* Retrieve the access property list... */
+ /* Retrieve the access property list */
if ((fapl_id_out = H5Fget_access_plist(fid)) < 0)
TEST_ERROR;
@@ -553,6 +553,38 @@ test_core(void)
TEST_ERROR;
h5_delete_test_file(FILENAME[1], fapl_id);
+ /************************************************************************
+ * Check that delete behavior works correctly
+ ************************************************************************/
+
+ /* Create and close a file */
+ if (H5Pset_fapl_core(fapl_id, (size_t)CORE_INCREMENT, TRUE) < 0)
+ TEST_ERROR;
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ /* Try to delete the file with the backing store off (shouldn't delete anything) */
+ if (H5Pset_fapl_core(fapl_id, (size_t)CORE_INCREMENT, FALSE) < 0)
+ TEST_ERROR;
+ if (H5Fdelete(filename, fapl_id) < 0)
+ TEST_ERROR;
+ if (-1 == HDaccess(filename, F_OK))
+ FAIL_PUTS_ERROR("file deleted when backing store set to FALSE");
+
+ /* Try to delete the file with the backing store on (should work) */
+ if (H5Pset_fapl_core(fapl_id, (size_t)CORE_INCREMENT, TRUE) < 0)
+ TEST_ERROR;
+ if (H5Fdelete(filename, fapl_id) < 0)
+ TEST_ERROR;
+ if (0 == HDaccess(filename, F_OK))
+ FAIL_PUTS_ERROR("file not deleted when backing store set to TRUE");
+
+ /************************************************************************
+ * Clean up
+ ************************************************************************/
+
/* Close the fapl */
if (H5Pclose(fapl_id) < 0)
TEST_ERROR;