diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-15 03:53:09 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-15 03:53:09 (GMT) |
commit | 8f3811e1b172b208d38ff4328101d43fc8b8fa2a (patch) | |
tree | 5eb956d9eb7f1cc5aefe88f8123bfb12d273a343 /test/extend.c | |
parent | c7bc8d9d2841e712b61f67c3f13f4475294874a9 (diff) | |
download | hdf5-8f3811e1b172b208d38ff4328101d43fc8b8fa2a.zip hdf5-8f3811e1b172b208d38ff4328101d43fc8b8fa2a.tar.gz hdf5-8f3811e1b172b208d38ff4328101d43fc8b8fa2a.tar.bz2 |
[svn-r15869] Description:
Bring r15868 from trunk to 1.8 release branch:
Correct a minor error in file free space allocation which was affecting
the 'multi' VFD and preventing some tests from fully working with it.
Wholesale revisitation of all the places where tests were disabled
with various VFDs and remove or correct all these so that _only_ the tests
which _really_ can't work with particular VFDs are skipped during a
'make check-vfd' test.
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/extend.c')
-rw-r--r-- | test/extend.c | 82 |
1 files changed, 37 insertions, 45 deletions
diff --git a/test/extend.c b/test/extend.c index f5b0f2e..3ffcadc 100644 --- a/test/extend.c +++ b/test/extend.c @@ -68,8 +68,8 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me for(j = 0; j < 5; j++) { /* Extend the dataset */ - offset[0] = i * NX; - offset[1] = j * NY; + offset[0] = (hsize_t)(i * NX); + offset[1] = (hsize_t)(j * NY); size[0] = offset[0] + NX; size[1] = offset[1] + NY; if(size[0] > max_size[0] || size[1] > max_size[1]) { @@ -96,8 +96,8 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me for(j = 0; j < 10; j++) { /* Select a hyperslab */ - offset[0] = i * (NX / 2); - offset[1] = j * (NY / 2); + offset[0] = (hsize_t)(i * (NX / 2)); + offset[1] = (hsize_t)(j * (NY / 2)); if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, half_dims, NULL) < 0) TEST_ERROR; /* Read */ @@ -164,8 +164,8 @@ write_data_deprec(const char *msg, hid_t file, const char *name, hid_t cparms, h for(j = 0; j < 5; j++) { /* Extend the dataset */ - offset[0] = i * NX; - offset[1] = j * NY; + offset[0] = (hsize_t)(i * NX); + offset[1] = (hsize_t)(j * NY); size[0] = offset[0] + NX; size[1] = offset[1] + NY; if(H5Dextend(dataset, size) < 0) TEST_ERROR; @@ -186,8 +186,8 @@ write_data_deprec(const char *msg, hid_t file, const char *name, hid_t cparms, h for(j = 0; j < 10; j++) { /* Select a hyperslab */ - offset[0] = i * (NX / 2); - offset[1] = j * (NY / 2); + offset[0] = (hsize_t)(i * (NX / 2)); + offset[1] = (hsize_t)(j * (NY / 2)); if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, half_dims, NULL) < 0) TEST_ERROR; /* Read */ @@ -251,57 +251,49 @@ main (void) static hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; char filename[1024]; int i, j; - const char *envval = NULL; - envval = HDgetenv("HDF5_DRIVER"); - if(envval == NULL) - envval = "nomatch"; - if(HDstrcmp(envval, "split")) { - h5_reset(); - fapl = h5_fileaccess(); + h5_reset(); + fapl = h5_fileaccess(); - /* Initialize buffer and space */ - for(i = 0; i < NX; i++) - for(j = 0; j < NY; j++) - buf1[i][j] = i * NY + j; + /* Initialize buffer and space */ + for(i = 0; i < NX; i++) + for(j = 0; j < NY; j++) + buf1[i][j] = i * NY + j; - if((mem_space = H5Screate_simple(2, dims, maxdims)) < 0) TEST_ERROR; + if((mem_space = H5Screate_simple(2, dims, maxdims)) < 0) TEST_ERROR; - /* Create the file */ - h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; + /* Create the file */ + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR; - /* Create the dataset creation property list */ - if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; - if(H5Pset_chunk(cparms, 2, chunk_dims) < 0) TEST_ERROR; + /* Create the dataset creation property list */ + if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; + if(H5Pset_chunk(cparms, 2, chunk_dims) < 0) TEST_ERROR; - /* Test with incremental allocation */ - nerrors += write_data("extendible dataset with incr. allocation", file, "dataset1a", cparms, mem_space) < 0 ? 1 : 0; + /* Test with incremental allocation */ + nerrors += write_data("extendible dataset with incr. allocation", file, "dataset1a", cparms, mem_space) < 0 ? 1 : 0; #ifndef H5_NO_DEPRECATED_SYMBOLS - nerrors += write_data_deprec("extendible dataset with incr. allocation w/deprec. symbols", file, "dataset1b", cparms, mem_space) < 0 ? 1 : 0; + nerrors += write_data_deprec("extendible dataset with incr. allocation w/deprec. symbols", file, "dataset1b", cparms, mem_space) < 0 ? 1 : 0; #endif /* H5_NO_DEPRECATED_SYMBOLS */ - /* Test with early allocation */ - if(H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR; - nerrors += write_data("extendible dataset with early allocation", file, "dataset2a", cparms, mem_space) < 0 ? 1 : 0; + /* Test with early allocation */ + if(H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR; + nerrors += write_data("extendible dataset with early allocation", file, "dataset2a", cparms, mem_space) < 0 ? 1 : 0; #ifndef H5_NO_DEPRECATED_SYMBOLS - nerrors += write_data_deprec("extendible dataset with early allocation w/deprec. symbols", file, "dataset2b", cparms, mem_space) < 0 ? 1 : 0; + nerrors += write_data_deprec("extendible dataset with early allocation w/deprec. symbols", file, "dataset2b", cparms, mem_space) < 0 ? 1 : 0; #endif /* H5_NO_DEPRECATED_SYMBOLS */ - if(H5Pclose(cparms) < 0) TEST_ERROR; - if(H5Sclose(mem_space) < 0) TEST_ERROR; - if(H5Fclose(file) < 0) TEST_ERROR; + if(H5Pclose(cparms) < 0) TEST_ERROR; + if(H5Sclose(mem_space) < 0) TEST_ERROR; + if(H5Fclose(file) < 0) TEST_ERROR; - if(nerrors) { - printf("***** %d FAILURE%s! *****\n", nerrors, (1 == nerrors) ? "" : "S"); - exit(1); - } /* end if */ - - printf("All extend tests passed.\n"); - h5_cleanup(FILENAME, fapl); + if(nerrors) { + printf("***** %d FAILURE%s! *****\n", nerrors, (1 == nerrors) ? "" : "S"); + exit(1); } /* end if */ - else - puts("All extend tests skipped - Incompatible with current Virtual File Driver"); + + printf("All extend tests passed.\n"); + h5_cleanup(FILENAME, fapl); return 0; |