diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2009-02-27 17:01:00 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2009-02-27 17:01:00 (GMT) |
commit | ef425724f749705c76b43c17f8da5d2aa066cb00 (patch) | |
tree | f9e36f23d301725e5d447dcc970c15d3997d2632 /test/set_extent.c | |
parent | d75cd486e1394f023f0cc5d8ddfec63f96b8763b (diff) | |
download | hdf5-ef425724f749705c76b43c17f8da5d2aa066cb00.zip hdf5-ef425724f749705c76b43c17f8da5d2aa066cb00.tar.gz hdf5-ef425724f749705c76b43c17f8da5d2aa066cb00.tar.bz2 |
[svn-r16523] Purpose: Fix bugs related to H5Dset_extent and fill values
Description:
In some situations it was possible for the fill value to not be written to parts
of a chunked dataset, particularly when extending and/or shrinking. Prior to
the fix for the chunk cache (1015) these bugs would have been exceedingly rare.
Tested: jam, smirom, linew (h5committest)
Diffstat (limited to 'test/set_extent.c')
-rw-r--r-- | test/set_extent.c | 67 |
1 files changed, 48 insertions, 19 deletions
diff --git a/test/set_extent.c b/test/set_extent.c index 1b6918a..b4e61b4 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -46,12 +46,12 @@ const char *FILENAME[] = { #define RANK1 1 #define RANK2 2 #define RANK3 3 -#define DIM0 4 -#define DIM1 4 -#define DIM2 4 -#define DIMS0 2 -#define DIMS1 2 -#define DIMS2 2 +#define DIM0 5 +#define DIM1 5 +#define DIM2 5 +#define DIMS0 3 +#define DIMS1 3 +#define DIMS2 3 #define DIME0 7 #define DIME1 7 #define DIME2 7 @@ -89,6 +89,7 @@ int main( void ) hid_t fapl; /* file access property list */ hid_t fapl2; /* file access property list w/latest format set */ hbool_t new_format; /* Whether to use the latest file format */ + hbool_t chunk_cache; /* Whether to enable chunk caching */ int nerrors = 0; h5_reset(); @@ -97,6 +98,9 @@ int main( void ) /* Copy the file access property list */ if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR + /* Disable chunk caching on fapl2 */ + if(H5Pset_cache(fapl2, 521, 0, 0, 0.) < 0) TEST_ERROR + /* Set the "use the latest version of the format" bounds for creating objects in the file */ if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR @@ -104,19 +108,44 @@ int main( void ) for(new_format = FALSE; new_format <= TRUE; new_format++) { hid_t my_fapl; - /* Set the FAPL for the type of format */ - if(new_format) { - puts("Testing with new file format:"); - my_fapl = fapl2; - } /* end if */ - else { - puts("Testing with old file format:"); - my_fapl = fapl; - } /* end else */ - - nerrors += do_ranks( my_fapl ) < 0 ? 1 : 0; - nerrors += test_external( my_fapl ) < 0 ? 1 : 0; - nerrors += do_layouts( my_fapl ) < 0 ? 1 : 0; + /* Test chunked datasets with and without chunk cache */ + for(chunk_cache = FALSE; chunk_cache <= TRUE; chunk_cache++) { + /* Output message about the type of format */ + if(new_format) + printf("Testing with new file format"); + else + printf("Testing with old file format"); + + /* Set the FAPL for the chunk cache settings */ + if(chunk_cache) { + puts(" and chunk cache enabled:"); + my_fapl = fapl; + } /* end if */ + else { + puts(" and chunk cache disabled:"); + my_fapl = fapl2; + } /* end else */ + + /* Set the FAPL for the type of format */ + if(new_format) { + /* Set the "use the latest version of the format" bounds for + * creating objects in the file */ + if(H5Pset_libver_bounds(my_fapl, H5F_LIBVER_LATEST, + H5F_LIBVER_LATEST) < 0) TEST_ERROR + } /* end if */ + else + /* Set the "use the earliest version of the format" bounds for + * creating objects in the file */ + if(H5Pset_libver_bounds(my_fapl, H5F_LIBVER_EARLIEST, + H5F_LIBVER_LATEST) < 0) TEST_ERROR + + /* Tests which use chunked datasets */ + nerrors += do_ranks( my_fapl ) < 0 ? 1 : 0; + } /* end for */ + + /* Tests which do not use chunked datasets */ + nerrors += test_external( fapl ) < 0 ? 1 : 0; + nerrors += do_layouts( fapl ) < 0 ? 1 : 0; } /* end for */ /* Close 2nd FAPL */ |