summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dumpgentest.c
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2008-04-30 19:23:26 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2008-04-30 19:23:26 (GMT)
commit5773fd34bc5adf59b4530d95ac9f0c0585902803 (patch)
tree456ad239799382e1f083fb7fc74399e43b471912 /tools/h5dump/h5dumpgentest.c
parent0138995d1ce2068db1f790503435a2121132d3ad (diff)
downloadhdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.zip
hdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.tar.gz
hdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.tar.bz2
[svn-r14902] Merged fortran_1_8 branch changes r14505:14901 into the trunk. New fortran wrappers added.
Diffstat (limited to 'tools/h5dump/h5dumpgentest.c')
-rw-r--r--tools/h5dump/h5dumpgentest.c38
1 files changed, 30 insertions, 8 deletions
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 4070425..b21a020 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -5542,7 +5542,8 @@ error:
* Contains:
* 1) an integer dataset
* 2) a float dataset
- * 4) a double dataset
+ * 3) an array dataset
+ * 4) a large double dataset
*
*-------------------------------------------------------------------------
*/
@@ -5550,43 +5551,64 @@ static void
gent_binary(void)
{
hid_t fid, sid, did, tid;
- hsize_t dims[1] = {6};
+ hsize_t dims[1] = {6};
+ hsize_t dimarray[1] = {2};
+ hsize_t dimsl[1] = {100000};
int ibuf[6] = {1,2,3,4,5,6};
float fbuf[6] = {1,2,3,4,5,6};
- double dbuf[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;
fid = H5Fcreate(FILE55, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- sid = H5Screate_simple(1, dims, NULL);
/*-------------------------------------------------------------------------
* integer
*-------------------------------------------------------------------------
*/
-
+ sid = H5Screate_simple(1, dims, NULL);
did = H5Dcreate2(fid, "integer", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, 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 = H5Dcreate2(fid, "float", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, fbuf);
H5Dclose(did);
+ H5Sclose(sid);
+
+/*-------------------------------------------------------------------------
+ * array
+ *-------------------------------------------------------------------------
+ */
+ tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dims);
+ sid = H5Screate_simple(1, dimarray, NULL);
+ did = H5Dcreate2(fid, "array", tid, sid, H5P_DEFAULT, H5P_DEFAULT, 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 = H5Dcreate2(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf);
+ dbuf = calloc(100000, sizeof(double));
+ if(dbuf != NULL) {
+ H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf);
+ free(dbuf);
+ }
H5Dclose(did);
-
+ H5Sclose(sid);
/* close */
- H5Sclose(sid);
H5Fclose(fid);
}