diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-08-21 16:56:31 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-08-21 16:56:31 (GMT) |
commit | 138c3ee3667f0c6df69ee4dfdc8e4d4dea8ff15a (patch) | |
tree | 2ccbc4c5cab785d213851e80370ca497165ee4b2 /tools/test/h5dump | |
parent | f695491f05ebc6306fc873501174c71e8751a6ce (diff) | |
download | hdf5-138c3ee3667f0c6df69ee4dfdc8e4d4dea8ff15a.zip hdf5-138c3ee3667f0c6df69ee4dfdc8e4d4dea8ff15a.tar.gz hdf5-138c3ee3667f0c6df69ee4dfdc8e4d4dea8ff15a.tar.bz2 |
HDFFV-10188 Add tests and files
Diffstat (limited to 'tools/test/h5dump')
-rw-r--r-- | tools/test/h5dump/CMakeTests.cmake | 5 | ||||
-rw-r--r-- | tools/test/h5dump/h5dumpgentest.c | 51 | ||||
-rw-r--r-- | tools/test/h5dump/testh5dump.sh.in | 3 |
3 files changed, 53 insertions, 6 deletions
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index 0a72709..d3d1c4d 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -104,6 +104,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tgroup-1.ddl ${HDF5_TOOLS_DIR}/testfiles/tgroup-2.ddl ${HDF5_TOOLS_DIR}/testfiles/tgrp_comments.ddl + ${HDF5_TOOLS_DIR}/testfiles/tgrpnullspace.ddl ${HDF5_TOOLS_DIR}/testfiles/thlink-1.ddl ${HDF5_TOOLS_DIR}/testfiles/thlink-2.ddl ${HDF5_TOOLS_DIR}/testfiles/thlink-3.ddl @@ -272,6 +273,7 @@ ${HDF5_TOOLS_DIR}/testfiles/tfvalues.h5 ${HDF5_TOOLS_DIR}/testfiles/tgroup.h5 ${HDF5_TOOLS_DIR}/testfiles/tgrp_comments.h5 + ${HDF5_TOOLS_DIR}/testfiles/tgrpnullspace.h5 ${HDF5_TOOLS_DIR}/testfiles/thlink.h5 ${HDF5_TOOLS_DIR}/testfiles/thyperslab.h5 ${HDF5_TOOLS_DIR}/testfiles/tints4dims.h5 @@ -887,6 +889,8 @@ tgroup-2.out.err tgrp_comments.out tgrp_comments.out.err + tgrpnullspace.out + tgrpnullspace.out.err thlink-1.out thlink-1.out.err thlink-2.out @@ -1394,6 +1398,7 @@ # test for displaying dataset and attribute of null space ADD_H5_TEST (tnullspace 0 --enable-error-stack tnullspace.h5) + ADD_H5_TEST (tgrpnullspace 0 -p --enable-error-stack tgrpnullspace.h5) # test for displaying dataset and attribute of space with 0 dimension size ADD_H5_TEST (zerodim 0 --enable-error-stack zerodim.h5) diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 2128acb..0eaa2d0 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -112,6 +112,7 @@ #define FILE82 "tcompound_complex2.h5" #define FILE83 "tvlenstr_array.h5" #define FILE84 "tudfilter.h5" +#define FILE85 "tgrpnullspace.h5" /*------------------------------------------------------------------------- * prototypes @@ -286,9 +287,9 @@ typedef struct s1_t { #define F64_DIM1 (F64_ARRAY_BUF_LEN / sizeof(int) + 1) /* File 65 macros */ -#define STRATEGY H5F_FSPACE_STRATEGY_NONE /* File space handling strategy */ -#define THRESHOLD10 10 /* Free-space section threshold */ -#define FSPACE_PAGE_SIZE 8192 /* File space page size */ +#define STRATEGY H5F_FSPACE_STRATEGY_NONE /* File space handling strategy */ +#define THRESHOLD10 10 /* Free-space section threshold */ +#define FSPACE_PAGE_SIZE 8192 /* File space page size */ /* "FILE66" macros and for FILE69 */ #define F66_XDIM 8 @@ -7041,8 +7042,8 @@ gent_extlinks(void) * Function: gent_fs_strategy_threshold * * Purpose: Generate a file with non-default file space strategy, - * non-default free-space section threshold, - * non-default file space page size. + * non-default free-space section threshold, + * non-default file space page size. *------------------------------------------------------------------------- */ static void @@ -9721,7 +9722,7 @@ static void gent_bitnopaquefields(void) uint32_t c; uint64_t d; } s_t; - + hid_t file, grp=-1, type=-1, space=-1, dset=-1; size_t i; hsize_t nelmts = F80_DIM32; @@ -10437,6 +10438,43 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, *------------------------------------------------------------------------- */ +/*------------------------------------------------------------------------- + * Function: gent_null_space_group + * + * Purpose: generates dataset and attribute of null dataspace in a group + *------------------------------------------------------------------------- + */ +static void gent_null_space_group(void) +{ + hid_t fid, root, group, dataset, space, attr; + int dset_buf = 10; + int point = 4; + + fid = H5Fcreate(FILE85, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + root = H5Gopen2(fid, "/", H5P_DEFAULT); + + group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* null space */ + space = H5Screate(H5S_NULL); + + /* dataset */ + dataset = H5Dcreate2(group, "dset", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + /* nothing should be written */ + H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset_buf); + + /* attribute */ + attr = H5Acreate2(group, "attr", H5T_NATIVE_UINT, space, H5P_DEFAULT, H5P_DEFAULT); + H5Awrite(attr, H5T_NATIVE_INT, &point); /* Nothing can be written */ + + H5Dclose(dataset); + H5Aclose(attr); + H5Gclose(group); + H5Gclose(root); + H5Sclose(space); + H5Fclose(fid); +} + int main(void) { gent_group(); @@ -10526,6 +10564,7 @@ int main(void) gent_bitnopaquefields(); gent_intsfourdims(); + gent_null_space_group(); gent_udfilter(); diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index f0c01e6..1935b0d 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -132,6 +132,7 @@ $SRC_H5DUMP_TESTFILES/tfpformat.h5 $SRC_H5DUMP_TESTFILES/tfvalues.h5 $SRC_H5DUMP_TESTFILES/tgroup.h5 $SRC_H5DUMP_TESTFILES/tgrp_comments.h5 +$SRC_H5DUMP_TESTFILES/tgrpnullspace.h5 $SRC_H5DUMP_TESTFILES/thlink.h5 $SRC_H5DUMP_TESTFILES/thyperslab.h5 $SRC_H5DUMP_TESTFILES/tintsattrs.h5 @@ -260,6 +261,7 @@ $SRC_H5DUMP_TESTFILES/tfpformat.ddl $SRC_H5DUMP_TESTFILES/tgroup-1.ddl $SRC_H5DUMP_TESTFILES/tgroup-2.ddl $SRC_H5DUMP_TESTFILES/tgrp_comments.ddl +$SRC_H5DUMP_TESTFILES/tgrpnullspace.ddl $SRC_H5DUMP_TESTFILES/thlink-1.ddl $SRC_H5DUMP_TESTFILES/thlink-2.ddl $SRC_H5DUMP_TESTFILES/thlink-3.ddl @@ -1268,6 +1270,7 @@ TOOLTEST thyperslab.ddl --enable-error-stack thyperslab.h5 # test for displaying dataset and attribute of null space TOOLTEST tnullspace.ddl --enable-error-stack tnullspace.h5 +TOOLTEST tgrpnullspace.ddl -p --enable-error-stack tgrpnullspace.h5 # test for displaying dataset and attribute of space with 0 dimension size TOOLTEST zerodim.ddl --enable-error-stack zerodim.h5 |