mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-24 17:51:25 +08:00
Fix for split VFD and file cleanup when testing H5Fis_hdf5
and H5Fis_accessible in tfile.c.
This commit is contained in:
parent
568c3624de
commit
e66bf948a7
@ -574,6 +574,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix,
|
||||
char *fullname, size_t size, hbool_t nest_printf, hbool_t subst_for_superblock)
|
||||
{
|
||||
const char *prefix = NULL;
|
||||
const char *env = NULL; /* HDF5_DRIVER environment variable */
|
||||
char *ptr, last = '\0';
|
||||
const char *suffix = _suffix;
|
||||
size_t i, j;
|
||||
@ -598,10 +599,31 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix,
|
||||
suffix = nest_printf ? "%%05d.h5" : "%05d.h5";
|
||||
}
|
||||
else if (H5FD_MULTI == driver) {
|
||||
if(subst_for_superblock)
|
||||
suffix = "-s.h5";
|
||||
else
|
||||
suffix = NULL;
|
||||
|
||||
/* Get the environment variable, if it exists, in case
|
||||
* we are using the split driver since both of those
|
||||
* use the multi VFD under the hood.
|
||||
*/
|
||||
env = HDgetenv("HDF5_DRIVER");
|
||||
#ifdef HDF5_DRIVER
|
||||
/* Use the environment variable, then the compile-time constant */
|
||||
if(!env)
|
||||
env = HDF5_DRIVER;
|
||||
#endif
|
||||
if(!HDstrcmp(env, "split")) {
|
||||
/* split VFD */
|
||||
if(subst_for_superblock)
|
||||
suffix = "-m.h5";
|
||||
else
|
||||
suffix = NULL;
|
||||
}
|
||||
else {
|
||||
/* multi VFD */
|
||||
if(subst_for_superblock)
|
||||
suffix = "-s.h5";
|
||||
else
|
||||
suffix = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1715,6 +1715,9 @@ test_file_is_accessible(const char *env_h5_drvr)
|
||||
VERIFY(is_hdf5, FALSE, "H5Fis_accessible (non-HDF5 file)");
|
||||
|
||||
|
||||
/* Clean up files */
|
||||
h5_delete_test_file(filename, fapl_id);
|
||||
|
||||
/* Close property list */
|
||||
ret = H5Pclose(fapl_id);
|
||||
CHECK(ret, FAIL, "H5Pclose");
|
||||
@ -1837,6 +1840,9 @@ test_file_ishdf5(const char *env_h5_drvr)
|
||||
VERIFY(is_hdf5, FALSE, "H5Fis_hdf5");
|
||||
|
||||
|
||||
/* Clean up files */
|
||||
h5_delete_test_file(filename, fapl_id);
|
||||
|
||||
/* Close property list */
|
||||
ret = H5Pclose(fapl_id);
|
||||
CHECK(ret, FAIL, "H5Pclose");
|
||||
|
Loading…
x
Reference in New Issue
Block a user