diff options
Diffstat (limited to 'test/API/H5_api_test.c')
-rw-r--r-- | test/API/H5_api_test.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/test/API/H5_api_test.c b/test/API/H5_api_test.c index 3685506..654eb40 100644 --- a/test/API/H5_api_test.c +++ b/test/API/H5_api_test.c @@ -124,7 +124,7 @@ main(int argc, char **argv) hid_t registered_con_id = H5I_INVALID_HID; char *vol_connector_string_copy = NULL; char *vol_connector_info = NULL; - hbool_t err_occurred = FALSE; + bool err_occurred = false; /* Simple argument checking, TODO can improve that later */ if (argc > 1) { @@ -155,13 +155,12 @@ main(int argc, char **argv) seed = (unsigned)HDtime(NULL); srand(seed); - if (NULL == (test_path_prefix = HDgetenv(HDF5_API_TEST_PATH_PREFIX))) + if (NULL == (test_path_prefix = getenv(HDF5_API_TEST_PATH_PREFIX))) test_path_prefix = ""; - HDsnprintf(H5_api_test_filename, H5_API_TEST_FILENAME_MAX_LENGTH, "%s%s", test_path_prefix, - TEST_FILE_NAME); + snprintf(H5_api_test_filename, H5_API_TEST_FILENAME_MAX_LENGTH, "%s%s", test_path_prefix, TEST_FILE_NAME); - if (NULL == (vol_connector_string = HDgetenv(HDF5_VOL_CONNECTOR))) { + if (NULL == (vol_connector_string = getenv(HDF5_VOL_CONNECTOR))) { printf("No VOL connector selected; using native VOL connector\n"); vol_connector_name = "native"; vol_connector_info = NULL; @@ -169,21 +168,21 @@ main(int argc, char **argv) else { char *token; - if (NULL == (vol_connector_string_copy = HDstrdup(vol_connector_string))) { + if (NULL == (vol_connector_string_copy = strdup(vol_connector_string))) { fprintf(stderr, "Unable to copy VOL connector string\n"); - err_occurred = TRUE; + err_occurred = true; goto done; } - if (NULL == (token = HDstrtok(vol_connector_string_copy, " "))) { + if (NULL == (token = strtok(vol_connector_string_copy, " "))) { fprintf(stderr, "Error while parsing VOL connector string\n"); - err_occurred = TRUE; + err_occurred = true; goto done; } vol_connector_name = token; - if (NULL != (token = HDstrtok(NULL, " "))) { + if (NULL != (token = strtok(NULL, " "))) { vol_connector_info = token; } } @@ -197,7 +196,7 @@ main(int argc, char **argv) if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) { fprintf(stderr, "Unable to create FAPL\n"); - err_occurred = TRUE; + err_occurred = true; goto done; } @@ -208,19 +207,19 @@ main(int argc, char **argv) * Otherwise, HDF5 will default to running the tests * with the native connector, which could be misleading. */ - if (0 != HDstrcmp(vol_connector_name, "native")) { + if (0 != strcmp(vol_connector_name, "native")) { htri_t is_registered; if ((is_registered = H5VLis_connector_registered_by_name(vol_connector_name)) < 0) { fprintf(stderr, "Unable to determine if VOL connector is registered\n"); - err_occurred = TRUE; + err_occurred = true; goto done; } if (!is_registered) { fprintf(stderr, "Specified VOL connector '%s' wasn't correctly registered!\n", vol_connector_name); - err_occurred = TRUE; + err_occurred = true; goto done; } else { @@ -231,19 +230,19 @@ main(int argc, char **argv) */ if (H5Pget_vol_id(fapl_id, &default_con_id) < 0) { fprintf(stderr, "Couldn't retrieve ID of VOL connector set on default FAPL\n"); - err_occurred = TRUE; + err_occurred = true; goto done; } if ((registered_con_id = H5VLget_connector_id_by_name(vol_connector_name)) < 0) { fprintf(stderr, "Couldn't retrieve ID of registered VOL connector\n"); - err_occurred = TRUE; + err_occurred = true; goto done; } if (default_con_id != registered_con_id) { fprintf(stderr, "VOL connector set on default FAPL didn't match specified VOL connector\n"); - err_occurred = TRUE; + err_occurred = true; goto done; } } @@ -255,7 +254,7 @@ main(int argc, char **argv) vol_cap_flags_g = H5VL_CAP_FLAG_NONE; if (H5Pget_vol_cap_flags(fapl_id, &vol_cap_flags_g) < 0) { fprintf(stderr, "Unable to retrieve VOL connector capability flags\n"); - err_occurred = TRUE; + err_occurred = true; goto done; } @@ -265,7 +264,7 @@ main(int argc, char **argv) */ if (create_test_container(H5_api_test_filename, vol_cap_flags_g) < 0) { fprintf(stderr, "Unable to create testing container file '%s'\n", H5_api_test_filename); - err_occurred = TRUE; + err_occurred = true; goto done; } @@ -290,17 +289,17 @@ done: if (default_con_id >= 0 && H5VLclose(default_con_id) < 0) { fprintf(stderr, "Unable to close VOL connector ID\n"); - err_occurred = TRUE; + err_occurred = true; } if (registered_con_id >= 0 && H5VLclose(registered_con_id) < 0) { fprintf(stderr, "Unable to close VOL connector ID\n"); - err_occurred = TRUE; + err_occurred = true; } if (fapl_id >= 0 && H5Pclose(fapl_id) < 0) { fprintf(stderr, "Unable to close FAPL\n"); - err_occurred = TRUE; + err_occurred = true; } H5close(); |