summaryrefslogtreecommitdiffstats
path: root/test/extend.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-10-15 01:46:34 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-10-15 01:46:34 (GMT)
commit0e51a4244e8de0402fe9d329d6ad3cc1e9d20418 (patch)
tree12fe8ea3e734869c51d57efd98fa7c986a3dcb71 /test/extend.c
parentbea2e1790d2a708f9f0c794254f9e869f77f0f88 (diff)
downloadhdf5-0e51a4244e8de0402fe9d329d6ad3cc1e9d20418.zip
hdf5-0e51a4244e8de0402fe9d329d6ad3cc1e9d20418.tar.gz
hdf5-0e51a4244e8de0402fe9d329d6ad3cc1e9d20418.tar.bz2
[svn-r15868] Description:
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.c82
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;