From 373d50bb3fb32d6cd34de7f9e32af396499282b1 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Wed, 7 Jul 2004 17:02:34 -0500 Subject: [svn-r8826] Purpose: h5dump new tests Description: added more tests for the escape/not escape feature for string data (with vlen, with compound, with char data) Solution: Platforms tested: linux solaris AIX Misc. update: --- MANIFEST | 2 + tools/h5dump/h5dump.c | 4 - tools/h5dump/h5dumpgentest.c | 244 ++++++++++++++++++-------------------- tools/h5dump/testh5dump.sh.in | 7 +- tools/testfiles/tallfilters.ddl | 2 +- tools/testfiles/tchunked.ddl | 2 +- tools/testfiles/tcompact.ddl | 2 +- tools/testfiles/tcontiguos.ddl | 2 +- tools/testfiles/tdeflate.ddl | 2 +- tools/testfiles/tfilters.h5 | Bin 52336 -> 44144 bytes tools/testfiles/tfletcher32.ddl | 2 +- tools/testfiles/tfvalues.h5 | Bin 9552 -> 9552 bytes tools/testfiles/tindiceslarge.ddl | 2 +- tools/testfiles/tnofilename.ddl | 4 - tools/testfiles/tshuffle.ddl | 2 +- tools/testfiles/tstr3.h5 | Bin 0 -> 8736 bytes tools/testfiles/tstring.ddl | 78 ++++++++++-- tools/testfiles/tstring2.ddl | 15 +++ tools/testfiles/tstringe.ddl | 71 +++++++++-- tools/testfiles/tszip.ddl | 2 +- tools/testfiles/tuserfilter.ddl | 2 +- 21 files changed, 275 insertions(+), 170 deletions(-) create mode 100644 tools/testfiles/tstr3.h5 create mode 100644 tools/testfiles/tstring2.ddl diff --git a/MANIFEST b/MANIFEST index 8c33d21..d83ae6e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1342,6 +1342,8 @@ ./tools/testfiles/tindiceslarge.ddl ./tools/testfiles/tfill.ddl ./tools/testfiles/tfvalues.h5 +./tools/testfiles/tstring2.ddl +./tools/testfiles/tstr3.h5 diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index d294942..add1450 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -590,10 +590,6 @@ usage(const char *prog) fprintf(stdout, " -o F, --output=F Output raw data into file F\n"); fprintf(stdout, " -t P, --datatype=P Print the specified named data type\n"); fprintf(stdout, " -w N, --width=N Set the number of columns of output\n"); - fprintf(stdout, " -L Do not print soft links\n"); - fprintf(stdout, " -G Do not print groups\n"); - fprintf(stdout, " -T Do not print named datatypes\n"); - fprintf(stdout, " -E Do not print datasets\n"); fprintf(stdout, " -x, --xml Output in XML using Schema\n"); fprintf(stdout, " -u, --use-dtd Output in XML using DTD\n"); fprintf(stdout, " -D U, --xml-dtd=U Use the DTD or schema at U\n"); diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index e330693..9e90aec 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -78,6 +78,8 @@ #define FILE46 "tfcontents1.h5" #define FILE47 "tfcontents2.h5" #define FILE48 "tfvalues.h5" +#define FILE49 "tstr3.h5" + /*------------------------------------------------------------------------- @@ -4483,44 +4485,25 @@ make_external(hid_t fid) * Function: gent_filters * * Purpose: make several datasets with filters, external dataset - * fill value * *------------------------------------------------------------------------- */ static void gent_filters(void) { - typedef enum - { - E_RED, - E_GREEN - } e_t; - hid_t fid; /* file id */ hid_t dcpl; /* dataset creation property list */ hid_t sid; /* dataspace ID */ - hid_t sid1; /* dataspace ID */ hid_t tid; /* datatype ID */ - hid_t did; /* dataset ID */ - hid_t gid; /* group ID */ #if defined (H5_HAVE_FILTER_SZIP) unsigned szip_options_mask=H5_SZIP_ALLOW_K13_OPTION_MASK|H5_SZIP_NN_OPTION_MASK; unsigned szip_pixels_per_block=4; #endif - hsize_t dims1[RANK]={DIM1,DIM2}; - hsize_t chunk_dims[RANK]={CDIM1,CDIM2}; + hsize_t dims1[RANK] = {DIM1,DIM2}; + hsize_t dims3[3] = {2,2,100}; + hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; int buf1[DIM1][DIM2]; - hsize_t dims2[1]={2}; - hvl_t buf2[2]; - hsize_t dims3[1]={1}; - char buf3[]={"quote \" backspace\b form feed\f new line\n tab\t new line\n carriage return\r"}; - hsize_t dims4[1]={6}; - char buf4[6]={"abcdef"}; - hobj_ref_t buf5[1]; - hsize_t dims5[1]={1}; - int i, j, k, n, ret, val; - int fillval = -99; - int buf6[2][2][100]; - hsize_t dims6[3]={2,2,100}; + int buf3[2][2][100]; + int i, j, k, n, ret; for (i=n=0; i=0); - - /*------------------------------------------------------------------------- * create a compact and contiguous storage layout dataset * add a comment to the datasets @@ -4773,110 +4752,15 @@ static void gent_filters(void) assert(ret>=0); /*------------------------------------------------------------------------- - * enum type with nonprintable characters in the name - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED 3 \\n", (val = 0, &val)); - write_dset(fid,2,dims1,"enum",tid,0); - ret=H5Tclose(tid); - assert(ret>=0); - -/*------------------------------------------------------------------------- - * vlen - *------------------------------------------------------------------------- - */ - - buf2[0].len = 1; - buf2[0].p = malloc( 1 * sizeof(int)); - ((int *)buf2[0].p)[0]=1; - buf2[1].len = 2; - buf2[1].p = malloc( 2 * sizeof(int)); - ((int *)buf2[1].p)[0]=2; - ((int *)buf2[1].p)[1]=3; - - sid1=H5Screate_simple(1,dims2,NULL); - tid=H5Tvlen_create(H5T_NATIVE_INT); - did=H5Dcreate(fid,"vlen",tid,sid1,H5P_DEFAULT); - ret=H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf2); - assert(ret>=0); - ret=H5Tcommit(fid,"myvlen",tid); - assert(ret>=0); - ret=H5Dvlen_reclaim(tid,sid1,H5P_DEFAULT,buf2); - assert(ret>=0); - ret=H5Dclose(did); - assert(ret>=0); - ret=H5Tclose(tid); - assert(ret>=0); - -/*------------------------------------------------------------------------- - * bitfield - *------------------------------------------------------------------------- - */ - tid = H5Tcopy(H5T_STD_B8LE); - write_dset(fid,1,dims3,"bitfield",tid,buf3); - ret=H5Tclose(tid); - assert(ret>=0); - -/*------------------------------------------------------------------------- - * string with escaped characters - *------------------------------------------------------------------------- - */ - - tid=H5Tcopy(H5T_C_S1); - ret=H5Tset_size(tid, sizeof(buf3)); - assert(ret>=0); - write_dset(fid,1,dims3,"string",tid,buf3); - assert(ret>=0); - ret=H5Tclose(tid); - assert(ret>=0); - -/*------------------------------------------------------------------------- - * char array - *------------------------------------------------------------------------- - */ - write_dset(fid,1,dims4,"char",H5T_NATIVE_CHAR,buf4); - -/*------------------------------------------------------------------------- - * links - *------------------------------------------------------------------------- - */ - ret=H5Glink (fid, H5G_LINK_SOFT, "all", "slink to all"); - assert(ret>=0); - - ret=H5Glink (fid, H5G_LINK_HARD, "all", "hlink to all"); - assert(ret>=0); - -/*------------------------------------------------------------------------- - * a group - *------------------------------------------------------------------------- - */ - gid = H5Gcreate(fid,"g1",0); - write_dset(gid,1,dims4,"mydset",H5T_NATIVE_CHAR,buf4); - ret = H5Gclose(gid); - assert(ret>=0); - -/*------------------------------------------------------------------------- - * reference - *------------------------------------------------------------------------- - */ - ret=H5Rcreate(&buf5[0],fid,"g1/mydset",H5R_OBJECT,-1); - assert(ret>=0); - write_dset(fid,1,dims5,"reference",H5T_STD_REF_OBJ,buf5); - -/*------------------------------------------------------------------------- * a large 3D dataset *------------------------------------------------------------------------- */ - write_dset(fid,3,dims6,"3d",H5T_NATIVE_INT,buf6); + write_dset(fid,3,dims3,"3d",H5T_NATIVE_INT,buf3); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ - ret=H5Sclose(sid1); - assert(ret>=0); - ret=H5Sclose(sid); assert(ret>=0); @@ -5086,7 +4970,6 @@ static void gent_fvalues(void) hvl_t fillval3; /* vlen fill value */ hsize_t dimarray[1]={3}; /* array dimension */ int buf4[2][3]= {{1,2,3},{4,5,6}}; /* array */ - int fillval4[1][3]= {{1,2,3}}; /* array fill value */ int ret; /* create a file */ @@ -5214,6 +5097,114 @@ static void gent_fvalues(void) } +/*------------------------------------------------------------------------- + * Function: gent_string + * + * Purpose: make several datasets for the string with escape/not escape test + * + *------------------------------------------------------------------------- + */ +static void gent_string(void) +{ + /* compound datatype */ + typedef struct c_t + { + int a; + char str[255]; + } c_t; + + hid_t fid; /* file id */ + hid_t sid; /* dataspace ID */ + hid_t tid; /* datatype ID */ + hid_t str_tid; /* datatype ID */ + hid_t did; /* dataset ID */ + char buf1[]={"quote \" backspace\b form feed\f new line\n tab\t new line\n carriage return\r"}; + char *buf2[SPACE1_DIM1]= { + "Four score and seven\n years ago our forefathers brought forth on this continent a new nation,", + "conceived in liberty\n and dedicated to the proposition that all men are created equal.", + "Now we are engaged\n in a great civil war,", + "testing whether that\n nation or any nation so conceived and so dedicated can long endure." + }; + c_t buf3 = {24, "Four score and seven\n years ago our forefathers brought forth on this continent a new nation"}; + char buf4[] = {"Four score and seven\n years ago our forefathers brought forth on this continent a new nation"}; + hsize_t dims1[] = {1}; + hsize_t dims2[] = {SPACE1_DIM1}; + hsize_t dims4[1]; + int ret; + + dims4[0] = sizeof(buf4); + + /* create a file */ + fid = H5Fcreate(FILE49, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + assert(fid>=0); + +/*------------------------------------------------------------------------- + * str1 + *------------------------------------------------------------------------- + */ + + tid=H5Tcopy(H5T_C_S1); + ret=H5Tset_size(tid, sizeof(buf1)); + assert(ret>=0); + write_dset(fid,1,dims1,"str1",tid,buf1); + assert(ret>=0); + ret=H5Tclose(tid); + assert(ret>=0); + +/*------------------------------------------------------------------------- + * str2 + *------------------------------------------------------------------------- + */ + sid = H5Screate_simple(SPACE1_RANK, dims2, NULL); + tid = H5Tcopy (H5T_C_S1); + ret = H5Tset_size (tid,H5T_VARIABLE); + assert(ret>=0); + did = H5Dcreate(fid,"str2",tid,sid,H5P_DEFAULT); + ret = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf2); + assert(ret>=0); + ret=H5Tclose(tid); + assert(ret>=0); + ret=H5Dclose(did); + assert(ret>=0); + ret=H5Sclose(sid); + assert(ret>=0); + +/*------------------------------------------------------------------------- + * str3 + *------------------------------------------------------------------------- + */ + sid = H5Screate_simple(SPACE1_RANK, dims1, NULL); + tid = H5Tcreate (H5T_COMPOUND, sizeof(c_t)); + str_tid = H5Tcopy( H5T_C_S1 ); + H5Tset_size( str_tid, 255 ); + H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_INT); + H5Tinsert(tid, "str", HOFFSET(c_t, str), str_tid ); + ret=make_dset(fid,"str3",sid,tid,H5P_DEFAULT,&buf3); + assert(ret>=0); + ret = H5Tclose(tid); + assert(ret>=0); + ret = H5Tclose(str_tid); + assert(ret>=0); + ret=H5Sclose(sid); + assert(ret>=0); + +/*------------------------------------------------------------------------- + * str4 + *------------------------------------------------------------------------- + */ + sid = H5Screate_simple(SPACE1_RANK, dims4, NULL); + ret=make_dset(fid,"str4",sid,H5T_NATIVE_CHAR,H5P_DEFAULT,buf4); + ret=H5Sclose(sid); + assert(ret>=0); + +/*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + ret=H5Fclose(fid); + assert(ret>=0); +} + /*------------------------------------------------------------------------- @@ -5272,6 +5263,7 @@ int main(void) gent_null_space(); gent_fcontents(); gent_fvalues(); + gent_string(); return 0; } diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index bf6f097..88b40c1 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -240,15 +240,16 @@ TOOLTEST tfill.ddl -p tfvalues.h5 TOOLTEST treference.ddl tattr2.h5 # escape/not escape non printable characters -TOOLTEST tstringe.ddl -e -d string tfilters.h5 -TOOLTEST tstring.ddl -d string tfilters.h5 +TOOLTEST tstringe.ddl -e tstr3.h5 +TOOLTEST tstring.ddl tstr3.h5 +# char data as ASCII with non escape +TOOLTEST tstring2.ddl -r -d str4 tstr3.h5 # array indices print/not print, large dataset TOOLTEST tindicesyes.ddl -d compact tfilters.h5 TOOLTEST tindicesno.ddl -y -d compact tfilters.h5 TOOLTEST tindiceslarge.ddl -p -d 3d tfilters.h5 - # tests for filters # SZIP option="-H -p -d szip tfilters.h5" diff --git a/tools/testfiles/tallfilters.ddl b/tools/testfiles/tallfilters.ddl index 4f54e9a..e3121d8 100644 --- a/tools/testfiles/tallfilters.ddl +++ b/tools/testfiles/tallfilters.ddl @@ -23,7 +23,7 @@ DATASET "all" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE -99 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tchunked.ddl b/tools/testfiles/tchunked.ddl index 339a890..ba18776 100644 --- a/tools/testfiles/tchunked.ddl +++ b/tools/testfiles/tchunked.ddl @@ -15,7 +15,7 @@ COMMENT "This is a dataset with chunked storage" } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE -99 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tcompact.ddl b/tools/testfiles/tcompact.ddl index 3aaff2e..f970ce5 100644 --- a/tools/testfiles/tcompact.ddl +++ b/tools/testfiles/tcompact.ddl @@ -15,7 +15,7 @@ COMMENT "This is a dataset with compact storage" } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE -99 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_EARLY diff --git a/tools/testfiles/tcontiguos.ddl b/tools/testfiles/tcontiguos.ddl index a79b109..2828f8c 100644 --- a/tools/testfiles/tcontiguos.ddl +++ b/tools/testfiles/tcontiguos.ddl @@ -16,7 +16,7 @@ COMMENT "This is a dataset with contiguous storage" } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE -99 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE diff --git a/tools/testfiles/tdeflate.ddl b/tools/testfiles/tdeflate.ddl index 1701a5b..fc98432 100644 --- a/tools/testfiles/tdeflate.ddl +++ b/tools/testfiles/tdeflate.ddl @@ -14,7 +14,7 @@ DATASET "deflate" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE -99 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tfilters.h5 b/tools/testfiles/tfilters.h5 index ff5bec0..8933967 100644 Binary files a/tools/testfiles/tfilters.h5 and b/tools/testfiles/tfilters.h5 differ diff --git a/tools/testfiles/tfletcher32.ddl b/tools/testfiles/tfletcher32.ddl index bb77e7d..9395f4a 100644 --- a/tools/testfiles/tfletcher32.ddl +++ b/tools/testfiles/tfletcher32.ddl @@ -14,7 +14,7 @@ DATASET "fletcher32" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE -99 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tfvalues.h5 b/tools/testfiles/tfvalues.h5 index 53879aa..cb3172c 100644 Binary files a/tools/testfiles/tfvalues.h5 and b/tools/testfiles/tfvalues.h5 differ diff --git a/tools/testfiles/tindiceslarge.ddl b/tools/testfiles/tindiceslarge.ddl index db72630..0b2a297 100644 --- a/tools/testfiles/tindiceslarge.ddl +++ b/tools/testfiles/tindiceslarge.ddl @@ -8,7 +8,7 @@ DATASET "3d" { STORAGE_LAYOUT { CONTIGUOUS SIZE 1600 - OFFSET 48688 + OFFSET 42544 } FILTERS { NONE diff --git a/tools/testfiles/tnofilename.ddl b/tools/testfiles/tnofilename.ddl index db85fab..36cbcad 100644 --- a/tools/testfiles/tnofilename.ddl +++ b/tools/testfiles/tnofilename.ddl @@ -22,10 +22,6 @@ usage: h5dump [OPTIONS] file -o F, --output=F Output raw data into file F -t P, --datatype=P Print the specified named data type -w N, --width=N Set the number of columns of output - -L Do not print soft links - -G Do not print groups - -T Do not print named datatypes - -E Do not print datasets -x, --xml Output in XML using Schema -u, --use-dtd Output in XML using DTD -D U, --xml-dtd=U Use the DTD or schema at U diff --git a/tools/testfiles/tshuffle.ddl b/tools/testfiles/tshuffle.ddl index 494e9dd..00f8e4a 100644 --- a/tools/testfiles/tshuffle.ddl +++ b/tools/testfiles/tshuffle.ddl @@ -14,7 +14,7 @@ DATASET "shuffle" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE -99 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tstr3.h5 b/tools/testfiles/tstr3.h5 new file mode 100644 index 0000000..5dee4c5 Binary files /dev/null and b/tools/testfiles/tstr3.h5 differ diff --git a/tools/testfiles/tstring.ddl b/tools/testfiles/tstring.ddl index bd21463..53ff8a6 100644 --- a/tools/testfiles/tstring.ddl +++ b/tools/testfiles/tstring.ddl @@ -1,20 +1,74 @@ ############################# -Expected output for 'h5dump -d string tfilters.h5' +Expected output for 'h5dump tstr3.h5' ############################# -HDF5 "tfilters.h5" { -DATASET "string" { - DATATYPE H5T_STRING { - STRSIZE 73; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } - DATASPACE SIMPLE { ( 1 ) / ( 1 ) } - DATA { - (0): "quote " backspace form feed new line +HDF5 "tstr3.h5" { +GROUP "/" { + DATASET "str1" { + DATATYPE H5T_STRING { + STRSIZE 73; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SIMPLE { ( 1 ) / ( 1 ) } + DATA { + (0): "quote " backspace form feed new line tab new line carriage return " + } + } + DATASET "str2" { + DATATYPE H5T_STRING { + STRSIZE H5T_VARIABLE; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } + DATA { + (0): "Four score and seven + years ago our forefathers brought forth on this continent a new nation,", + (1): "conceived in liberty + and dedicated to the proposition that all men are created equal.", + (2): "Now we are engaged + in a great civil war,", + (3): "testing whether that + nation or any nation so conceived and so dedicated can long endure." + } + } + DATASET "str3" { + DATATYPE H5T_COMPOUND { + H5T_STD_I32LE "a"; + H5T_STRING { + STRSIZE 255; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } "str"; + } + DATASPACE SIMPLE { ( 1 ) / ( 1 ) } + DATA { + (0): { + 24, + "Four score and seven + years ago our forefathers brought forth on this continent a new nation" + } + } + } + DATASET "str4" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 93 ) / ( 93 ) } + DATA { + (0): 70, 111, 117, 114, 32, 115, 99, 111, 114, 101, 32, 97, 110, + (13): 100, 32, 115, 101, 118, 101, 110, 10, 32, 121, 101, 97, + (25): 114, 115, 32, 97, 103, 111, 32, 111, 117, 114, 32, 102, + (37): 111, 114, 101, 102, 97, 116, 104, 101, 114, 115, 32, 98, + (49): 114, 111, 117, 103, 104, 116, 32, 102, 111, 114, 116, + (60): 104, 32, 111, 110, 32, 116, 104, 105, 115, 32, 99, 111, + (72): 110, 116, 105, 110, 101, 110, 116, 32, 97, 32, 110, 101, + (84): 119, 32, 110, 97, 116, 105, 111, 110, 0 + } } } } diff --git a/tools/testfiles/tstring2.ddl b/tools/testfiles/tstring2.ddl new file mode 100644 index 0000000..ddfa67c --- /dev/null +++ b/tools/testfiles/tstring2.ddl @@ -0,0 +1,15 @@ +############################# +Expected output for 'h5dump -r -d str4 tstr3.h5' +############################# +HDF5 "tstr3.h5" { +DATASET "str4" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 93 ) / ( 93 ) } + DATA { + "Four score and seven + years ago our fo" + "refathers brought forth on this continent a new n" + "ation\000" + } +} +} diff --git a/tools/testfiles/tstringe.ddl b/tools/testfiles/tstringe.ddl index ffab45b..7e22e5c 100644 --- a/tools/testfiles/tstringe.ddl +++ b/tools/testfiles/tstringe.ddl @@ -1,17 +1,66 @@ ############################# -Expected output for 'h5dump -e -d string tfilters.h5' +Expected output for 'h5dump -e tstr3.h5' ############################# -HDF5 "tfilters.h5" { -DATASET "string" { - DATATYPE H5T_STRING { - STRSIZE 73; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; +HDF5 "tstr3.h5" { +GROUP "/" { + DATASET "str1" { + DATATYPE H5T_STRING { + STRSIZE 73; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SIMPLE { ( 1 ) / ( 1 ) } + DATA { + (0): "quote \" backspace\b form feed\f new line\n tab\t new line\n carriage return\r" + } + } + DATASET "str2" { + DATATYPE H5T_STRING { + STRSIZE H5T_VARIABLE; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } + DATA { + (0): "Four score and seven\n years ago our forefathers brought forth on this continent a new nation,", + (1): "conceived in liberty\n and dedicated to the proposition that all men are created equal.", + (2): "Now we are engaged\n in a great civil war,", + (3): "testing whether that\n nation or any nation so conceived and so dedicated can long endure." + } + } + DATASET "str3" { + DATATYPE H5T_COMPOUND { + H5T_STD_I32LE "a"; + H5T_STRING { + STRSIZE 255; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } "str"; + } + DATASPACE SIMPLE { ( 1 ) / ( 1 ) } + DATA { + (0): { + 24, + "Four score and seven\n years ago our forefathers brought forth on this continent a new nation" + } + } + } + DATASET "str4" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 93 ) / ( 93 ) } + DATA { + (0): 70, 111, 117, 114, 32, 115, 99, 111, 114, 101, 32, 97, 110, + (13): 100, 32, 115, 101, 118, 101, 110, 10, 32, 121, 101, 97, + (25): 114, 115, 32, 97, 103, 111, 32, 111, 117, 114, 32, 102, + (37): 111, 114, 101, 102, 97, 116, 104, 101, 114, 115, 32, 98, + (49): 114, 111, 117, 103, 104, 116, 32, 102, 111, 114, 116, + (60): 104, 32, 111, 110, 32, 116, 104, 105, 115, 32, 99, 111, + (72): 110, 116, 105, 110, 101, 110, 116, 32, 97, 32, 110, 101, + (84): 119, 32, 110, 97, 116, 105, 111, 110, 0 } - DATASPACE SIMPLE { ( 1 ) / ( 1 ) } - DATA { - (0): "quote \" backspace\b form feed\f new line\n tab\t new line\n carriage return\r" } } } diff --git a/tools/testfiles/tszip.ddl b/tools/testfiles/tszip.ddl index a15d3a2..4c6af47 100644 --- a/tools/testfiles/tszip.ddl +++ b/tools/testfiles/tszip.ddl @@ -20,7 +20,7 @@ DATASET "szip" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE -99 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tuserfilter.ddl b/tools/testfiles/tuserfilter.ddl index f7c0df3..5549741 100644 --- a/tools/testfiles/tuserfilter.ddl +++ b/tools/testfiles/tuserfilter.ddl @@ -17,7 +17,7 @@ DATASET "myfilter" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE -99 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR -- cgit v0.12