summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dumptst.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2002-01-05 16:33:50 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2002-01-05 16:33:50 (GMT)
commit3c6be60da7927d3f5dd2486dc193cabe98f08276 (patch)
tree9a8850a518e66db6cf6411eba0247bfc51d1247f /tools/h5dump/h5dumptst.c
parentcb7800feee85ec1dc62ceeb9ed1f8ac59a526c16 (diff)
downloadhdf5-3c6be60da7927d3f5dd2486dc193cabe98f08276.zip
hdf5-3c6be60da7927d3f5dd2486dc193cabe98f08276.tar.gz
hdf5-3c6be60da7927d3f5dd2486dc193cabe98f08276.tar.bz2
[svn-r4782]
Purpose: Feature Add Description: Added support for dumping Group Comments. This involved a modification of the DDL as well. Solution: Steal code from h5ls and put it in the h5dump. The ddl.html file was updated as normal. And a test was created... Platforms tested: Dangermouse, Modi4, Kelgia
Diffstat (limited to 'tools/h5dump/h5dumptst.c')
-rw-r--r--tools/h5dump/h5dumptst.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/tools/h5dump/h5dumptst.c b/tools/h5dump/h5dumptst.c
index 3654ba0..ac08c2f 100644
--- a/tools/h5dump/h5dumptst.c
+++ b/tools/h5dump/h5dumptst.c
@@ -44,6 +44,7 @@
#define FILE30 "tarray6.h5"
#define FILE31 "tarray7.h5"
#define FILE32 "tempty.h5"
+#define FILE33 "tgrp_comments.h5"
#define LENSTR 50
#define LENSTR2 11
@@ -2614,6 +2615,64 @@ static void test_empty(void)
assert(ret>=0);
}
+static void test_group_comments(void)
+{
+ hid_t fid, group;
+
+ fid = H5Fcreate(FILE33, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+
+ /* / */
+ group = H5Gcreate (fid, "/g1", 0);
+ H5Gset_comment(group, "/g1", "Comment for group /g1");
+ H5Gclose(group);
+ group = H5Gcreate (fid, "/g2", 0);
+ H5Gset_comment(group, "/g2", "Comment for group /g2");
+ H5Gclose(group);
+ group = H5Gcreate (fid, "/g3", 0);
+ H5Gset_comment(group, "/g3", "Comment for group /g3");
+ H5Gclose(group);
+
+ /* /g1 */
+ group = H5Gcreate (fid, "/g1/g1.1", 0);
+ H5Gset_comment(group, "/g1/g1.1", "Comment for group /g1/g1.1");
+ H5Gclose(group);
+ group = H5Gcreate (fid, "/g1/g1.2", 0);
+ H5Gset_comment(group, "/g1/g1.2", "Comment for group /g1/g1.2");
+ H5Gclose(group);
+
+ /* /g2 */
+ group = H5Gcreate (fid, "/g2/g2.1", 0);
+ H5Gset_comment(group, "/g2/g2.1", "Comment for group /g2/g2.1");
+ H5Gclose(group);
+
+ /* /g3 */
+ group = H5Gcreate (fid, "/g3/g3.1", 0);
+ H5Gset_comment(group, "/g3/g3.1", "Comment for group /g3/g3.1");
+ H5Gclose(group);
+ group = H5Gcreate (fid, "/g3/g3.2", 0);
+ H5Gset_comment(group, "/g3/g3.2", "Comment for group /g3/g3.2");
+ H5Gclose(group);
+ group = H5Gcreate (fid, "/g3/g3.3", 0);
+ H5Gset_comment(group, "/g3/g3.3", "Comment for group /g3/g3.3");
+ H5Gclose(group);
+ group = H5Gcreate (fid, "/g3/g3.4", 0);
+ H5Gset_comment(group, "/g3/g3.4", "Comment for group /g3/g3.4");
+ H5Gclose(group);
+
+ /* /g2/g2.1 */
+ group = H5Gcreate (fid, "/g2/g2.1/g2.1.1", 0);
+ H5Gset_comment(group, "/g2/g2.1/g2.1.1", "Comment for group /g2/g2.1/g2.1.1");
+ H5Gclose(group);
+ group = H5Gcreate (fid, "/g2/g2.1/g2.1.2", 0);
+ H5Gset_comment(group, "/g2/g2.1/g2.1.2", "Comment for group /g2/g2.1/g2.1.2");
+ H5Gclose(group);
+ group = H5Gcreate (fid, "/g2/g2.1/g2.1.3", 0);
+ H5Gset_comment(group, "/g2/g2.1/g2.1.3", "Comment for group /g2/g2.1/g2.1.3");
+ H5Gclose(group);
+
+ H5Fclose(fid);
+}
+
int main(void)
{
test_group();
@@ -2658,6 +2717,7 @@ int main(void)
test_array7();
test_empty();
+ test_group_comments();
return 0;
}