diff options
author | James Laird <jlaird@hdfgroup.org> | 2006-07-31 19:46:16 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2006-07-31 19:46:16 (GMT) |
commit | beb04ae817268a49656b5abe043627dcbba15e5d (patch) | |
tree | 557b0c0908867dbb7185c3954626b2a2da3bcaf4 /test/extend.c | |
parent | 70b46a1d89e7f9f4a82748a9e1cc21fb4f121ebe (diff) | |
download | hdf5-beb04ae817268a49656b5abe043627dcbba15e5d.zip hdf5-beb04ae817268a49656b5abe043627dcbba15e5d.tar.gz hdf5-beb04ae817268a49656b5abe043627dcbba15e5d.tar.bz2 |
[svn-r12519] Fixed "make check-vfd"
"make check-vfd" will now run all tests in the test directory with different
file drivers (at least, all of those tests that use the testing framework's
FAPL). Tests that fail will be skipped.
This is not a perfect fix, but is better than nothing.
Along with this change, check-vfd should be added to the Daily Tests.
Diffstat (limited to 'test/extend.c')
-rw-r--r-- | test/extend.c | 77 |
1 files changed, 44 insertions, 33 deletions
diff --git a/test/extend.c b/test/extend.c index 871446a..6e06d99 100644 --- a/test/extend.c +++ b/test/extend.c @@ -160,43 +160,54 @@ main (void) static hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; char filename[1024]; int i, j; - - 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; + const char *envval = NULL; + + envval = HDgetenv("HDF5_DRIVER"); + if (envval == NULL) + envval = "nomatch"; + if (HDstrcmp(envval, "split")) { + 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; + } } + 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 dataset which is originally NX by NY */ + if((cparms = H5Pcreate(H5P_DATASET_CREATE))<0) TEST_ERROR; + if (H5Pset_chunk (cparms, 2, chunk_dims)<0) TEST_ERROR; + nerrors += write_data("extendible dataset with incremental allocation",file,"dataset1",cparms,mem_space)<0 ?1:0; + if(H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY)<0) TEST_ERROR; + nerrors += write_data("extendible dataset with early allocation",file,"dataset2",cparms,mem_space)<0 ?1:0; + + 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); + } + printf("All extend tests passed.\n"); + h5_cleanup(FILENAME, fapl); } - 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 dataset which is originally NX by NY */ - if((cparms = H5Pcreate(H5P_DATASET_CREATE))<0) TEST_ERROR; - if (H5Pset_chunk (cparms, 2, chunk_dims)<0) TEST_ERROR; - nerrors += write_data("extendible dataset with incremental allocation",file,"dataset1",cparms,mem_space)<0 ?1:0; - if(H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY)<0) TEST_ERROR; - nerrors += write_data("extendible dataset with early allocation",file,"dataset2",cparms,mem_space)<0 ?1:0; - - 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); + else + { + puts("All extend tests skipped - Incompatible with current Virtual File Driver"); } - printf("All extend tests passed.\n"); - h5_cleanup(FILENAME, fapl); return 0; - error: - printf("*** One or more extend tests failed ***\n"); - return 1; + error: + printf("*** One or more extend tests failed ***\n"); + return 1; + } |