summaryrefslogtreecommitdiffstats
path: root/test/titerate.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-08-22 13:50:01 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-08-22 13:50:01 (GMT)
commit57993b61d374ae5cb9a956d9ee28bb7cdc7064ea (patch)
tree27d09d7a9e739abd9380a89360fc711f2d4a6eb3 /test/titerate.c
parent500b5f904f74c69511a5f0a89c98dd1b2006b758 (diff)
downloadhdf5-57993b61d374ae5cb9a956d9ee28bb7cdc7064ea.zip
hdf5-57993b61d374ae5cb9a956d9ee28bb7cdc7064ea.tar.gz
hdf5-57993b61d374ae5cb9a956d9ee28bb7cdc7064ea.tar.bz2
[svn-r7391] 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/titerate.c')
-rw-r--r--test/titerate.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/titerate.c b/test/titerate.c
index e8d0e3a..ee926ea 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -215,6 +215,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;