From 337a882af80a5158624c1044df8acce6a5781fc9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 5 Jan 2023 17:42:33 -0600 Subject: Update FORTRAN VOL connector test for external pass-through testing (#2393) * Correct concurrency bugs when running tests, along with a bugfix & small warning cleanup. * Committing clang-format changes * Allow spaces (and tabs) in VOL connector info string from environment variable. * Parse connector name from HDF5_PLUGIN_PATH environment variable better * Correct H5VLquery_optional to use H5VL routine instead of H5I. Also add an error message to the failure return value from not finding a plugin. Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: AWS ParallelCluster user Co-authored-by: Koziol --- fortran/test/vol_connector.F90 | 4 +++- src/H5PLint.c | 2 ++ src/H5VL.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fortran/test/vol_connector.F90 b/fortran/test/vol_connector.F90 index 2cc6cee..bfea2e1 100644 --- a/fortran/test/vol_connector.F90 +++ b/fortran/test/vol_connector.F90 @@ -237,6 +237,7 @@ PROGRAM vol_connector LOGICAL :: cleanup, status CHARACTER(LEN=12) :: VOL_CONNECTOR_ENV INTEGER :: LEN = 0 + INTEGER :: CONN_NAME_LEN CALL h5open_f(error) cleanup = .TRUE. @@ -251,8 +252,9 @@ PROGRAM vol_connector ! Check to see if the VOL connector was set with an env variable CALL GET_ENVIRONMENT_VARIABLE("HDF5_VOL_CONNECTOR", VOL_CONNECTOR_ENV, LEN) + CONN_NAME_LEN = INDEX(VOL_CONNECTOR_ENV, ' ') IF(LEN.NE.0)THEN - NATIVE_VOL_CONNECTOR_NAME = TRIM(VOL_CONNECTOR_ENV) + NATIVE_VOL_CONNECTOR_NAME = TRIM(VOL_CONNECTOR_ENV(1:CONN_NAME_LEN)) ELSE NATIVE_VOL_CONNECTOR_NAME = "native" ENDIF diff --git a/src/H5PLint.c b/src/H5PLint.c index 4995adb..4c970c5 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -259,6 +259,8 @@ H5PL_load(H5PL_type_t type, const H5PL_key_t *key) /* Set the return value we found the plugin */ if (found) ret_value = plugin_info; + else + HGOTO_ERROR(H5E_PLUGIN, H5E_NOTFOUND, NULL, "unable to locate plugin") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5VL.c b/src/H5VL.c index fb7af97..8ff5f26 100644 --- a/src/H5VL.c +++ b/src/H5VL.c @@ -967,7 +967,7 @@ H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, uint64_t /* Check args */ if (NULL == flags) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid 'flags' pointer") - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(obj_id))) + if (NULL == (vol_obj = H5VL_vol_object(obj_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") /* Query the connector */ -- cgit v0.12