summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump/h5dumpgentest.c40
-rw-r--r--tools/lib/h5tools.c1
-rw-r--r--tools/testfiles/tbin4.ddl2
-rw-r--r--tools/testfiles/tbinary.h5bin806144 -> 4368 bytes
4 files changed, 10 insertions, 33 deletions
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 216a38d..03e0f0a 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -5341,6 +5341,7 @@ error:
}
+
/*-------------------------------------------------------------------------
* Function: gent_binary
*
@@ -5348,8 +5349,7 @@ error:
* Contains:
* 1) an integer dataset
* 2) a float dataset
- * 3) an array dataset
- * 4) a large double dataset
+ * 4) a double dataset
*
*-------------------------------------------------------------------------
*/
@@ -5357,68 +5357,46 @@ static void
gent_binary(void)
{
hid_t fid, sid, did, tid;
- hsize_t dims[1] = {6};
- hsize_t dimarray[1] = {2};
- hsize_t dimsl[1] = {100000};
+ hsize_t dims[1] = {6};
int ibuf[6] = {1,2,3,4,5,6};
float fbuf[6] = {1,2,3,4,5,6};
- int abuf[2][6] = {{1,2,3,4,5,6},{7,8,9,10,11,12}}; /* array */
- double *dbuf=NULL;
+ double dbuf[6] = {1,2,3,4,5,6};
fid = H5Fcreate(FILE55, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ sid = H5Screate_simple(1, dims, NULL);
/*-------------------------------------------------------------------------
* integer
*-------------------------------------------------------------------------
*/
- sid = H5Screate_simple(1, dims, NULL);
did = H5Dcreate(fid, "integer", H5T_NATIVE_INT, sid, H5P_DEFAULT);
H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf);
H5Dclose(did);
- H5Sclose(sid);
/*-------------------------------------------------------------------------
* float
*-------------------------------------------------------------------------
*/
- sid = H5Screate_simple(1, dims, NULL);
did = H5Dcreate(fid, "float", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT);
H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, fbuf);
H5Dclose(did);
- H5Sclose(sid);
-
-/*-------------------------------------------------------------------------
- * array
- *-------------------------------------------------------------------------
- */
- tid = H5Tarray_create(H5T_NATIVE_INT, 1, dims, NULL);
- sid = H5Screate_simple(1, dimarray, NULL);
- did = H5Dcreate(fid, "array", tid, sid, H5P_DEFAULT);
- H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, abuf);
- H5Dclose(did);
- H5Tclose(tid);
- H5Sclose(sid);
/*-------------------------------------------------------------------------
* double
*-------------------------------------------------------------------------
*/
- sid = H5Screate_simple(1, dimsl, NULL);
did = H5Dcreate(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT);
- dbuf=calloc(100000,sizeof(double));
- if (dbuf!=NULL)
- {
- H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf);
- free(dbuf);
- }
+ H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf);
H5Dclose(did);
- H5Sclose(sid);
+
/* close */
+ H5Sclose(sid);
H5Fclose(fid);
}
+
/*-------------------------------------------------------------------------
* Function: gen_bigdims
*
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index c73b333..a0a3aab 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -533,7 +533,6 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
if(bin_output)
{
do_bin_output(stream, nelmts, type, _mem);
- bin_output = 0;
} /* end if */
else
{
diff --git a/tools/testfiles/tbin4.ddl b/tools/testfiles/tbin4.ddl
index 89849e4..78a6cd2 100644
--- a/tools/testfiles/tbin4.ddl
+++ b/tools/testfiles/tbin4.ddl
@@ -1,7 +1,7 @@
HDF5 "tbinary.h5" {
DATASET "double" {
DATATYPE H5T_IEEE_F64LE
- DATASPACE SIMPLE { ( 100000 ) / ( 100000 ) }
+ DATASPACE SIMPLE { ( 6 ) / ( 6 ) }
DATA {
}
}
diff --git a/tools/testfiles/tbinary.h5 b/tools/testfiles/tbinary.h5
index 0e53c8a..67d9364 100644
--- a/tools/testfiles/tbinary.h5
+++ b/tools/testfiles/tbinary.h5
Binary files differ