summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-08-22 13:54:08 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-08-22 13:54:08 (GMT)
commit42b1d300a5ae1339c2efaa70faedd32b51c89e10 (patch)
tree15e1f404019f984ab9adb8a69e3d13001b5cb1a0 /test
parentbbb546d4de40a2c821be9cf5d699ab9ed7c9d0e2 (diff)
downloadhdf5-42b1d300a5ae1339c2efaa70faedd32b51c89e10.zip
hdf5-42b1d300a5ae1339c2efaa70faedd32b51c89e10.tar.gz
hdf5-42b1d300a5ae1339c2efaa70faedd32b51c89e10.tar.bz2
[svn-r7392] Purpose:
Bug fix Description: H5Gget_num_objs, H5Gget_objname_by_idx and H5Gget_objtype_by_idx were only accepting a group ID, instead of a location ID, as our documentation for them stated. Solution: Allow them to accept a location ID. Platforms tested: FreeBSD 4.8 (sleipnir) h5committest
Diffstat (limited to 'test')
-rw-r--r--test/titerate.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/titerate.c b/test/titerate.c
index a64bfbb..0c9ca5d 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -213,6 +213,31 @@ static void test_iter_group(void)
CHECK(ret, FAIL, "H5Gclose");
}
+ /* These two functions, H5Gget_num_objs and H5Gget_objname_by_idx, actually
+ * iterate through B-tree for group members in internal library design.
+ * (Same as test above, but with the file ID instead of opening the root group)
+ */
+ {
+ ret = H5Gget_num_objs(file, &num_membs);
+ CHECK(ret, FAIL, "H5Gget_num_objs");
+ VERIFY(num_membs,NDATASETS+2,"H5Gget_num_objs");
+
+ for(i=0; i< (int)num_membs; i++) {
+ H5G_obj_t obj_type; /* Type of object in file */
+
+ ret = H5Gget_objname_by_idx(file, (hsize_t)i, dataset_name, 32);
+ CHECK(ret, FAIL, "H5Gget_objsname_by_idx");
+
+ obj_type = H5Gget_objtype_by_idx(file, (hsize_t)i);
+ CHECK(obj_type, H5G_UNKNOWN, "H5Gget_objsname_by_idx");
+ }
+
+ H5E_BEGIN_TRY {
+ ret = (herr_t)H5Gget_objname_by_idx(file, (hsize_t)(NDATASETS+3), dataset_name, 16);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Gget_objsname_by_idx");
+ }
+
/* Test invalid indices for starting iteration */
info.command=RET_ZERO;
idx=-1;