diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2015-09-22 02:11:54 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2015-09-22 02:11:54 (GMT) |
commit | af25c747adf228eacbd0625f8cd41f84cb3fbbc3 (patch) | |
tree | 3b9b221cf15e6ee39153fcfd8099b7b9568d7e18 /test | |
parent | fb238c24a5c6679c7555c95f887b7f4a49dbb640 (diff) | |
download | hdf5-af25c747adf228eacbd0625f8cd41f84cb3fbbc3.zip hdf5-af25c747adf228eacbd0625f8cd41f84cb3fbbc3.tar.gz hdf5-af25c747adf228eacbd0625f8cd41f84cb3fbbc3.tar.bz2 |
[svn-r27851] Description:
Normalization changes that wouldn't otherwise be necessary if the VDS branch
wasn't coming in shortly.
Tested on:
MacOSX/64 10.10.5 (amazon) w/serial & parallel
(h5committest forthcoming)
Diffstat (limited to 'test')
-rw-r--r-- | test/big.c | 12 | ||||
-rw-r--r-- | test/file_image.c | 15 | ||||
-rw-r--r-- | test/h5test.c | 93 | ||||
-rw-r--r-- | test/h5test.h | 2 |
4 files changed, 57 insertions, 65 deletions
@@ -618,8 +618,8 @@ test_sec2(hid_t fapl) quit: /* End with normal return code */ /* Clean up the test file */ - if(h5_clean_files(FILENAME, fapl)) - HDremove(DNAME); + h5_clean_files(FILENAME, fapl); + HDremove(DNAME); return 0; error: @@ -655,8 +655,8 @@ test_stdio(hid_t fapl) quit: /* End with normal return code */ /* Clean up the test file */ - if(h5_clean_files(FILENAME, fapl)) - HDremove(DNAME); + h5_clean_files(FILENAME, fapl); + HDremove(DNAME); HDfflush(stdout); return 0; @@ -716,8 +716,8 @@ test_family(hid_t fapl) quit: /* End with normal return code */ /* Clean up the test file */ - if(h5_clean_files(FILENAME, fapl)) - HDremove(DNAME); + h5_clean_files(FILENAME, fapl); + HDremove(DNAME); return 0; error: diff --git a/test/file_image.c b/test/file_image.c index 42199cb..d9c782a 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -890,8 +890,7 @@ test_get_file_image(const char * test_banner, VERIFY(err == SUCCEED, "H5Pclose(core_fapl_id) failed."); /* tidy up */ - result = h5_clean_files(FILENAME2, fapl); - VERIFY(result != 0, "h5_clean_files() failed."); + h5_clean_files(FILENAME2, fapl); /* discard the image buffer if it exists */ if(image_ptr != NULL) @@ -1039,8 +1038,7 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(file_id) failed."); /* tidy up */ - result = h5_clean_files(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_clean_files(1) failed."); + h5_clean_files(FILENAME2, fapl_id); /* discard the image buffer if it exists */ if(image_ptr != NULL) @@ -1145,8 +1143,7 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(2) failed."); /* tidy up */ - result = h5_clean_files(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_clean_files(2 failed."); + h5_clean_files(FILENAME2, fapl_id); /************************** Test #3 **********************************/ /* set up a split file driver test file, and try to get its image @@ -1208,8 +1205,7 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(2) failed."); /* tidy up */ - result = h5_clean_files(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_clean_files(2 failed."); + h5_clean_files(FILENAME2, fapl_id); /************************** Test #4 **********************************/ /* set up a family file driver test file, and try to get its image @@ -1269,8 +1265,7 @@ test_get_file_image_error_rejection(void) VERIFY(err == SUCCEED, "H5Fclose(2) failed."); /* tidy up */ - result = h5_clean_files(FILENAME2, fapl_id); - VERIFY(result != 0, "h5_clean_files(2 failed."); + h5_clean_files(FILENAME2, fapl_id); PASSED(); diff --git a/test/h5test.c b/test/h5test.c index 51ec2ca..f936605 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -127,75 +127,68 @@ h5_errors(hid_t estack, void H5_ATTR_UNUSED *client_data) /*------------------------------------------------------------------------- * Function: h5_clean_files * - * Purpose: Cleanup temporary test files. + * Purpose: Cleanup temporary test files (always). * base_name contains the list of test file names. - * The file access property list is also closed. * - * Return: Non-zero if cleanup actions were performed; zero otherwise. + * Return: void * - * Programmer: Quincey Koziol - * September 13, 2015 + * Programmer: Neil Fortner + * June 1, 2015 * *------------------------------------------------------------------------- */ -int +void h5_clean_files(const char *base_name[], hid_t fapl) { - int retval = 0; + int i; - if(GetTestCleanup()) { - int i; - - for(i = 0; base_name[i]; i++) { - char filename[1024]; - char temp[2048]; - hid_t driver; - - if(NULL == h5_fixname(base_name[i], fapl, filename, sizeof(filename))) - continue; + for(i = 0; base_name[i]; i++) { + char filename[1024]; + char temp[2048]; + hid_t driver; - driver = H5Pget_driver(fapl); - - if(driver == H5FD_FAMILY) { - int j; + if(NULL == h5_fixname(base_name[i], fapl, filename, sizeof(filename))) + continue; - for(j = 0; /*void*/; j++) { - HDsnprintf(temp, sizeof temp, filename, j); + driver = H5Pget_driver(fapl); - if(HDaccess(temp, F_OK) < 0) - break; + if(driver == H5FD_FAMILY) { + int j; - HDremove(temp); - } /* end for */ - } else if(driver == H5FD_CORE) { - hbool_t backing; /* Whether the core file has backing store */ + for(j = 0; /*void*/; j++) { + HDsnprintf(temp, sizeof temp, filename, j); - H5Pget_fapl_core(fapl, NULL, &backing); + if(HDaccess(temp, F_OK) < 0) + break; - /* If the file was stored to disk with bacing store, remove it */ - if(backing) - HDremove(filename); - } else if (driver == H5FD_MULTI) { - H5FD_mem_t mt; + HDremove(temp); + } /* end for */ + } else if(driver == H5FD_CORE) { + hbool_t backing; /* Whether the core file has backing store */ - HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + H5Pget_fapl_core(fapl, NULL, &backing); - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { - HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]); - HDremove(temp); /*don't care if it fails*/ - } /* end for */ - } else { + /* If the file was stored to disk with bacing store, remove it */ + if(backing) HDremove(filename); - } - } /* end for */ + } else if (driver == H5FD_MULTI) { + H5FD_mem_t mt; - retval = 1; - } /* end if */ + HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { + HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]); + HDremove(temp); /*don't care if it fails*/ + } /* end for */ + } else { + HDremove(filename); + } + } /* end for */ /* Close the FAPL used to access the file */ H5Pclose(fapl); - return retval; + return; } /* end h5_clean_files() */ @@ -218,8 +211,12 @@ h5_cleanup(const char *base_name[], hid_t fapl) { int retval = 0; - /* Clean up the files and the FAPL */ - retval = h5_clean_files(base_name, fapl); + if(GetTestCleanup()) { + /* Clean up files in base_name, and the FAPL */ + h5_clean_files(base_name, fapl); + + retval = 1; + } /* end if */ /* Restore the original error reporting routine */ h5_restore_err(); diff --git a/test/h5test.h b/test/h5test.h index 615ca4f..f949375 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -123,7 +123,7 @@ extern "C" { #endif /* Generally useful testing routines */ -H5TEST_DLL int h5_clean_files(const char *base_name[], hid_t fapl); +H5TEST_DLL void h5_clean_files(const char *base_name[], hid_t fapl); H5TEST_DLL int h5_cleanup(const char *base_name[], hid_t fapl); H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size); H5TEST_DLL char *h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size); |