summaryrefslogtreecommitdiffstats
path: root/src/H5Gobj.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-11-20 21:01:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-11-20 21:01:28 (GMT)
commit335978f235277f12a87fb198a5fd1a0e43ce5734 (patch)
tree63d1ced7d5079d67992998b6cff21454e73ecd51 /src/H5Gobj.c
parent8d9964cf02cd13318029856b3becb70b8bb01f69 (diff)
downloadhdf5-335978f235277f12a87fb198a5fd1a0e43ce5734.zip
hdf5-335978f235277f12a87fb198a5fd1a0e43ce5734.tar.gz
hdf5-335978f235277f12a87fb198a5fd1a0e43ce5734.tar.bz2
[svn-r12952] Description:
Add tests for H5Literate(), in all combinations. Sweep up a few minor issues with H5Literate() that the tests exposed. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5Gobj.c')
-rw-r--r--src/H5Gobj.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/H5Gobj.c b/src/H5Gobj.c
index 84819cd..c1d81b5 100644
--- a/src/H5Gobj.c
+++ b/src/H5Gobj.c
@@ -611,6 +611,19 @@ H5G_obj_iterate(hid_t loc_id, const char *group_name,
if(skip > 0 && (size_t)skip >= linfo.nlinks)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "index out of bound")
+ /* Check for creation order tracking, if creation order index lookup requested */
+ if(idx_type == H5L_INDEX_CRT_ORDER) {
+ H5O_ginfo_t ginfo; /* Group info message */
+
+ /* Get group info message, to see if creation order is tracked for links in this group */
+ if(NULL == H5O_read(&(grp->oloc), H5O_GINFO_ID, 0, &ginfo, dxpl_id))
+ HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info message for group")
+
+ /* Check if creation order is tracked */
+ if(!ginfo.track_corder)
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "creation order not tracked for links in group")
+ } /* end if */
+
if(H5F_addr_defined(linfo.link_fheap_addr)) {
/* Iterate over the links in the group, building a table of the link messages */
if((ret_value = H5G_dense_iterate(grp->oloc.file, dxpl_id, &linfo, idx_type, order, skip, last_lnk, gid, lnk_op, op_data)) < 0)
@@ -626,6 +639,10 @@ H5G_obj_iterate(hid_t loc_id, const char *group_name,
/* Clear error stack from not finding the link info message */
H5E_clear_stack(NULL);
+ /* Can only perform name lookups on groups with symbol tables */
+ if(idx_type != H5L_INDEX_NAME)
+ HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query")
+
/* Iterate over symbol table */
if((ret_value = H5G_stab_iterate(&(grp->oloc), dxpl_id, order, skip, last_lnk, gid, lnk_op, op_data)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over symbol table")