summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRuey-Hsia Li <rli@ncsa.uiuc.edu>1998-09-28 15:12:14 (GMT)
committerRuey-Hsia Li <rli@ncsa.uiuc.edu>1998-09-28 15:12:14 (GMT)
commitaf405e8a6f2eadf3dc53d5bd99d593d0f7393c1f (patch)
tree0d44d710dce55c36615d97a18bdad61513b6c656 /tools
parent1b13f305ad4a5a18262c797cf9e05511904cfe73 (diff)
downloadhdf5-af405e8a6f2eadf3dc53d5bd99d593d0f7393c1f.zip
hdf5-af405e8a6f2eadf3dc53d5bd99d593d0f7393c1f.tar.gz
hdf5-af405e8a6f2eadf3dc53d5bd99d593d0f7393c1f.tar.bz2
[svn-r728] Added tests and expected optput for dumper options.
Diffstat (limited to 'tools')
-rw-r--r--tools/testfiles/h5dumptst.c94
-rw-r--r--tools/testfiles/tall-1.ddl60
-rw-r--r--tools/testfiles/tall-2.ddl27
-rw-r--r--tools/testfiles/tall-3.ddl13
-rw-r--r--tools/testfiles/tall.h5bin7836 -> 7836 bytes
-rw-r--r--tools/testfiles/tattr-1.ddl22
-rw-r--r--tools/testfiles/tattr-3.ddl9
-rw-r--r--tools/testfiles/tattr-4.ddl8
-rw-r--r--tools/testfiles/tdset-1.ddl17
-rw-r--r--tools/testfiles/tdset-2.ddl15
-rw-r--r--tools/testfiles/tdset-3.ddl9
-rw-r--r--tools/testfiles/tdset-4.ddl8
-rw-r--r--tools/testfiles/tdset.h5bin4672 -> 4672 bytes
-rw-r--r--tools/testfiles/tgroup-1.ddl33
-rw-r--r--tools/testfiles/tgroup-2.ddl33
-rw-r--r--tools/testfiles/tgroup-3.ddl18
-rw-r--r--tools/testfiles/tslink-1.ddl13
-rw-r--r--tools/testfiles/tslink-2.ddl8
18 files changed, 360 insertions, 27 deletions
diff --git a/tools/testfiles/h5dumptst.c b/tools/testfiles/h5dumptst.c
index 113cccc..239742a 100644
--- a/tools/testfiles/h5dumptst.c
+++ b/tools/testfiles/h5dumptst.c
@@ -1,16 +1,16 @@
/*
* Generate the binary hdf5 files for the h5dump tests.
*/
-
#include "hdf5.h"
#define FILE1 "tgroup.h5"
#define FILE2 "tdset.h5"
#define FILE3 "tattr.h5"
#define FILE4 "tslink.h5"
-#define FILE5 "tall.h5"
+#define FILE5 "thlink.h5"
+#define FILE6 "tall.h5"
-static void test_group() {
+static void test_group(void) {
hid_t fid, group;
fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -54,7 +54,7 @@ hid_t fid, group;
H5Fclose(fid);
}
-static void test_dataset() {
+static void test_dataset(void) {
hid_t fid, dataset, space;
hsize_t dims[2];
int dset1[10][20];
@@ -69,22 +69,22 @@ int i, j;
/* dset1 */
dims[0] = 10; dims[1] = 20;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(fid, "/dset1", H5T_NATIVE_INT, space, H5P_DEFAULT);
+ dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT);
for (i = 0; i < 10; i++)
for (j = 0; j < 20; j++)
dset1[i][j] = j;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
+ H5Dwrite(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
H5Sclose(space);
H5Dclose(dataset);
/* dset2 */
dims[0] = 30; dims[1] = 10;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(fid, "/dset2", H5T_NATIVE_DOUBLE, space, H5P_DEFAULT);
+ dataset = H5Dcreate(fid, "/dset2", H5T_IEEE_F64BE, space, H5P_DEFAULT);
for (i = 0; i < 30; i++)
for (j = 0; j < 10; j++)
dset2[i][j] = j*1.1 + i;
- H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
+ H5Dwrite(dataset, H5T_IEEE_F64BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
H5Sclose(space);
H5Dclose(dataset);
@@ -97,7 +97,7 @@ static void test_nameddt() {
}
*/
-static void test_attribute() {
+static void test_attribute(void) {
hid_t fid, root, space, attr;
hsize_t dims[2];
char buf[60];
@@ -121,18 +121,18 @@ double d[10];
/* attribute 2 */
dims[0] = 20;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (root, "attr2", H5T_NATIVE_INT, space, H5P_DEFAULT);
+ attr = H5Acreate (root, "attr2", H5T_STD_I32BE, space, H5P_DEFAULT);
for (i = 0; i < 20; i++) data[i] = i+1;
- H5Awrite(attr, H5T_NATIVE_INT, data);
+ H5Awrite(attr, H5T_STD_I32BE, data);
H5Sclose(space);
H5Aclose(attr);
/* attribute 3 */
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate (root, "attr3", H5T_NATIVE_DOUBLE, space, H5P_DEFAULT);
+ attr = H5Acreate (root, "attr3", H5T_IEEE_F64BE, space, H5P_DEFAULT);
for (i = 0; i < 10; i++) d[i] = 0.0001 * i+ 0.0001;
- H5Awrite(attr, H5T_NATIVE_DOUBLE, d);
+ H5Awrite(attr, H5T_IEEE_F64BE, d);
H5Sclose(space);
H5Aclose(attr);
@@ -141,7 +141,7 @@ double d[10];
H5Fclose(fid);
}
-static void test_softlink() {
+static void test_softlink(void) {
hid_t fid, root;
herr_t status;
@@ -159,6 +159,44 @@ herr_t status;
}
+/*
+ /
+ / | \
+ g1 g2 dset
+
+ / \ |
+ link1 link2 link3
+(g2) (dset) (dset) */
+
+static void test_hardlink(void) {
+hid_t fid, group, dataset, space;
+hsize_t dim;
+int i, dset[5];
+
+ fid = H5Fcreate(FILE5, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+
+ dim = 5;
+ space = H5Screate_simple(1, &dim, NULL);
+ dataset = H5Dcreate(fid, "/dset", H5T_STD_I32BE, space, H5P_DEFAULT);
+ for (i = 0; i < 5; i++) dset[i] = i;
+ H5Dwrite(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset);
+ H5Sclose(space);
+ H5Dclose(dataset);
+
+ group = H5Gcreate (fid, "/g1", 0);
+ H5Glink (group, H5G_LINK_HARD, "/dset", "link2");
+ H5Gclose(group);
+
+ group = H5Gcreate (fid, "/g2", 0);
+ H5Glink (group, H5G_LINK_HARD, "/dset", "link3");
+ H5Gclose(group);
+
+ group = H5Gopen(fid, "/g1");
+ H5Glink (group, H5G_LINK_HARD, "/g2", "link1");
+ H5Gclose(group);
+
+ H5Fclose(fid);
+}
/*
@@ -171,7 +209,7 @@ g2 : dset2.1 dset2.2
*/
-static void test_all() {
+static void test_all(void) {
hid_t fid, group, attr, dataset, space;
hsize_t dims[2];
int data[2][2], dset1[10][10], dset2[20];
@@ -179,7 +217,7 @@ char buf[60];
int i, j;
float dset2_1[10], dset2_2[3][5];
- fid = H5Fcreate(FILE5, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(FILE6, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* create groups */
group = H5Gcreate (fid, "/g1", 0);
@@ -210,9 +248,9 @@ float dset2_1[10], dset2_2[3][5];
dims[0] = 2; dims[1] = 2;
space = H5Screate_simple(2, dims, NULL);
- attr = H5Acreate (group, "attr2", H5T_NATIVE_INT, space, H5P_DEFAULT);
+ attr = H5Acreate (group, "attr2", H5T_STD_I32BE, space, H5P_DEFAULT);
data[0][0] = 0; data[0][1] = 1; data[1][0] = 2; data[1][1] = 3;
- H5Awrite(attr, H5T_NATIVE_INT, data);
+ H5Awrite(attr, H5T_STD_I32BE, data);
H5Sclose(space);
H5Aclose(attr);
@@ -223,11 +261,11 @@ float dset2_1[10], dset2_2[3][5];
/* dset1.1.1 */
dims[0] = 10; dims[1] = 10;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(group, "dset1.1.1", H5T_NATIVE_INT, space, H5P_DEFAULT);
+ dataset = H5Dcreate(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT);
for (i = 0; i < 10; i++)
for (j = 0; j < 10; j++)
dset1[i][j] = j;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
+ H5Dwrite(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
H5Sclose(space);
/* attributes of dset1.1.1 */
@@ -252,10 +290,10 @@ float dset2_1[10], dset2_2[3][5];
/* dset1.1.2 */
dims[0] = 20;
space = H5Screate_simple(1, dims, NULL);
- dataset = H5Dcreate(group, "dset1.1.2", H5T_NATIVE_INT, space, H5P_DEFAULT);
+ dataset = H5Dcreate(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT);
for (i = 0; i < 20; i++)
dset2[i] = i;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
+ H5Dwrite(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
H5Sclose(space);
H5Dclose(dataset);
@@ -271,21 +309,21 @@ float dset2_1[10], dset2_2[3][5];
/* dset2.1 */
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
- dataset = H5Dcreate(group, "dset2.1", H5T_NATIVE_FLOAT, space, H5P_DEFAULT);
+ dataset = H5Dcreate(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT);
for (i = 0; i < 10; i++)
dset2_1[i] = i*0.1+1;
- H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1);
+ H5Dwrite(dataset, H5T_IEEE_F32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1);
H5Sclose(space);
H5Dclose(dataset);
/* dset2.2 */
dims[0] = 3; dims[1] = 5;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(group, "dset2.2", H5T_NATIVE_FLOAT, space, H5P_DEFAULT);
+ dataset = H5Dcreate(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT);
for (i = 0; i < 3; i++)
for (j = 0; j < 5; j++)
dset2_2[i][j] = i*0.1;
- H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2);
+ H5Dwrite(dataset, H5T_IEEE_F32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2);
H5Sclose(space);
H5Dclose(dataset);
@@ -296,13 +334,15 @@ float dset2_1[10], dset2_2[3][5];
}
-void main(){
+int main(void){
test_group();
test_attribute();
test_softlink();
test_dataset();
+test_hardlink();
test_all();
+return 0;
}
diff --git a/tools/testfiles/tall-1.ddl b/tools/testfiles/tall-1.ddl
new file mode 100644
index 0000000..8cda1e3
--- /dev/null
+++ b/tools/testfiles/tall-1.ddl
@@ -0,0 +1,60 @@
+#############################
+Expected output for '../h5dump tall.h5'
+#############################
+HDF5 "tall.h5" {
+GROUP "/" {
+ ATTRIBUTE "attr1" {
+ DATATYPE { "H5T_STD_I8LE" }
+ DATASPACE { ARRAY ( 10 ) ( 10 ) }
+ DATA {"abcdefghi\000"}
+ }
+ ATTRIBUTE "attr2" {
+ DATATYPE { "H5T_STD_I32BE" }
+ DATASPACE { ARRAY ( 2, 2 ) ( 2, 2 ) }
+ DATA {0,1,2,3}
+ }
+ GROUP "g1" {
+ GROUP "g1.1" {
+ DATASET "dset1.1.1" {
+ DATATYPE { "H5T_STD_I32BE" }
+ DATASPACE { ARRAY ( 10, 10 ) ( 10, 10 ) }
+ DATA {0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9}
+ ATTRIBUTE "attr1" {
+ DATATYPE { "H5T_STD_I8LE" }
+ DATASPACE { ARRAY ( 27 ) ( 27 ) }
+ DATA {"1st attribute of dset1.1.1\000"}
+ }
+ ATTRIBUTE "attr2" {
+ DATATYPE { "H5T_STD_I8LE" }
+ DATASPACE { ARRAY ( 27 ) ( 27 ) }
+ DATA {"2nd attribute of dset1.1.1\000"}
+ }
+ }
+ DATASET "dset1.1.2" {
+ DATATYPE { "H5T_STD_I32BE" }
+ DATASPACE { ARRAY ( 20 ) ( 20 ) }
+ DATA {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}
+ }
+ }
+ GROUP "g1.2" {
+ GROUP "g1.2.1" {
+ SOFTLINK "slink" {
+ linktarget "../somevalue/."
+ }
+ }
+ }
+ }
+ GROUP "g2" {
+ DATASET "dset2.1" {
+ DATATYPE { "H5T_IEEE_F32BE" }
+ DATASPACE { ARRAY ( 10 ) ( 10 ) }
+ DATA {1,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9}
+ }
+ DATASET "dset2.2" {
+ DATATYPE { "H5T_IEEE_F32BE" }
+ DATASPACE { ARRAY ( 3, 5 ) ( 3, 5 ) }
+ DATA {0,0,0,0,0,0.1,0.1,0.1,0.1,0.1,0.2,0.2,0.2,0.2,0.2}
+ }
+ }
+}
+}
diff --git a/tools/testfiles/tall-2.ddl b/tools/testfiles/tall-2.ddl
new file mode 100644
index 0000000..c23ae58
--- /dev/null
+++ b/tools/testfiles/tall-2.ddl
@@ -0,0 +1,27 @@
+#############################
+Expected output for '../h5dump -header -g /g1/g1.1 -a attr2 tall.h5'
+#############################
+HDF5 "tall.h5" {
+GROUP "/g1/g1.1" {
+ DATASET "dset1.1.1" {
+ DATATYPE { "H5T_STD_I32BE" }
+ DATASPACE { ARRAY ( 10, 10 ) ( 10, 10 ) }
+ ATTRIBUTE "attr1" {
+ DATATYPE { "H5T_STD_I8LE" }
+ DATASPACE { ARRAY ( 27 ) ( 27 ) }
+ }
+ ATTRIBUTE "attr2" {
+ DATATYPE { "H5T_STD_I8LE" }
+ DATASPACE { ARRAY ( 27 ) ( 27 ) }
+ }
+ }
+ DATASET "dset1.1.2" {
+ DATATYPE { "H5T_STD_I32BE" }
+ DATASPACE { ARRAY ( 20 ) ( 20 ) }
+ }
+}
+ATTRIBUTE "attr2" {
+ DATATYPE { "H5T_STD_I32BE" }
+ DATASPACE { ARRAY ( 2, 2 ) ( 2, 2 ) }
+}
+}
diff --git a/tools/testfiles/tall-3.ddl b/tools/testfiles/tall-3.ddl
new file mode 100644
index 0000000..5c5de6b
--- /dev/null
+++ b/tools/testfiles/tall-3.ddl
@@ -0,0 +1,13 @@
+#############################
+Expected output for '../h5dump -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5'
+#############################
+HDF5 "tall.h5" {
+DATASET "/g2/dset2.1" {
+ DATATYPE { "H5T_IEEE_F32BE" }
+ DATASPACE { ARRAY ( 10 ) ( 10 ) }
+ DATA {1,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9}
+}
+SOFTLINK "/g1/g1.2/g1.2.1/slink" {
+ linktarget "../somevalue/."
+}
+}
diff --git a/tools/testfiles/tall.h5 b/tools/testfiles/tall.h5
index bc6ca2c..6c3f04d 100644
--- a/tools/testfiles/tall.h5
+++ b/tools/testfiles/tall.h5
Binary files differ
diff --git a/tools/testfiles/tattr-1.ddl b/tools/testfiles/tattr-1.ddl
new file mode 100644
index 0000000..27d5aa8
--- /dev/null
+++ b/tools/testfiles/tattr-1.ddl
@@ -0,0 +1,22 @@
+#############################
+Expected output for '../h5dump tattr.h5'
+#############################
+HDF5 "tattr.h5" {
+GROUP "/" {
+ ATTRIBUTE "attr1" {
+ DATATYPE { "H5T_STD_I8LE" }
+ DATASPACE { ARRAY ( 24 ) ( 24 ) }
+ DATA {"attribute of root group\000"}
+ }
+ ATTRIBUTE "attr2" {
+ DATATYPE { "H5T_STD_I32BE" }
+ DATASPACE { ARRAY ( 20 ) ( 20 ) }
+ DATA {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}
+ }
+ ATTRIBUTE "attr3" {
+ DATATYPE { "H5T_IEEE_F64BE" }
+ DATASPACE { ARRAY ( 10 ) ( 10 ) }
+ DATA {0.0001,0.0002,0.0003,0.0004,0.0005,0.0006,0.0007,0.0008,0.0009,0.001}
+ }
+}
+}
diff --git a/tools/testfiles/tattr-3.ddl b/tools/testfiles/tattr-3.ddl
new file mode 100644
index 0000000..14c04cd
--- /dev/null
+++ b/tools/testfiles/tattr-3.ddl
@@ -0,0 +1,9 @@
+#############################
+Expected output for '../h5dump -header -a attr2 tattr.h5'
+#############################
+HDF5 "tattr.h5" {
+ATTRIBUTE "attr2" {
+ DATATYPE { "H5T_STD_I32BE" }
+ DATASPACE { ARRAY ( 20 ) ( 20 ) }
+}
+}
diff --git a/tools/testfiles/tattr-4.ddl b/tools/testfiles/tattr-4.ddl
new file mode 100644
index 0000000..3c5b849
--- /dev/null
+++ b/tools/testfiles/tattr-4.ddl
@@ -0,0 +1,8 @@
+#############################
+Expected output for '../h5dump -a attr4 tattr.h5'
+#############################
+HDF5 "tattr.h5" {
+ATTRIBUTE "attr4" {
+ h5dump error: unable to open attribute.
+}
+}
diff --git a/tools/testfiles/tdset-1.ddl b/tools/testfiles/tdset-1.ddl
new file mode 100644
index 0000000..aa56554
--- /dev/null
+++ b/tools/testfiles/tdset-1.ddl
@@ -0,0 +1,17 @@
+#############################
+Expected output for '../h5dump tdset.h5'
+#############################
+HDF5 "tdset.h5" {
+GROUP "/" {
+ DATASET "dset1" {
+ DATATYPE { "H5T_STD_I32BE" }
+ DATASPACE { ARRAY ( 10, 20 ) ( 10, 20 ) }
+ DATA {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}
+ }
+ DATASET "dset2" {
+ DATATYPE { "H5T_IEEE_F64BE" }
+ DATASPACE { ARRAY ( 30, 10 ) ( 30, 10 ) }
+ DATA {0,1.1,2.2,3.3,4.4,5.5,6.6,7.7,8.8,9.9,1,2.1,3.2,4.3,5.4,6.5,7.6,8.7,9.8,10.9,2,3.1,4.2,5.3,6.4,7.5,8.6,9.7,10.8,11.9,3,4.1,5.2,6.3,7.4,8.5,9.6,10.7,11.8,12.9,4,5.1,6.2,7.3,8.4,9.5,10.6,11.7,12.8,13.9,5,6.1,7.2,8.3,9.4,10.5,11.6,12.7,13.8,14.9,6,7.1,8.2,9.3,10.4,11.5,12.6,13.7,14.8,15.9,7,8.1,9.2,10.3,11.4,12.5,13.6,14.7,15.8,16.9,8,9.1,10.2,11.3,12.4,13.5,14.6,15.7,16.8,17.9,9,10.1,11.2,12.3,13.4,14.5,15.6,16.7,17.8,18.9,10,11.1,12.2,13.3,14.4,15.5,16.6,17.7,18.8,19.9,11,12.1,13.2,14.3,15.4,16.5,17.6,18.7,19.8,20.9,12,13.1,14.2,15.3,16.4,17.5,18.6,19.7,20.8,21.9,13,14.1,15.2,16.3,17.4,18.5,19.6,20.7,21.8,22.9,14,15.1,16.2,17.3,18.4,19.5,20.6,21.7,22.8,23.9,15,16.1,17.2,18.3,19.4,20.5,21.6,22.7,23.8,24.9,16,17.1,18.2,19.3,20.4,21.5,22.6,23.7,24.8,25.9,17,18.1,19.2,20.3,21.4,22.5,23.6,24.7,25.8,26.9,18,19.1,20.2,21.3,22.4,23.5,24.6,25.7,26.8,27.9,19,20.1,21.2,22.3,23.4,24.5,25.6,26.7,27.8,28.9,20,21.1,22.2,23.3,24.4,25.5,26.6,27.7,28.8,29.9,21,22.1,23.2,24.3,25.4,26.5,27.6,28.7,29.8,30.9,22,23.1,24.2,25.3,26.4,27.5,28.6,29.7,30.8,31.9,23,24.1,25.2,26.3,27.4,28.5,29.6,30.7,31.8,32.9,24,25.1,26.2,27.3,28.4,29.5,30.6,31.7,32.8,33.9,25,26.1,27.2,28.3,29.4,30.5,31.6,32.7,33.8,34.9,26,27.1,28.2,29.3,30.4,31.5,32.6,33.7,34.8,35.9,27,28.1,29.2,30.3,31.4,32.5,33.6,34.7,35.8,36.9,28,29.1,30.2,31.3,32.4,33.5,34.6,35.7,36.8,37.9,29,30.1,31.2,32.3,33.4,34.5,35.6,36.7,37.8,38.9}
+ }
+}
+}
diff --git a/tools/testfiles/tdset-2.ddl b/tools/testfiles/tdset-2.ddl
new file mode 100644
index 0000000..2ec760d
--- /dev/null
+++ b/tools/testfiles/tdset-2.ddl
@@ -0,0 +1,15 @@
+#############################
+Expected output for '../h5dump -d dset1 /dset2 tdset.h5'
+#############################
+HDF5 "tdset.h5" {
+DATASET "dset1" {
+ DATATYPE { "H5T_STD_I32BE" }
+ DATASPACE { ARRAY ( 10, 20 ) ( 10, 20 ) }
+ DATA {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}
+}
+DATASET "/dset2" {
+ DATATYPE { "H5T_IEEE_F64BE" }
+ DATASPACE { ARRAY ( 30, 10 ) ( 30, 10 ) }
+ DATA {0,1.1,2.2,3.3,4.4,5.5,6.6,7.7,8.8,9.9,1,2.1,3.2,4.3,5.4,6.5,7.6,8.7,9.8,10.9,2,3.1,4.2,5.3,6.4,7.5,8.6,9.7,10.8,11.9,3,4.1,5.2,6.3,7.4,8.5,9.6,10.7,11.8,12.9,4,5.1,6.2,7.3,8.4,9.5,10.6,11.7,12.8,13.9,5,6.1,7.2,8.3,9.4,10.5,11.6,12.7,13.8,14.9,6,7.1,8.2,9.3,10.4,11.5,12.6,13.7,14.8,15.9,7,8.1,9.2,10.3,11.4,12.5,13.6,14.7,15.8,16.9,8,9.1,10.2,11.3,12.4,13.5,14.6,15.7,16.8,17.9,9,10.1,11.2,12.3,13.4,14.5,15.6,16.7,17.8,18.9,10,11.1,12.2,13.3,14.4,15.5,16.6,17.7,18.8,19.9,11,12.1,13.2,14.3,15.4,16.5,17.6,18.7,19.8,20.9,12,13.1,14.2,15.3,16.4,17.5,18.6,19.7,20.8,21.9,13,14.1,15.2,16.3,17.4,18.5,19.6,20.7,21.8,22.9,14,15.1,16.2,17.3,18.4,19.5,20.6,21.7,22.8,23.9,15,16.1,17.2,18.3,19.4,20.5,21.6,22.7,23.8,24.9,16,17.1,18.2,19.3,20.4,21.5,22.6,23.7,24.8,25.9,17,18.1,19.2,20.3,21.4,22.5,23.6,24.7,25.8,26.9,18,19.1,20.2,21.3,22.4,23.5,24.6,25.7,26.8,27.9,19,20.1,21.2,22.3,23.4,24.5,25.6,26.7,27.8,28.9,20,21.1,22.2,23.3,24.4,25.5,26.6,27.7,28.8,29.9,21,22.1,23.2,24.3,25.4,26.5,27.6,28.7,29.8,30.9,22,23.1,24.2,25.3,26.4,27.5,28.6,29.7,30.8,31.9,23,24.1,25.2,26.3,27.4,28.5,29.6,30.7,31.8,32.9,24,25.1,26.2,27.3,28.4,29.5,30.6,31.7,32.8,33.9,25,26.1,27.2,28.3,29.4,30.5,31.6,32.7,33.8,34.9,26,27.1,28.2,29.3,30.4,31.5,32.6,33.7,34.8,35.9,27,28.1,29.2,30.3,31.4,32.5,33.6,34.7,35.8,36.9,28,29.1,30.2,31.3,32.4,33.5,34.6,35.7,36.8,37.9,29,30.1,31.2,32.3,33.4,34.5,35.6,36.7,37.8,38.9}
+}
+}
diff --git a/tools/testfiles/tdset-3.ddl b/tools/testfiles/tdset-3.ddl
new file mode 100644
index 0000000..7b6e802
--- /dev/null
+++ b/tools/testfiles/tdset-3.ddl
@@ -0,0 +1,9 @@
+#############################
+Expected output for '../h5dump -d /dset1 -header tdset.h5'
+#############################
+HDF5 "tdset.h5" {
+DATASET "/dset1" {
+ DATATYPE { "H5T_STD_I32BE" }
+ DATASPACE { ARRAY ( 10, 20 ) ( 10, 20 ) }
+}
+}
diff --git a/tools/testfiles/tdset-4.ddl b/tools/testfiles/tdset-4.ddl
new file mode 100644
index 0000000..8e2ec9e
--- /dev/null
+++ b/tools/testfiles/tdset-4.ddl
@@ -0,0 +1,8 @@
+#############################
+Expected output for '../h5dump -d dset3 tdset.h5'
+#############################
+HDF5 "tdset.h5" {
+DATASET "dset3" {
+ h5dump error: unable to open dset3
+}
+}
diff --git a/tools/testfiles/tdset.h5 b/tools/testfiles/tdset.h5
index e8edcb8..7cac56d 100644
--- a/tools/testfiles/tdset.h5
+++ b/tools/testfiles/tdset.h5
Binary files differ
diff --git a/tools/testfiles/tgroup-1.ddl b/tools/testfiles/tgroup-1.ddl
new file mode 100644
index 0000000..a671b8e
--- /dev/null
+++ b/tools/testfiles/tgroup-1.ddl
@@ -0,0 +1,33 @@
+#############################
+Expected output for '../h5dump tgroup.h5'
+#############################
+HDF5 "tgroup.h5" {
+GROUP "/" {
+ GROUP "g1" {
+ GROUP "g1.1" {
+ }
+ GROUP "g1.2" {
+ }
+ }
+ GROUP "g2" {
+ GROUP "g2.1" {
+ GROUP "g2.1.1" {
+ }
+ GROUP "g2.1.2" {
+ }
+ GROUP "g2.1.3" {
+ }
+ }
+ }
+ GROUP "g3" {
+ GROUP "g3.1" {
+ }
+ GROUP "g3.2" {
+ }
+ GROUP "g3.3" {
+ }
+ GROUP "g3.4" {
+ }
+ }
+}
+}
diff --git a/tools/testfiles/tgroup-2.ddl b/tools/testfiles/tgroup-2.ddl
new file mode 100644
index 0000000..cec0783
--- /dev/null
+++ b/tools/testfiles/tgroup-2.ddl
@@ -0,0 +1,33 @@
+#############################
+Expected output for '../h5dump -g / tgroup.h5'
+#############################
+HDF5 "tgroup.h5" {
+GROUP "/" {
+ GROUP "g1" {
+ GROUP "g1.1" {
+ }
+ GROUP "g1.2" {
+ }
+ }
+ GROUP "g2" {
+ GROUP "g2.1" {
+ GROUP "g2.1.1" {
+ }
+ GROUP "g2.1.2" {
+ }
+ GROUP "g2.1.3" {
+ }
+ }
+ }
+ GROUP "g3" {
+ GROUP "g3.1" {
+ }
+ GROUP "g3.2" {
+ }
+ GROUP "g3.3" {
+ }
+ GROUP "g3.4" {
+ }
+ }
+}
+}
diff --git a/tools/testfiles/tgroup-3.ddl b/tools/testfiles/tgroup-3.ddl
new file mode 100644
index 0000000..a133268
--- /dev/null
+++ b/tools/testfiles/tgroup-3.ddl
@@ -0,0 +1,18 @@
+#############################
+Expected output for '../h5dump -g /g2 /y tgroup.h5'
+#############################
+HDF5 "tgroup.h5" {
+GROUP "/g2" {
+ GROUP "g2.1" {
+ GROUP "g2.1.1" {
+ }
+ GROUP "g2.1.2" {
+ }
+ GROUP "g2.1.3" {
+ }
+ }
+}
+GROUP "/y" {
+ h5dump error: unable to open /y
+}
+}
diff --git a/tools/testfiles/tslink-1.ddl b/tools/testfiles/tslink-1.ddl
new file mode 100644
index 0000000..0a1a468
--- /dev/null
+++ b/tools/testfiles/tslink-1.ddl
@@ -0,0 +1,13 @@
+#############################
+Expected output for '../h5dump tslink.h5'
+#############################
+HDF5 "tslink.h5" {
+GROUP "/" {
+ SOFTLINK "slink1" {
+ linktarget "../../somevalue"
+ }
+ SOFTLINK "slink2" {
+ linktarget "linkvalue"
+ }
+}
+}
diff --git a/tools/testfiles/tslink-2.ddl b/tools/testfiles/tslink-2.ddl
new file mode 100644
index 0000000..310f8d2
--- /dev/null
+++ b/tools/testfiles/tslink-2.ddl
@@ -0,0 +1,8 @@
+#############################
+Expected output for '../h5dump -l slink2 tslink.h5'
+#############################
+HDF5 "tslink.h5" {
+SOFTLINK "slink2" {
+ linktarget "linkvalue"
+}
+}