From c8fb91983eef3191d859e76e66224eff5c2f40ad Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Mon, 12 Feb 2007 16:32:36 -0500 Subject: [svn-r13283] added a test for the printing of long long numbers greater than 4GB --- MANIFEST | 3 ++ tools/h5dump/h5dumpgentest.c | 69 ++++++++++++++++++++++++++++++++++++++++-- tools/h5dump/testh5dump.sh.in | 3 ++ tools/testfiles/tbigdata.ddl | 15 +++++++++ tools/testfiles/tbigdata.h5 | Bin 0 -> 2128 bytes 5 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 tools/testfiles/tbigdata.ddl create mode 100644 tools/testfiles/tbigdata.h5 diff --git a/MANIFEST b/MANIFEST index 98082ba..90d8f67 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1174,6 +1174,9 @@ ./tools/testfiles/tbigdims.ddl ./tools/testfiles/tbigdims.h5 ./tools/testfiles/thyperslab.h5 +./tools/testfiles/tbigdata.h5 +./tools/testfiles/tbigdata.ddl + diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 2a955b4..93bb456 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -84,7 +84,8 @@ #define FILE54 "tudlink.h5" #define FILE55 "tbinary.h5" #define FILE56 "tbigdims.h5" -#define FILE57 "thyperslab.h5" +#define FILE57 "tbigdata.h5" +#define FILE58 "thyperslab.h5" /*------------------------------------------------------------------------- * prototypes @@ -5727,6 +5728,69 @@ out: return; } + + +/*------------------------------------------------------------------------- + * Function: gen_bigdata + * + * Purpose: generate a dataset with integer numbers greater than 4GB + * + *------------------------------------------------------------------------- + */ + +static void gen_bigdata(void) +{ + hid_t fid; + hid_t did; + hid_t f_sid; + hsize_t dims[1]={10}; /* dataset dimensions */ + long_long buf[10]; + hsize_t i; + size_t nelmts=10; + int ret; + + /* create a file */ + fid = H5Fcreate(FILE57, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + assert(fid>=0); + + if ((f_sid = H5Screate_simple(1,dims,NULL))<0) + goto out; + if ((did = H5Dcreate(fid,"dsetlonglong",H5T_NATIVE_LLONG,f_sid,H5P_DEFAULT))<0) + goto out; + + buf[0] = GB4LL - 2; + + for (i=1; i=0); + + return; + +out: + printf("Error.....\n"); + H5E_BEGIN_TRY { + H5Sclose(f_sid); + H5Dclose(did); + H5Fclose(fid); + } H5E_END_TRY; + return; + +} + + /*------------------------------------------------------------------------- * Function: gent_hyperslab * @@ -5746,7 +5810,7 @@ static void gent_hyperslab(void) buf[i] = 1; /* create a file */ - fid = H5Fcreate(FILE57, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(FILE58, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); assert(fid>=0); write_dset(fid,2,dims,"stripmine",H5T_NATIVE_DOUBLE,buf); @@ -5822,6 +5886,7 @@ int main(void) gent_ldouble(); gent_binary(); gent_bigdims(); + gen_bigdata(); gent_hyperslab(); return 0; diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 54d4311..4516c2b 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -346,6 +346,9 @@ TOOLTEST tregref.ddl tdatareg.h5 # dimensions over 4GB, print boundary TOOLTEST tbigdims.ddl -d dset4gb -s 4294967284 -c 22 tbigdims.h5 +# numbers over 4GB +TOOLTEST tbigdata.ddl tbigdata.h5 + # hyperslab read TOOLTEST thyperslab.ddl thyperslab.h5 diff --git a/tools/testfiles/tbigdata.ddl b/tools/testfiles/tbigdata.ddl new file mode 100644 index 0000000..0194708 --- /dev/null +++ b/tools/testfiles/tbigdata.ddl @@ -0,0 +1,15 @@ +############################# +Expected output for 'h5dump tbigdata.h5' +############################# +HDF5 "tbigdata.h5" { +GROUP "/" { + DATASET "dsetlonglong" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + DATA { + (0): 4294967294, 4294967295, 4294967296, 4294967297, 4294967298, + (5): 4294967299, 4294967300, 4294967301, 4294967302, 4294967303 + } + } +} +} diff --git a/tools/testfiles/tbigdata.h5 b/tools/testfiles/tbigdata.h5 new file mode 100644 index 0000000..f1b3833 Binary files /dev/null and b/tools/testfiles/tbigdata.h5 differ -- cgit v0.12