summaryrefslogtreecommitdiffstats
path: root/tools/test/h5dump/h5dumpgentest.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test/h5dump/h5dumpgentest.c')
-rw-r--r--tools/test/h5dump/h5dumpgentest.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index c1058fb..9d14f4b 100644
--- a/tools/test/h5dump/h5dumpgentest.c
+++ b/tools/test/h5dump/h5dumpgentest.c
@@ -114,6 +114,7 @@
#define FILE84 "tudfilter.h5"
#define FILE85 "tgrpnullspace.h5"
#define FILE87 "tintsnodata.h5"
+#define FILE88 "tldouble_scalar.h5"
/*-------------------------------------------------------------------------
* prototypes
@@ -6296,6 +6297,57 @@ error:
}
/*-------------------------------------------------------------------------
+ * Function: gent_ldouble_scalar
+ *
+ * Purpose: make file with a long double scalar dataset
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+gent_ldouble_scalar(void)
+{
+ hid_t fid;
+ hid_t did;
+ hid_t tid;
+ hid_t sid;
+ hsize_t dims[1] = {6};
+ long double buf[6] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
+
+ if ((fid = H5Fcreate(FILE88, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ if ((sid = H5Screate(H5S_SCALAR)) < 0)
+ goto error;
+
+ if ((tid = H5Tarray_create2(H5T_NATIVE_LDOUBLE, 1, dims)) < 0)
+ goto error;
+
+ if (H5Tget_size(tid) == 0)
+ goto error;
+
+ if ((did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ goto error;
+
+ if (H5Sclose(sid) < 0)
+ goto error;
+ if (H5Tclose(tid) < 0)
+ goto error;
+ if (H5Dclose(did) < 0)
+ goto error;
+ if (H5Fclose(fid) < 0)
+ goto error;
+
+ return 0;
+
+error:
+ HDprintf("error !\n");
+ return -1;
+}
+
+/*-------------------------------------------------------------------------
* Function: gent_binary
*
* Purpose: Generate a file to be used in the binary output test