summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dumpgentest.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2006-03-28 21:25:10 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2006-03-28 21:25:10 (GMT)
commitcd25a7690abbd3665996dc7657b13101ba032c79 (patch)
treef6f9e860bb7e86d7d496875f87af9fff58f667aa /tools/h5dump/h5dumpgentest.c
parent194d3dfe522c2b6612586829d47e830ad5c7ef0c (diff)
downloadhdf5-cd25a7690abbd3665996dc7657b13101ba032c79.zip
hdf5-cd25a7690abbd3665996dc7657b13101ba032c79.tar.gz
hdf5-cd25a7690abbd3665996dc7657b13101ba032c79.tar.bz2
[svn-r12171] Purpose:
bug fixes Description: h5dump/h5ls were not displaying long doubles correctly Solution: 1) the print datatype functions were incorrectly testing for the valid return value from H5Tequal, (TRUE), causing the display of an incorrect name of a dataype in error cases from H5Tequal 2) h5tools_print_str did not have a case for native long double 3) added a file generator for a long double dataset 4) added one script test for the long double data (commented , some sytems don't have a native long double match, and the output differs) 5) added a vms file and h5dump script test Platforms tested: linux 32, 64 solaris AIX Misc. update:
Diffstat (limited to 'tools/h5dump/h5dumpgentest.c')
-rw-r--r--tools/h5dump/h5dumpgentest.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 20ab958..e7bf7a7 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -78,6 +78,8 @@
#define FILE49 "tstr3.h5"
#define FILE50 "taindices.h5"
#define FILE51 "tlonglinks.h5"
+#define FILE52 "tldouble.h5"
+
@@ -5415,6 +5417,59 @@ static void gent_longlinks(void)
}
+
+/*-------------------------------------------------------------------------
+ * Function: gent_ldouble
+ *
+ * Purpose: make file with a long double dataset
+ *
+ *-------------------------------------------------------------------------
+ */
+static int gent_ldouble(void)
+{
+ hid_t fid;
+ hid_t did;
+ hid_t tid;
+ hid_t sid;
+ size_t size;
+ hsize_t dims[1] = {3};
+ long double buf[3] = {1,2,3};
+
+ if ((fid = H5Fcreate(FILE52, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0)
+ goto error;
+
+ if ((sid = H5Screate_simple(1, dims, NULL))<0)
+ goto error;
+
+ if ((tid = H5Tcopy(H5T_NATIVE_LDOUBLE))<0)
+ goto error;
+
+ if ((size = H5Tget_size(tid))<0)
+ goto error;
+
+ if ((did = H5Dcreate(fid, "dset", tid, sid, 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:
+ printf("error !\n");
+ return -1;
+
+}
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -5474,6 +5529,7 @@ int main(void)
gent_string();
gent_aindices();
gent_longlinks();
+ gent_ldouble();
return 0;
}