summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dumptst.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2002-02-27 21:52:19 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2002-02-27 21:52:19 (GMT)
commit78e3463dbb62dcc18ebab71eaa7ec675aa9d3cae (patch)
tree7358d2e41412b3720cfbd96706010f84bbd85643 /tools/h5dump/h5dumptst.c
parentf6ecbd18b046ddbb504b7365d8b5f1a9eeb0f9a4 (diff)
downloadhdf5-78e3463dbb62dcc18ebab71eaa7ec675aa9d3cae.zip
hdf5-78e3463dbb62dcc18ebab71eaa7ec675aa9d3cae.tar.gz
hdf5-78e3463dbb62dcc18ebab71eaa7ec675aa9d3cae.tar.bz2
[svn-r5023] Purpose:
Bug Fix Description: There was a problem with having a lot of groups nested together. We could only handle 1024 characters at most, but, in a parallel program especially, it could occur that there were lots and lots of groups and would be more than 1024. Solution: I made the "objname" part of the obj_t structure a pointer instead of a fixed size. Added code to allocate/deallocate the memory we need for it. Had to fix how the "prefix" was being handled in the h5dump program. It was also set to only 1024 characters in length. I made it dynamic. Added a test case...Go me! Platforms tested: Linux, Solaris
Diffstat (limited to 'tools/h5dump/h5dumptst.c')
-rw-r--r--tools/h5dump/h5dumptst.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/h5dump/h5dumptst.c b/tools/h5dump/h5dumptst.c
index d26c4b8..0fb523b 100644
--- a/tools/h5dump/h5dumptst.c
+++ b/tools/h5dump/h5dumptst.c
@@ -55,6 +55,7 @@
#define FILE34 "tsplit_file"
#define FILE35 "tfamily%05d.h5"
#define FILE36 "tmulti"
+#define FILE37 "tlarge_objname.h5"
#define LENSTR 50
#define LENSTR2 11
@@ -2811,6 +2812,25 @@ void test_multi(void)
H5Pclose(fapl);
}
+static void test_large_objname(void)
+{
+ hid_t fid, group;
+ char grp_name[128];
+ register int i;
+
+ fid = H5Fcreate(FILE37, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+
+ group = H5Gcreate(fid, "this_is_a_large_group_name", 0);
+
+ for (i = 0; i < 50; ++i) {
+ sprintf(grp_name, "this_is_a_large_group_name%d", i);
+ group = H5Gcreate(group, grp_name, 0);
+ }
+
+ H5Gclose(group);
+ H5Fclose(fid);
+}
+
int main(void)
{
test_group();
@@ -2860,5 +2880,7 @@ int main(void)
test_family();
test_multi();
+ test_large_objname();
+
return 0;
}