diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2017-05-31 21:45:41 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2017-05-31 21:45:41 (GMT) |
commit | fb5c13d59c8f17dca9bbe0e35e00920be2690af3 (patch) | |
tree | cb4e57d7263e8089c5f32cde3bd8ac631ec93d46 /test/swmr.c | |
parent | ef60bcd50e5cd3f66b7cd91a6b816a59c36922e2 (diff) | |
download | hdf5-fb5c13d59c8f17dca9bbe0e35e00920be2690af3.zip hdf5-fb5c13d59c8f17dca9bbe0e35e00920be2690af3.tar.gz hdf5-fb5c13d59c8f17dca9bbe0e35e00920be2690af3.tar.bz2 |
Merge of recent develop work to 1.10 branch:
* H5FD_FEAT_DEFAULT_VFD_COMPATIBLE VFD feature flag (HDFFV-10214)
* H5FDdriver_query() API call (HDFFV-10215)
* Fix to skip SWMR tests that when the current VFD is not compatible
with the default VFD (HDFFV-10197)
* Removed obsolete compiler versions from config/gnu-flags (HDFFV-9937)
* Many warning fixes
Diffstat (limited to 'test/swmr.c')
-rw-r--r-- | test/swmr.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/test/swmr.c b/test/swmr.c index 399a9ec..3b1bd09 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -116,16 +116,37 @@ 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; /* File access property list */ - hid_t file_fapl; /* The file's access property list */ - hid_t fid, fid1, fid2; /* 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 */ + 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 (H5FDdriver_query(driver_id, &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 |