diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2017-05-24 11:44:18 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2017-05-24 11:44:18 (GMT) |
commit | e5a57c97aa43d6c76d1bb1fe64d24aaa0bbbb7d3 (patch) | |
tree | 2f4f57f2bec05bd3bc2fb15e0b93052c578fd90f /test/swmr.c | |
parent | e3b22b8fa45697d6f73330b33cd201c37e0335d6 (diff) | |
download | hdf5-e5a57c97aa43d6c76d1bb1fe64d24aaa0bbbb7d3.zip hdf5-e5a57c97aa43d6c76d1bb1fe64d24aaa0bbbb7d3.tar.gz hdf5-e5a57c97aa43d6c76d1bb1fe64d24aaa0bbbb7d3.tar.bz2 |
* Made H5FD_driver_query() a private function instead of static.
* Moved H5FD_driver_query() to H5FDint.c.
* Minor typo fixes in H5I.c.
* Updated swmr.c to check the VFD feature flags and skip the
retries test when the VFD is not compatible with H5P_DEFAULT.
Diffstat (limited to 'test/swmr.c')
-rw-r--r-- | test/swmr.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/test/swmr.c b/test/swmr.c index 5b50d63..9239ca2 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -116,16 +116,40 @@ static int test_multiple_same(hid_t in_fapl, hbool_t new_format); static int test_metadata_read_attempts(hid_t in_fapl) { - hid_t fapl = -1; /* File access property list */ - hid_t file_fapl = -1; /* The file's access property list */ - hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */ - unsigned attempts; /* The # of read attempts */ - char filename[NAME_BUF_SIZE]; /* File name */ - herr_t ret; /* Generic return value */ + hid_t fapl = -1; /* File access property list */ + hid_t file_fapl = -1; /* The file's access property list */ + hid_t fid = -1, fid1 = -1, fid2 = -1; /* File IDs */ + hid_t driver_id = -1; /* ID for this VFD */ + H5FD_class_t *driver = NULL; /* Pointer to VFD class struct */ + unsigned long driver_flags = 0; /* VFD feature flags */ + hbool_t compat_w_default_vfd; /* current VFD compat w/ H5P_DEFAULT? */ + unsigned attempts; /* The # of read attempts */ + char filename[NAME_BUF_SIZE]; /* File name */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ TESTING("H5Pget/set_metadata_read_attempts()"); + /* Check if the driver is compatible with the default VFD. + * Most of the tests will attempt to create and open files with both the + * VFD specified in the passed-in fapl and the default VFD. Since this + * will clearly not work with VFDs that are not compatible with the default + * fapl (e.g.: split/multi), we just skip this entire test. + */ + if ((driver_id = H5Pget_driver(in_fapl)) < 0) + FAIL_STACK_ERROR + if (NULL == (driver = (H5FD_class_t *)H5I_object_verify(driver_id, H5I_VFL))) + FAIL_STACK_ERROR + if (H5FD_driver_query(driver, &driver_flags) < 0) + FAIL_STACK_ERROR + compat_w_default_vfd = (driver_flags & H5FD_FEAT_DEFAULT_VFD_COMPATIBLE) ? TRUE : FALSE; + + if (!compat_w_default_vfd) { + SKIPPED() + HDputs(" The current VFD is not compatible with the default VFD."); + return 0; + } + /* Get a copy of the parameter fapl */ if((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR |