From 0264342a3ef88bdd03eae699963ef0dafc5ea71c Mon Sep 17 00:00:00 2001 From: Patrick Lu Date: Wed, 31 May 2000 11:22:38 -0500 Subject: [svn-r2308] added a funtion to create a bitfields test file. just used the code from the dataset test file --- tools/h5dumptst.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tools/h5dumptst.c b/tools/h5dumptst.c index 97c5c08..25d9ec2 100644 --- a/tools/h5dumptst.c +++ b/tools/h5dumptst.c @@ -24,6 +24,7 @@ #define FILE17 "tdatareg.h5" #define FILE18 "tnestedcomp.h5" #define FILE19 "topaque.h5" +#define FILE20 "tbitfields.h5" #define LENSTR 50 #define LENSTR2 11 @@ -1723,6 +1724,52 @@ void test_opaque(){ } +void test_bitfields(){ + hid_t file, grp=-1, type=-1, space=-1, dset=-1; + size_t i; + hsize_t nelmts; + unsigned char buf[32]; + + file = H5Fcreate(FILE20, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + if ((grp=H5Gcreate(file, "typetests", 0))<0) goto error; + + /* bitfield_1 */ + nelmts = sizeof(buf); + if ((type=H5Tcopy(H5T_STD_B8LE))<0 || + (space=H5Screate_simple(1, &nelmts, NULL))<0 || + (dset=H5Dcreate(grp, "bitfield_1", type, space, H5P_DEFAULT))<0) + goto error; + for (i=0; i