diff options
Diffstat (limited to 'test/tmisc.c')
-rw-r--r-- | test/tmisc.c | 107 |
1 files changed, 67 insertions, 40 deletions
diff --git a/test/tmisc.c b/test/tmisc.c index b646a69..450743c 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -305,6 +305,11 @@ unsigned m13_rdata[MISC13_DIM1][MISC13_DIM2]; /* Data read from dataset #define MISC28_SIZE 10 #define MISC28_NSLOTS 10000 +/* Definitions for misc. test #29 */ +#define MISC29_ORIG_FILE "specmetaread.h5" +#define MISC29_COPY_FILE "tmisc29.h5" +#define MISC29_DSETNAME "dset2" + /**************************************************************** ** ** test_misc1(): test unlinking a dataset from a group and immediately @@ -1797,11 +1802,10 @@ test_misc11(void) unsigned sym_ik; /* Symbol table B-tree initial 'K' value */ unsigned istore_ik; /* Indexed storage B-tree initial 'K' value */ unsigned sym_lk; /* Symbol table B-tree leaf 'K' value */ - unsigned super; /* Superblock version # */ - unsigned freelist; /* Free list version # */ - unsigned stab; /* Symbol table entry version # */ - unsigned shhdr; /* Shared object header version # */ unsigned nindexes; /* Shared message number of indexes */ + H5F_info2_t finfo; /* global information about file */ + H5F_file_space_type_t strategy; /* File/free space strategy */ + hsize_t threshold; /* Free-space section threshold */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1815,21 +1819,12 @@ test_misc11(void) file= H5Fcreate(MISC11_FILE, H5F_ACC_TRUNC , H5P_DEFAULT, H5P_DEFAULT); CHECK(file, FAIL, "H5Fcreate"); - /* Get the file's dataset creation property list */ - fcpl = H5Fget_create_plist(file); - CHECK(fcpl, FAIL, "H5Fget_create_plist"); - /* Get the file's version information */ - ret=H5Pget_version(fcpl, &super, &freelist, &stab, &shhdr); - CHECK(ret, FAIL, "H5Pget_version"); - VERIFY(super,0,"H5Pget_version"); - VERIFY(freelist,0,"H5Pget_version"); - VERIFY(stab,0,"H5Pget_version"); - VERIFY(shhdr,0,"H5Pget_version"); - - /* Close FCPL */ - ret=H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Pclose"); + ret = H5Fget_info2(file, &finfo); + CHECK(ret, FAIL, "H5Fget_info2"); + VERIFY(finfo.super.version, 0,"H5Fget_info2"); + VERIFY(finfo.free.version, 0,"H5Fget_info2"); + VERIFY(finfo.sohm.version, 0,"H5Fget_info2"); /* Close file */ ret=H5Fclose(file); @@ -1856,6 +1851,9 @@ test_misc11(void) ret=H5Pset_shared_mesg_nindexes(fcpl,MISC11_NINDEXES); CHECK(ret, FAIL, "H5Pset_shared_mesg"); + ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_VFD, (hsize_t)0); + CHECK(ret, FAIL, "H5Pset_file_space"); + /* Creating a file with the non-default file creation property list should * create a version 1 superblock */ @@ -1868,21 +1866,12 @@ test_misc11(void) ret=H5Pclose(fcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Get the file's dataset creation property list */ - fcpl = H5Fget_create_plist(file); - CHECK(fcpl, FAIL, "H5Fget_create_plist"); - /* Get the file's version information */ - ret=H5Pget_version(fcpl, &super, &freelist, &stab, &shhdr); - CHECK(ret, FAIL, "H5Pget_version"); - VERIFY(super,2,"H5Pget_version"); - VERIFY(freelist,0,"H5Pget_version"); - VERIFY(stab,0,"H5Pget_version"); - VERIFY(shhdr,0,"H5Pget_version"); - - /* Close FCPL */ - ret=H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Pclose"); + ret = H5Fget_info2(file, &finfo); + CHECK(ret, FAIL, "H5Fget_info2"); + VERIFY(finfo.super.version, 2,"H5Fget_info2"); + VERIFY(finfo.free.version, 0,"H5Fget_info2"); + VERIFY(finfo.sohm.version, 0,"H5Fget_info2"); /* Close file */ ret=H5Fclose(file); @@ -1892,17 +1881,16 @@ test_misc11(void) file = H5Fopen(MISC11_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(file, FAIL, "H5Fcreate"); - /* Get the file's dataset creation property list */ + /* Get the file's creation property list */ fcpl = H5Fget_create_plist(file); CHECK(fcpl, FAIL, "H5Fget_create_plist"); /* Get the file's version information */ - ret=H5Pget_version(fcpl, &super, &freelist, &stab, &shhdr); - CHECK(ret, FAIL, "H5Pget_version"); - VERIFY(super,2,"H5Pget_version"); - VERIFY(freelist,0,"H5Pget_version"); - VERIFY(stab,0,"H5Pget_version"); - VERIFY(shhdr,0,"H5Pget_version"); + ret = H5Fget_info2(file, &finfo); + CHECK(ret, FAIL, "H5Fget_info2"); + VERIFY(finfo.super.version, 2,"H5Fget_info2"); + VERIFY(finfo.free.version, 0,"H5Fget_info2"); + VERIFY(finfo.sohm.version, 0,"H5Fget_info2"); /* Retrieve all the property values & check them */ ret=H5Pget_userblock(fcpl,&userblock); @@ -1927,6 +1915,11 @@ test_misc11(void) CHECK(ret, FAIL, "H5Pget_shared_mesg_nindexes"); VERIFY(nindexes, MISC11_NINDEXES, "H5Pget_shared_mesg_nindexes"); + ret = H5Pget_file_space(fcpl, &strategy, &threshold); + CHECK(ret, FAIL, "H5Pget_file_space"); + VERIFY(strategy, 4, "H5Pget_file_space"); + VERIFY(threshold, 1, "H5Pget_file_space"); + /* Close file */ ret=H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); @@ -5118,6 +5111,39 @@ test_misc28(void) CHECK_I(ret, "H5Pclose"); } /* end test_misc28() */ + +/**************************************************************** +** +** test_misc29(): Ensure that speculative metadata reads don't +** get raw data into the metadata accumulator. +** +****************************************************************/ +static void +test_misc29(void) +{ + hid_t fid; /* File ID */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Speculative metadata reads\n")); + + /* Make a copy of the data file from svn. */ + ret = h5_make_local_copy(MISC29_ORIG_FILE, MISC29_COPY_FILE); + CHECK(ret, -1, "h5_make_local_copy"); + + /* Open the copied file */ + fid = H5Fopen(MISC29_COPY_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + + /* Delete the last dataset */ + ret = H5Ldelete(fid, MISC29_DSETNAME, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); +} /* end test_misc29() */ + /**************************************************************** ** ** test_misc(): Main misc. test routine. @@ -5161,7 +5187,7 @@ test_misc(void) test_misc26(); /* Test closing property lists with long filter pipelines */ test_misc27(); /* Test opening file with object that has bad # of object header messages */ test_misc28(); /* Test that chunks are cached appropriately */ - + test_misc29(); /* Test that speculative metadata reads are handled correctly */ } /* test_misc() */ @@ -5216,5 +5242,6 @@ cleanup_misc(void) HDremove(MISC25C_FILE); HDremove(MISC26_FILE); HDremove(MISC28_FILE); + HDremove(MISC29_COPY_FILE); } |