diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-07-24 16:59:58 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-07-24 17:00:07 (GMT) |
commit | b14c8bdb1c5c80ba189b26f82636cde9d20986c3 (patch) | |
tree | e4148eb22e5cf7c27d3d5935422b94ac5142616b /tools/test/h5dump | |
parent | e2a1ddd8149548b1b4ee35b0e973ded8c82e9a47 (diff) | |
download | hdf5-b14c8bdb1c5c80ba189b26f82636cde9d20986c3.zip hdf5-b14c8bdb1c5c80ba189b26f82636cde9d20986c3.tar.gz hdf5-b14c8bdb1c5c80ba189b26f82636cde9d20986c3.tar.bz2 |
Add test file with unwritten datasets
Diffstat (limited to 'tools/test/h5dump')
-rw-r--r-- | tools/test/h5dump/CMakeTests.cmake | 7 | ||||
-rw-r--r-- | tools/test/h5dump/h5dumpgentest.c | 93 |
2 files changed, 96 insertions, 4 deletions
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index 132fc2b..c2ae0a6 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -125,6 +125,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tints4dimsCountEq.ddl ${HDF5_TOOLS_DIR}/testfiles/tints4dimsStride2.ddl ${HDF5_TOOLS_DIR}/testfiles/tintsattrs.ddl + ${HDF5_TOOLS_DIR}/testfiles/tintsnodata.ddl ${HDF5_TOOLS_DIR}/testfiles/tlarge_objname.ddl #${HDF5_TOOLS_DIR}/testfiles/tldouble.ddl ${HDF5_TOOLS_DIR}/testfiles/tlonglinks.ddl @@ -280,6 +281,7 @@ ${HDF5_TOOLS_DIR}/testfiles/thyperslab.h5 ${HDF5_TOOLS_DIR}/testfiles/tints4dims.h5 ${HDF5_TOOLS_DIR}/testfiles/tintsattrs.h5 + ${HDF5_TOOLS_DIR}/testfiles/tintsnodata.h5 ${HDF5_TOOLS_DIR}/testfiles/tlarge_objname.h5 #${HDF5_TOOLS_DIR}/testfiles/tldouble.h5 ${HDF5_TOOLS_DIR}/testfiles/tlonglinks.h5 @@ -998,6 +1000,8 @@ tints4dimsStride2.out.err tintsattrs.out tintsattrs.out.err + tintsnodata.out + tintsnodata.out.err tlarge_objname.out tlarge_objname.out.err tldouble.out @@ -1168,6 +1172,9 @@ # test for maximum display datasets ADD_H5_TEST (twidedisplay 0 --enable-error-stack -w0 packedbits.h5) + # test for unwritten datasets + ADD_H5_TEST (tintsnodata 0 --enable-error-stack tintsnodata.h5) + # test for signed/unsigned datasets ADD_H5_TEST (packedbits 0 --enable-error-stack packedbits.h5) # test for compound signed/unsigned datasets diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 9e9f6f1..4ef63e5 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -114,6 +114,7 @@ #define FILE84 "tudfilter.h5" #define FILE85 "tgrpnullspace.h5" #define FILE86 "err_attr_dspace.h5" +#define FILE87 "tintsnodata.h5" /*------------------------------------------------------------------------- * prototypes @@ -293,7 +294,7 @@ typedef struct s1_t { #define THRESHOLD10 10 /* Free-space section threshold */ #define FSPACE_PAGE_SIZE 8192 /* File space page size */ -/* "FILE66" macros and for FILE69 */ +/* "FILE66" macros and for FILE69, FILE87 */ #define F66_XDIM 8 #define F66_DATASETU08 "DU08BITS" #define F66_DATASETS08 "DS08BITS" @@ -7526,6 +7527,89 @@ gent_attr_intsize(void) H5Gclose(root); H5Fclose(fid); } +static void +gent_nodata(void) +{ + hid_t fid, dataset, space; + hsize_t dims[2]; + uint8_t dsetu8[F66_XDIM][F66_YDIM8], valu8bits; + uint16_t dsetu16[F66_XDIM][F66_YDIM16], valu16bits; + uint32_t dsetu32[F66_XDIM][F66_YDIM32], valu32bits; + uint64_t dsetu64[F66_XDIM][F66_YDIM64], valu64bits; + int8_t dset8[F66_XDIM][F66_YDIM8], val8bits; + int16_t dset16[F66_XDIM][F66_YDIM16], val16bits; + int32_t dset32[F66_XDIM][F66_YDIM32], val32bits; + int64_t dset64[F66_XDIM][F66_YDIM64], val64bits; + double dsetdbl[F66_XDIM][F66_YDIM8]; + unsigned int i, j; + + fid = H5Fcreate(FILE87, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* Dataset of 8 bits unsigned int */ + dims[0] = F66_XDIM; dims[1] = F66_YDIM8; + space = H5Screate_simple(2, dims, NULL); + dataset = H5Dcreate2(fid, F66_DATASETU08, H5T_STD_U8LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Sclose(space); + H5Dclose(dataset); + + /* Dataset of 16 bits unsigned int */ + dims[0] = F66_XDIM; dims[1] = F66_YDIM16; + space = H5Screate_simple(2, dims, NULL); + dataset = H5Dcreate2(fid, F66_DATASETU16, H5T_STD_U16LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Sclose(space); + H5Dclose(dataset); + + /* Dataset of 32 bits unsigned int */ + dims[0] = F66_XDIM; dims[1] = F66_YDIM32; + space = H5Screate_simple(2, dims, NULL); + dataset = H5Dcreate2(fid, F66_DATASETU32, H5T_STD_U32LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Sclose(space); + H5Dclose(dataset); + + /* Dataset of 64 bits unsigned int */ + dims[0] = F66_XDIM; dims[1] = F66_YDIM64; + space = H5Screate_simple(2, dims, NULL); + dataset = H5Dcreate2(fid, F66_DATASETU64, H5T_STD_U64LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Sclose(space); + H5Dclose(dataset); + + /* Dataset of 8 bits signed int */ + dims[0] = F66_XDIM; dims[1] = F66_YDIM8; + space = H5Screate_simple(2, dims, NULL); + dataset = H5Dcreate2(fid, F66_DATASETS08, H5T_STD_I8LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Sclose(space); + H5Dclose(dataset); + + /* Dataset of 16 bits signed int */ + dims[0] = F66_XDIM; dims[1] = F66_YDIM16; + space = H5Screate_simple(2, dims, NULL); + dataset = H5Dcreate2(fid, F66_DATASETS16, H5T_STD_I16LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Sclose(space); + H5Dclose(dataset); + + /* Dataset of 32 bits signed int */ + dims[0] = F66_XDIM; dims[1] = F66_YDIM32; + space = H5Screate_simple(2, dims, NULL); + dataset = H5Dcreate2(fid, F66_DATASETS32, H5T_STD_I32LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Sclose(space); + H5Dclose(dataset); + + /* Dataset of 64 bits signed int */ + dims[0] = F66_XDIM; dims[1] = F66_YDIM64; + space = H5Screate_simple(2, dims, NULL); + dataset = H5Dcreate2(fid, F66_DATASETS64, H5T_STD_I64LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Sclose(space); + H5Dclose(dataset); + + /* Double Dummy set for failure tests */ + dims[0] = F66_XDIM; dims[1] = F66_YDIM8; + space = H5Screate_simple(2, dims, NULL); + dataset = H5Dcreate2(fid, F66_DUMMYDBL, H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Sclose(space); + H5Dclose(dataset); + H5Fclose(fid); +} + /*------------------------------------------------------------------------- * Function: gent_charsets @@ -10484,12 +10568,12 @@ static void gent_null_space_group(void) * Then write an illegal version to the shared dataspace message * to trigger the error. * This is to verify HDFFV-10333 that h5dump will exit - * gracefully when encountered error similar to + * gracefully when encountered error similar to * H5O_attr_decode in the jira issue. * *------------------------------------------------------------------------- */ -static void +static void gent_err_attr_dspace() { hid_t fid = -1; /* File identifier */ @@ -10535,7 +10619,7 @@ gent_err_attr_dspace() if(H5Fclose(fid) < 0) goto error; - /* This section of code will write an illegal version to the "version" field + /* This section of code will write an illegal version to the "version" field of the shared dataspace message */ if((fd = HDopen(FILE86, O_RDWR, 0633)) < 0) goto error; @@ -10647,6 +10731,7 @@ int main(void) gent_intattrscalars(); gent_intsattrs(); gent_bitnopaquefields(); + gent_nodata(); gent_intsfourdims(); gent_null_space_group(); |