summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorraylu-hdf <60487644+raylu-hdf@users.noreply.github.com>2022-11-05 22:24:42 (GMT)
committerGitHub <noreply@github.com>2022-11-05 22:24:42 (GMT)
commit81a6f6874fb1d5dd26deac5f09c8e7c089afb45d (patch)
tree7f3f8809a810046b4c39528e07febd2ae37b72c6
parent018f093c096cca8b3965eb17afa01f5637317995 (diff)
downloadhdf5-81a6f6874fb1d5dd26deac5f09c8e7c089afb45d.zip
hdf5-81a6f6874fb1d5dd26deac5f09c8e7c089afb45d.tar.gz
hdf5-81a6f6874fb1d5dd26deac5f09c8e7c089afb45d.tar.bz2
Bug fix: the previous checkin only supported the native connector (#2211)
* Bug fix: make sure the test case supports the pass_through connector. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
-rw-r--r--test/vol.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/test/vol.c b/test/vol.c
index 237b627..7028497 100644
--- a/test/vol.c
+++ b/test/vol.c
@@ -2229,13 +2229,26 @@ error:
static herr_t
test_get_vol_name(void)
{
- hid_t fapl_id = H5I_INVALID_HID;
- hid_t file_id = H5I_INVALID_HID;
- char filename[NAME_LEN];
- char vol_name[NAME_LEN];
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t file_id = H5I_INVALID_HID;
+ char filename[NAME_LEN];
+ char vol_name[NAME_LEN];
+ const char *conn_env_str = NULL;
TESTING("getting connector name");
+ conn_env_str = HDgetenv(HDF5_VOL_CONNECTOR);
+ if (NULL == (conn_env_str = HDgetenv("HDF5_VOL_CONNECTOR")))
+ conn_env_str = "native";
+
+ /* Skip the connectors other than the native and pass_through connector */
+ if (HDstrcmp(conn_env_str, "native") &&
+ HDstrncmp(conn_env_str, "pass_through", HDstrlen("pass_through"))) {
+ SKIPPED();
+ HDprintf(" only test the native or pass_through connector\n");
+ return SUCCEED;
+ }
+
/* Retrieve the file access property for testing */
fapl_id = h5_fileaccess();
@@ -2247,7 +2260,10 @@ test_get_vol_name(void)
if (H5VLget_connector_name(file_id, vol_name, NAME_LEN) < 0)
TEST_ERROR;
- if (HDstrcmp(vol_name, "native"))
+ /* When comparing the pass_through connector, ignore the rest information (under_vol=0;under_info={}) */
+ if ((!HDstrcmp(conn_env_str, "native") && HDstrcmp(vol_name, "native")) ||
+ (!HDstrncmp(conn_env_str, "pass_through", HDstrlen("pass_through")) &&
+ HDstrcmp(vol_name, "pass_through")))
TEST_ERROR;
if (H5Fclose(file_id) < 0)