diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-27 05:31:54 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-27 05:31:54 (GMT) |
commit | e32aacbfed751a2ffb2df9579562acfba8e4da37 (patch) | |
tree | 6faf99027f82702d73fa7ab835c0d85747b66035 | |
parent | 5c1fedcb9003ab614db83a15723bb0fc0389e3c7 (diff) | |
download | hdf5-e32aacbfed751a2ffb2df9579562acfba8e4da37.zip hdf5-e32aacbfed751a2ffb2df9579562acfba8e4da37.tar.gz hdf5-e32aacbfed751a2ffb2df9579562acfba8e4da37.tar.bz2 |
[svn-r12974] Description:
Add H5Oget_info() and H5Oget_info_by_idx() API routines & tests
Tested on:
FreeBSD/32 4.11 (sleipnir)
Linux/32 2.4 (heping)
Linux/64 2.4 (mir)
Mac OS X/32 10.4.8 (amazon)
AIX/32 5.? (copper)
-rw-r--r-- | release_docs/RELEASE.txt | 6 | ||||
-rw-r--r-- | src/H5O.c | 68 | ||||
-rw-r--r-- | src/H5Opublic.h | 5 | ||||
-rw-r--r-- | test/links.c | 432 |
4 files changed, 501 insertions, 10 deletions
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 193dd97..821b071 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -160,6 +160,12 @@ New Features Library: -------- + - Added new H5Oget_info_by_idx() routine to query the information about + an object in a group according to the order within an index. + - QAK - 2006/11/26 + - Added new H5Oget_info() routine to query the information about an + object in a group by name. + - QAK - 2006/11/26 - Added new H5Oopen_by_idx() routine to open an object in a group according to the order within an index. - QAK - 2006/11/20 @@ -609,6 +609,74 @@ done: /*------------------------------------------------------------------------- + * Function: H5Oget_info_by_idx + * + * Purpose: Retrieve information about an object, according to the order + * of an index. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * November 26 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5L_index_t idx_type, + H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id) +{ + H5G_loc_t loc; /* Location of group */ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(H5Oget_info_by_idx, FAIL) + + /* Check args */ + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if(!group_name || !*group_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") + if(idx_type <= H5L_INDEX_UNKNOWN || idx_type >= H5L_INDEX_N) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") + if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") + if(!oinfo) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") + if(H5P_DEFAULT == lapl_id) + lapl_id = H5P_LINK_ACCESS_DEFAULT; + else + if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location, according to the order in the index */ + if(H5G_loc_find_by_idx(&loc, group_name, idx_type, order, n, &obj_loc/*out*/, lapl_id, H5AC_dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") + loc_found = TRUE; + + /* Retrieve the object's information */ + if(H5O_get_info(obj_loc.oloc, oinfo, H5AC_dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve object info") + +done: + /* Release the object location */ + if(loc_found) + if(H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_API(ret_value) +} /* end H5Oget_info_by_idx() */ + + +/*------------------------------------------------------------------------- * Function: H5O_open_by_loc * * Purpose: Opens an object and returns an ID given its group loction. diff --git a/src/H5Opublic.h b/src/H5Opublic.h index fc91d23..b2a9778 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -98,7 +98,7 @@ typedef struct H5O_info_t { uint64_t msg_present; /* Flags to indicate presence of message type in header */ uint64_t msg_shared; /* Flags to indicate message type is shared in header */ } hdr; - hsize_t extra; /* Size of additional metadata for an object */ + hsize_t meta_size; /* Size of additional metadata for an object */ /* (B-tree & heap for groups, B-tree for chunked dataset, etc.) */ } H5O_info_t; @@ -121,6 +121,9 @@ H5_DLL hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5L_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id); H5_DLL herr_t H5Oget_info(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lapl_id); +H5_DLL herr_t H5Oget_info_by_idx(hid_t loc_id, const char *group_name, + H5L_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, + hid_t lapl_id); H5_DLL herr_t H5Oincr_refcount(hid_t object_id); H5_DLL herr_t H5Odecr_refcount(hid_t object_id); H5_DLL herr_t H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, diff --git a/test/links.c b/test/links.c index fba5f21..adf4368 100644 --- a/test/links.c +++ b/test/links.c @@ -7828,7 +7828,6 @@ error: return -1; } /* end link_iterate_old() */ -#endif /* QAK */ /*------------------------------------------------------------------------- @@ -8192,7 +8191,7 @@ error: /*------------------------------------------------------------------------- - * Function: open_by_idxold_ + * Function: open_by_idx_old * * Purpose: Create an old-style group and test opening * objects by index. @@ -8217,13 +8216,10 @@ open_by_idx_old(hid_t fapl) char filename[NAME_BUF_SIZE];/* File name */ char objname[NAME_BUF_SIZE]; /* Object name */ char valname[NAME_BUF_SIZE]; /* Link value */ - haddr_t *objno = NULL; /* Addresses of the objects created */ + haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */ unsigned u; /* Local index variable */ herr_t ret; /* Generic return value */ - /* Allocate object address array */ - if(NULL == (objno = HDmalloc(sizeof(haddr_t) * CORDER_NLINKS))) TEST_ERROR - /* Create file to mount */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if((mount_file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -8250,7 +8246,7 @@ open_by_idx_old(hid_t fapl) if((group_id = H5Gcreate_expand(file_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Llink(file_id, CORDER_GROUP_NAME, group_id, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR - /* Create group with creation order tracking on for soft links */ + /* Create old-style group for soft links */ if((soft_group_id = H5Gcreate_expand(file_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Llink(file_id, CORDER_SOFT_GROUP_NAME, soft_group_id, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -8320,6 +8316,296 @@ open_by_idx_old(hid_t fapl) /* Close the file for mounting */ if(H5Fclose(mount_file_id) < 0) TEST_ERROR + return 0; + +error: + /* Free resources */ + H5E_BEGIN_TRY { + H5Gclose(group_id); + H5Gclose(soft_group_id); + H5Fclose(file_id); + H5Fclose(mount_file_id); + } H5E_END_TRY; + + return -1; +} /* end open_by_idx_old() */ +#endif /* QAK */ + + +/*------------------------------------------------------------------------- + * Function: object_info_check + * + * Purpose: Check querying object info in a group + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Quincey Koziol + * Sunday, November 26, 2006 + * + *------------------------------------------------------------------------- + */ +static int +object_info_check(hid_t main_group_id, hid_t soft_group_id, H5L_index_t idx_type, + H5_iter_order_t order, unsigned max_links, haddr_t *objno) +{ + char objname[NAME_BUF_SIZE]; /* Object name */ + hid_t group_id; /* ID of group to test */ + H5O_info_t oinfo; /* Buffer for querying object's info */ + unsigned u, v; /* Local index variables */ + + /* Work through main & soft link groups */ + for(v = 0; v < 2; v++) { + /* Choose appropriate group to open links within */ + switch(v) { + case 0: + group_id = main_group_id; + break; + + case 1: + group_id = soft_group_id; + break; + } /* end switch */ + + /* Open each object in group by name and check that it's the correct one */ + for(u = 0; u < max_links; u++) { + /* Make name for link */ + sprintf(objname, "filler %02u", u); + + /* Query the object's information, by name */ + if(H5Oget_info(group_id, objname, &oinfo, H5P_DEFAULT) < 0) TEST_ERROR + + /* Check that the object is the correct one */ + if(H5F_addr_ne(oinfo.addr, objno[u])) TEST_ERROR + + /* Query the object's information, by index */ + if(H5Oget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)u, &oinfo, H5P_DEFAULT) < 0) TEST_ERROR + + /* Check that the object is the correct one */ + if(order == H5_ITER_INC) { + if(H5F_addr_ne(oinfo.addr, objno[u])) TEST_ERROR + } /* end if */ + else if(order == H5_ITER_DEC) { + unsigned dec_u = max_links - (u + 1); /* Decreasing mapped index */ + + if(H5F_addr_ne(oinfo.addr, objno[dec_u])) TEST_ERROR + } /* end if */ + else { + /* XXX: What to do about native order? */ + } /* end else */ + + } /* end for */ + } /* end for */ + + /* Success */ + return(0); + +error: + return(-1); +} /* end object_info_check() */ + + +/*------------------------------------------------------------------------- + * Function: object_info + * + * Purpose: Create a group with creation order indices and test querying + * object info. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Quincey Koziol + * Sunday, November 26, 2006 + * + *------------------------------------------------------------------------- + */ +static int +object_info(hid_t fapl) +{ + hid_t file_id = (-1); /* File ID */ + hid_t group_id = (-1); /* Group ID */ + hid_t soft_group_id = (-1); /* Group ID for soft links */ + hid_t gcpl_id = (-1); /* Group creation property list ID */ + H5L_index_t idx_type; /* Type of index to operate on */ + H5_iter_order_t order; /* Order within in the index */ + hbool_t use_index; /* Use index on creation order values */ + unsigned max_compact; /* Maximum # of links to store in group compactly */ + unsigned min_dense; /* Minimum # of links to store in group "densely" */ + H5O_info_t oinfo; /* Buffer for querying object's info */ + char filename[NAME_BUF_SIZE];/* File name */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char valname[NAME_BUF_SIZE]; /* Link value */ + haddr_t *objno = NULL; /* Addresses of the objects created */ + herr_t ret; /* Generic return value */ + unsigned u; /* Local index variable */ + + /* Create group creation property list */ + if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR + + /* Query the group creation properties */ + if(H5Pget_link_phase_change(gcpl_id, &max_compact, &min_dense) < 0) TEST_ERROR + + /* Allocate object address array */ + if(NULL == (objno = HDmalloc(sizeof(haddr_t) * (max_compact * 2)))) TEST_ERROR + + /* Loop over operating on different indices on link fields */ + for(idx_type = H5L_INDEX_NAME; idx_type <=H5L_INDEX_CRT_ORDER; idx_type++) { + /* Loop over operating in different orders */ + for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; order++) { + /* Loop over using index for creation order value */ + for(use_index = FALSE; use_index <= TRUE; use_index++) { + /* Print appropriate test message */ + if(idx_type == H5L_INDEX_CRT_ORDER) { + if(order == H5_ITER_INC) { + if(use_index) + TESTING("query object info by creation order index in increasing order w/creation order index") + else + TESTING("query object info by creation order index in increasing order w/o creation order index") + } /* end if */ + else if(order == H5_ITER_DEC) { + if(use_index) + TESTING("query object info by creation order index in decreasing order w/creation order index") + else + TESTING("query object info by creation order index in decreasing order w/o creation order index") + } /* end else */ + else { + HDassert(order == H5_ITER_NATIVE); + if(use_index) + TESTING("query object info by creation order index in native order w/creation order index") + else + TESTING("query object info by creation order index in native order w/o creation order index") + } /* end else */ + } /* end if */ + else { + if(order == H5_ITER_INC) { + if(use_index) + TESTING("query object info by name index in increasing order w/creation order index") + else + TESTING("query object info by name index in increasing order w/o creation order index") + } /* end if */ + else if(order == H5_ITER_DEC) { + if(use_index) + TESTING("query object info by name index in decreasing order w/creation order index") + else + TESTING("query object info by name index in decreasing order w/o creation order index") + } /* end else */ + else { + HDassert(order == H5_ITER_NATIVE); + if(use_index) + TESTING("query object info by name index in native order w/creation order index") + else + TESTING("query object info by name index in native order w/o creation order index") + } /* end else */ + } /* end else */ + + /* Create file */ + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + + /* Set creation order tracking & indexing on group */ + if(H5Pset_creation_order_index(gcpl_id, use_index) < 0) TEST_ERROR + if(H5Pset_creation_order_tracking(gcpl_id, TRUE) < 0) TEST_ERROR + + /* Create group with creation order tracking on */ + if((group_id = H5Gcreate_expand(file_id, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Llink(file_id, CORDER_GROUP_NAME, group_id, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + + /* Create group with creation order tracking on for soft links */ + if((soft_group_id = H5Gcreate_expand(file_id, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Llink(file_id, CORDER_SOFT_GROUP_NAME, soft_group_id, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + + + /* Check for out of bound query by index on empty group */ + H5E_BEGIN_TRY { + ret = H5Oget_info_by_idx(group_id, ".", H5L_INDEX_NAME, order, (hsize_t)0, &oinfo, H5P_DEFAULT); + } H5E_END_TRY; + if(ret >= 0) TEST_ERROR + + /* Create several links, up to limit of compact form */ + for(u = 0; u < max_compact; u++) { + hid_t group_id2; /* Group ID */ + + /* Make name for link */ + sprintf(objname, "filler %02u", u); + + /* Create hard link, with group object */ + if((group_id2 = H5Gcreate(group_id, objname, (size_t)0)) < 0) TEST_ERROR + + /* Retrieve group's address on disk */ + if(H5Oget_info(group_id2, ".", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR + objno[u] = oinfo.addr; + + /* Close group created */ + if(H5Gclose(group_id2) < 0) TEST_ERROR + + /* Create soft link in another group, to objects in main group */ + sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname); + if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + } /* end for */ + + /* Verify state of group (compact) */ + if(H5G_has_links_test(group_id, NULL) != TRUE) TEST_ERROR + + /* Check for out of bound query by index */ + H5E_BEGIN_TRY { + ret = H5Oget_info_by_idx(group_id, ".", H5L_INDEX_NAME, order, (hsize_t)u, &oinfo, H5P_DEFAULT); + } H5E_END_TRY; + if(ret >= 0) TEST_ERROR + + /* Verify querying objects by name */ + if(object_info_check(group_id, soft_group_id, idx_type, order, u, objno) < 0) TEST_ERROR + + + /* Create more links, to push group into dense form */ + for(; u < (max_compact * 2); u++) { + hid_t group_id2; /* Group ID */ + + /* Make name for link */ + sprintf(objname, "filler %02u", u); + + /* Create hard link, with group object */ + if((group_id2 = H5Gcreate(group_id, objname, (size_t)0)) < 0) TEST_ERROR + + /* Retrieve group's address on disk */ + if(H5Oget_info(group_id2, ".", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR + objno[u] = oinfo.addr; + + /* Close group created */ + if(H5Gclose(group_id2) < 0) TEST_ERROR + + /* Create soft link in another group, to objects in main group */ + sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname); + if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + } /* end for */ + + /* Verify state of group (dense) */ + if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR + + /* Check for out of bound query by index */ + H5E_BEGIN_TRY { + ret = H5Oget_info_by_idx(group_id, ".", H5L_INDEX_NAME, order, (hsize_t)u, &oinfo, H5P_DEFAULT); + } H5E_END_TRY; + if(ret >= 0) TEST_ERROR + + /* Verify querying objects by name */ + if(object_info_check(group_id, soft_group_id, idx_type, order, u, objno) < 0) TEST_ERROR + + + /* Close the groups */ + if(H5Gclose(group_id) < 0) TEST_ERROR + if(H5Gclose(soft_group_id) < 0) TEST_ERROR + + /* Close the file */ + if(H5Fclose(file_id) < 0) TEST_ERROR + + PASSED(); + } /* end for */ + } /* end for */ + } /* end for */ + + /* Close the group creation property list */ + if(H5Pclose(gcpl_id) < 0) TEST_ERROR + /* Free resources */ if(objno) HDfree(objno); @@ -8329,17 +8615,143 @@ open_by_idx_old(hid_t fapl) error: /* Free resources */ H5E_BEGIN_TRY { + H5Pclose(gcpl_id); H5Gclose(group_id); H5Gclose(soft_group_id); H5Fclose(file_id); - H5Fclose(mount_file_id); } H5E_END_TRY; if(objno) HDfree(objno); return -1; -} /* end open_by_idx() */ +} /* end object_info() */ + + +/*------------------------------------------------------------------------- + * Function: object_info_old + * + * Purpose: Create an old-style group test querying object info. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Quincey Koziol + * Sunday, November 26, 2006 + * + *------------------------------------------------------------------------- + */ +static int +object_info_old(hid_t fapl) +{ + hid_t file_id = (-1); /* File ID */ + hid_t group_id = (-1); /* Group ID */ + hid_t soft_group_id = (-1); /* Group ID for soft links */ + H5_iter_order_t order; /* Order within in the index */ + H5O_info_t oinfo; /* Buffer for querying object's info */ + char filename[NAME_BUF_SIZE];/* File name */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char valname[NAME_BUF_SIZE]; /* Link value */ + haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */ + herr_t ret; /* Generic return value */ + unsigned u; /* Local index variable */ + + /* Loop over operating in different orders */ + for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; order++) { + /* Print appropriate test message */ + if(order == H5_ITER_INC) { + TESTING("query object info by name index in increasing order in old-style group") + } /* end if */ + else if(order == H5_ITER_DEC) { + TESTING("query object info by name index in decreasing order in old-style group") + } /* end else */ + else { + HDassert(order == H5_ITER_NATIVE); + TESTING("query object info by name index in native order in old-style group") + } /* end else */ + + /* Create file */ + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + + /* Create old-style group */ + if((group_id = H5Gcreate_expand(file_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Llink(file_id, CORDER_GROUP_NAME, group_id, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + + /* Create old-style group for soft links */ + if((soft_group_id = H5Gcreate_expand(file_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Llink(file_id, CORDER_SOFT_GROUP_NAME, soft_group_id, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + + + /* Check for out of bound query by index on empty group */ + H5E_BEGIN_TRY { + ret = H5Oget_info_by_idx(group_id, ".", H5L_INDEX_NAME, order, (hsize_t)0, &oinfo, H5P_DEFAULT); + } H5E_END_TRY; + if(ret >= 0) TEST_ERROR + + /* Create several links */ + for(u = 0; u < CORDER_NLINKS; u++) { + hid_t group_id2; /* Group ID */ + + /* Make name for link */ + sprintf(objname, "filler %02u", u); + + /* Create hard link, with group object */ + if((group_id2 = H5Gcreate(group_id, objname, (size_t)0)) < 0) TEST_ERROR + + /* Retrieve group's address on disk */ + if(H5Oget_info(group_id2, ".", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR + objno[u] = oinfo.addr; + + /* Close group created */ + if(H5Gclose(group_id2) < 0) TEST_ERROR + + /* Create soft link in another group, to objects in main group */ + sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname); + if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + } /* end for */ + + /* Verify state of group (symbol table) */ + if(H5G_has_stab_test(group_id) != TRUE) TEST_ERROR + + /* Check for out of bound query by index */ + H5E_BEGIN_TRY { + ret = H5Oget_info_by_idx(group_id, ".", H5L_INDEX_NAME, order, (hsize_t)u, &oinfo, H5P_DEFAULT); + } H5E_END_TRY; + if(ret >= 0) TEST_ERROR + + /* Check for creation order index query */ + H5E_BEGIN_TRY { + ret = H5Oget_info_by_idx(group_id, ".", H5L_INDEX_CRT_ORDER, order, (hsize_t)(u - 1), &oinfo, H5P_DEFAULT); + } H5E_END_TRY; + if(ret >= 0) TEST_ERROR + + /* Verify querying objects by name */ + if(object_info_check(group_id, soft_group_id, H5L_INDEX_NAME, order, u, objno) < 0) TEST_ERROR + + + /* Close the groups */ + if(H5Gclose(group_id) < 0) TEST_ERROR + if(H5Gclose(soft_group_id) < 0) TEST_ERROR + + /* Close the file */ + if(H5Fclose(file_id) < 0) TEST_ERROR + + PASSED(); + } /* end for */ + + return 0; + +error: + /* Free resources */ + H5E_BEGIN_TRY { + H5Gclose(group_id); + H5Gclose(soft_group_id); + H5Fclose(file_id); + } H5E_END_TRY; + + return -1; +} /* end object_info_old() */ /*------------------------------------------------------------------------- @@ -8449,6 +8861,7 @@ main(void) nerrors += delete_by_idx(fapl2) < 0 ? 1 : 0; nerrors += link_iterate(fapl2) < 0 ? 1 : 0; nerrors += open_by_idx(fapl2) < 0 ? 1 : 0; + nerrors += object_info(fapl2) < 0 ? 1 : 0; } /* end if */ else { /* Test new API calls on old-style groups */ @@ -8456,6 +8869,7 @@ main(void) nerrors += delete_by_idx_old(fapl) < 0 ? 1 : 0; nerrors += link_iterate_old(fapl) < 0 ? 1 : 0; nerrors += open_by_idx_old(fapl) < 0 ? 1 : 0; + nerrors += object_info_old(fapl) < 0 ? 1 : 0; } } /* end for */ #else /* QAK */ |