summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-04-25 17:04:17 (GMT)
committerGitHub <noreply@github.com>2023-04-25 17:04:17 (GMT)
commitb7c8061505ce3971c16bcaf0e96e6964b3ae9dc4 (patch)
tree39b256bf8ffa4ed3f9258285e8add0a38bad15c6 /test
parent580b2747db63dc2735832fdec6c35f8c3344836d (diff)
downloadhdf5-b7c8061505ce3971c16bcaf0e96e6964b3ae9dc4.zip
hdf5-b7c8061505ce3971c16bcaf0e96e6964b3ae9dc4.tar.gz
hdf5-b7c8061505ce3971c16bcaf0e96e6964b3ae9dc4.tar.bz2
Allow H5P_DEFAULT in H5Pget_vol_cap_flags and H5Pget_vol_id (#2807)
Diffstat (limited to 'test')
-rw-r--r--test/vol.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/vol.c b/test/vol.c
index 27ffdcd..29bbb06 100644
--- a/test/vol.c
+++ b/test/vol.c
@@ -2227,9 +2227,10 @@ test_vol_cap_flags(void)
hid_t fapl_id = H5I_INVALID_HID;
hid_t vol_id = H5I_INVALID_HID;
uint64_t vol_cap_flags = H5VL_CAP_FLAG_NONE;
+ char *vol_env = NULL;
H5VL_pass_through_info_t passthru_info;
- TESTING("VOL capacity flags");
+ TESTING("VOL capability flags");
/* Register a fake VOL */
if ((vol_id = H5VLregister_connector(&fake_vol_g, H5P_DEFAULT)) < 0)
@@ -2251,6 +2252,29 @@ test_vol_cap_flags(void)
if (vol_cap_flags & H5VL_CAP_FLAG_ATTR_BASIC)
TEST_ERROR;
+ /* If using the native VOL by default, check flags again with H5P_DEFAULT */
+ vol_env = HDgetenv(HDF5_VOL_CONNECTOR);
+ if (!vol_env || (0 == HDstrcmp(vol_env, "native"))) {
+ H5VL_class_t *cls;
+ hid_t connector_id;
+
+ if (H5Pget_vol_id(H5P_DEFAULT, &connector_id) < 0)
+ TEST_ERROR;
+ if (NULL == (cls = H5I_object(connector_id)))
+ TEST_ERROR;
+
+ vol_cap_flags = H5VL_CAP_FLAG_NONE;
+
+ if (H5Pget_vol_cap_flags(H5P_DEFAULT, &vol_cap_flags) < 0)
+ TEST_ERROR;
+
+ if (vol_cap_flags != cls->cap_flags)
+ TEST_ERROR;
+
+ if (H5VLclose(connector_id) < 0)
+ TEST_ERROR;
+ }
+
/* Stack the [internal] passthrough VOL connector on top of the fake connector */
passthru_info.under_vol_id = vol_id;
passthru_info.under_vol_info = NULL;