diff --git a/test/API/H5_api_test.c b/test/API/H5_api_test.c index 8b300c0fb0b..42055b3434b 100644 --- a/test/API/H5_api_test.c +++ b/test/API/H5_api_test.c @@ -208,7 +208,9 @@ main(int argc, char **argv) snprintf(H5_api_test_filename, H5_API_TEST_FILENAME_MAX_LENGTH, "%s%s", test_path_prefix, TEST_FILE_NAME); - if (NULL == (vol_connector_string = getenv(HDF5_VOL_CONNECTOR))) { + vol_connector_string = getenv(HDF5_VOL_CONNECTOR); + + if (!vol_connector_string || *vol_connector_string == '\0') { printf("No VOL connector selected; using native VOL connector\n"); vol_connector_name = "native"; vol_connector_info = NULL; diff --git a/test/vol.c b/test/vol.c index 368e6f44f38..82d49908396 100644 --- a/test/vol.c +++ b/test/vol.c @@ -2047,7 +2047,7 @@ test_async_vol_props(void) /* Override possible environment variable & re-initialize default VOL connector */ conn_env_str = getenv(HDF5_VOL_CONNECTOR); - if (conn_env_str) { + if (conn_env_str && *conn_env_str) { if (NULL == (conn_env_str = strdup(conn_env_str))) TEST_ERROR; if (HDunsetenv(HDF5_VOL_CONNECTOR) < 0) @@ -2292,7 +2292,7 @@ test_get_vol_name(void) TESTING("getting connector name"); conn_env_str = getenv(HDF5_VOL_CONNECTOR); - if (NULL == (conn_env_str = getenv("HDF5_VOL_CONNECTOR"))) + if (!conn_env_str || *conn_env_str == '\0') conn_env_str = "native"; /* Skip the connectors other than the native and pass_through connector */ diff --git a/testpar/API/H5_api_test_parallel.c b/testpar/API/H5_api_test_parallel.c index e1f217ee2d6..d9c675a31cd 100644 --- a/testpar/API/H5_api_test_parallel.c +++ b/testpar/API/H5_api_test_parallel.c @@ -296,7 +296,9 @@ main(int argc, char **argv) snprintf(H5_api_test_parallel_filename, H5_API_TEST_FILENAME_MAX_LENGTH, "%s%s", test_path_prefix, PARALLEL_TEST_FILE_NAME); - if (NULL == (vol_connector_string = getenv(HDF5_VOL_CONNECTOR))) { + vol_connector_string = getenv(HDF5_VOL_CONNECTOR); + + if (!vol_connector_string || *vol_connector_string == '\0') { if (MAINPROCESS) printf("No VOL connector selected; using native VOL connector\n"); vol_connector_name = "native";