diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-09 03:44:22 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-09 03:44:22 (GMT) |
commit | 05cc7c234ff463721c4f8e8999d4ca8e0ce3bdbf (patch) | |
tree | be8e7233ad49c73ff5d8c86147a9c1410d843434 /test/unlink.c | |
parent | 70b4cf15ac7a213b88be6ff3614817e5a4011514 (diff) | |
download | hdf5-05cc7c234ff463721c4f8e8999d4ca8e0ce3bdbf.zip hdf5-05cc7c234ff463721c4f8e8999d4ca8e0ce3bdbf.tar.gz hdf5-05cc7c234ff463721c4f8e8999d4ca8e0ce3bdbf.tar.bz2 |
[svn-r15825] Description:
Fix various problems with a the core & sec2 VFDs.
Improve the h5_get_file_size() routine to handle files created with
VFDs that use multiple files.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'test/unlink.c')
-rw-r--r-- | test/unlink.c | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/test/unlink.c b/test/unlink.c index 868f765..e03323f 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -44,8 +44,6 @@ const char *FILENAME[] = { NULL }; -#define THE_OBJECT "/foo" - /* Macros for test_create_unlink() & test_filespace */ #define GROUPNAME "group" #define GROUP2NAME "group2" @@ -564,7 +562,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) TEST_ERROR /* Get the size of an empty file */ - if((empty_size=h5_get_file_size(filename))<0) TEST_ERROR + if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Create common objects for datasets */ @@ -602,7 +600,7 @@ test_filespace(hid_t fapl) if((space = H5Screate_simple(FILESPACE_NDIMS, dims, NULL)) < 0) TEST_ERROR /* Create buffer for writing dataset */ - if((data = HDmalloc(sizeof(int)*FILESPACE_DIM0*FILESPACE_DIM1*FILESPACE_DIM2))==NULL) TEST_ERROR + if(NULL == (data = (int *)HDmalloc(sizeof(int) * FILESPACE_DIM0 * FILESPACE_DIM1 * FILESPACE_DIM2))) TEST_ERROR /* Create single dataset (with contiguous storage & late allocation), remove it & verify file size */ @@ -622,7 +620,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -647,7 +645,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename))<0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -672,7 +670,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename))<0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -697,7 +695,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -722,7 +720,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -746,7 +744,7 @@ test_filespace(hid_t fapl) for(u = 0; u < FILESPACE_REWRITE; u++) { /* Set buffer to some compressible values */ for(v = 0, tmp_data = data; v < (FILESPACE_DIM0 * FILESPACE_DIM1 * FILESPACE_DIM2); v++) - *tmp_data++ = v * u; + *tmp_data++ = (int)(v * u); /* Write the buffer to the dataset */ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR @@ -769,7 +767,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl_nocache)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -794,7 +792,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -858,7 +856,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -886,7 +884,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -911,7 +909,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -943,7 +941,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -973,7 +971,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1063,7 +1061,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1098,7 +1096,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename))<0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1132,7 +1130,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1170,7 +1168,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1220,7 +1218,7 @@ test_filespace(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != empty_size) TEST_ERROR @@ -1517,7 +1515,7 @@ test_unlink_rightleaf(hid_t fid) TESTING("deleting right-most child in non-leaf B-tree node"); /* Allocate space for the group IDs */ - if(NULL == (gids = (hid_t *)HDmalloc(ngroups * sizeof(hid_t)))) TEST_ERROR + if(NULL == (gids = (hid_t *)HDmalloc((size_t)ngroups * sizeof(hid_t)))) TEST_ERROR if((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -1580,7 +1578,7 @@ test_unlink_rightnode(hid_t fid) TESTING("deleting right-most child in non-leaf B-tree node"); /* Allocate space for the group IDs */ - if(NULL == (gids = (hid_t *)HDmalloc(ngroups * sizeof(hid_t)))) TEST_ERROR + if(NULL == (gids = (hid_t *)HDmalloc((size_t)ngroups * sizeof(hid_t)))) TEST_ERROR if((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -1643,7 +1641,7 @@ test_unlink_middlenode(hid_t fid) TESTING("deleting right-most child in non-leaf B-tree node"); /* Allocate space for the group IDs */ - if(NULL == (gids = (hid_t *)HDmalloc(ngroups * sizeof(hid_t)))) TEST_ERROR + if(NULL == (gids = (hid_t *)HDmalloc((size_t)ngroups * sizeof(hid_t)))) TEST_ERROR if((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -2165,7 +2163,7 @@ test_full_group_compact(hid_t fapl) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR /* Get the size of the file with only the objects to keep */ - if((keep_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((keep_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR @@ -2229,7 +2227,7 @@ test_full_group_compact(hid_t fapl) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != keep_size) TEST_ERROR @@ -2299,7 +2297,7 @@ test_full_group_dense(hid_t fapl) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR /* Get the size of the file with only the objects to keep */ - if((keep_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((keep_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Re-open the file */ if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR @@ -2375,7 +2373,7 @@ test_full_group_dense(hid_t fapl) if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR /* Get the size of the file */ - if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR + if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR /* Verify the file is correct size */ if(file_size != keep_size) TEST_ERROR @@ -2419,7 +2417,7 @@ main(void) envval = HDgetenv("HDF5_DRIVER"); if(envval == NULL) envval = "nomatch"; - if(HDstrcmp(envval, "core") && HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) { + if(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) { hid_t fapl, fapl2, file; int nerrors = 0; char filename[1024]; |