Skip to content

Commit

Permalink
changed to using H5Fis_accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
brtnfld committed Jul 3, 2024
1 parent 603ebb0 commit 201921f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
9 changes: 7 additions & 2 deletions test/API/H5_api_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,14 @@ main(int argc, char **argv)
H5_api_test_run();

printf("Cleaning up testing files\n");
if (HDaccess(H5_api_test_filename, F_OK) != -1) {
H5Fdelete(H5_api_test_filename, fapl_id);

H5E_BEGIN_TRY
{
if (H5Fis_accessible(H5_api_test_filename, H5P_DEFAULT) > 0) {
H5Fdelete(H5_api_test_filename, fapl_id);
}
}
H5E_END_TRY

if (n_tests_run_g > 0) {
printf("%zu/%zu (%.2f%%) API tests passed with VOL connector '%s'\n", n_tests_passed_g, n_tests_run_g,
Expand Down
14 changes: 9 additions & 5 deletions test/API/H5_api_test_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,13 +788,17 @@ remove_test_file(const char *prefix, const char *filename)
else
test_file = filename;

if (HDaccess(test_file, F_OK) != -1) {
if (H5Fdelete(test_file, H5P_DEFAULT) < 0) {
printf(" couldn't remove file '%s'\n", test_file);
ret_value = FAIL;
goto done;
H5E_BEGIN_TRY
{
if (H5Fis_accessible(test_file, H5P_DEFAULT) > 0) {
if (H5Fdelete(test_file, H5P_DEFAULT) < 0) {
printf(" couldn't remove file '%s'\n", test_file);
ret_value = FAIL;
goto done;
}
}
}
H5E_END_TRY

done:
free(prefixed_filename);
Expand Down

0 comments on commit 201921f

Please sign in to comment.