diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-07 20:32:44 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-07 20:32:44 (GMT) |
commit | 665f42f9e0d7b84bddbca2ff45b276b45eb76654 (patch) | |
tree | 49e5b05fd76eb99dc489088d9b1e20a6d069910e /test/links.c | |
parent | e87cb9148356b581d8ff8a910ea3acc9d549ee7a (diff) | |
download | hdf5-665f42f9e0d7b84bddbca2ff45b276b45eb76654.zip hdf5-665f42f9e0d7b84bddbca2ff45b276b45eb76654.tar.gz hdf5-665f42f9e0d7b84bddbca2ff45b276b45eb76654.tar.bz2 |
[svn-r12878] Description:
Flesh out support for looking up link info by index, some cases for using
dense storage are working now.
Tested on:
Linux/32 2.6 (chicago)
Diffstat (limited to 'test/links.c')
-rw-r--r-- | test/links.c | 67 |
1 files changed, 59 insertions, 8 deletions
diff --git a/test/links.c b/test/links.c index 9fa4221..4dce7de 100644 --- a/test/links.c +++ b/test/links.c @@ -5927,6 +5927,7 @@ corder_info_by_idx(hid_t fapl) char objname[NAME_BUF_SIZE]; /* Object name */ char filename[NAME_BUF_SIZE];/* File name */ unsigned u; /* Local index variable */ + herr_t ret; /* Generic return value */ TESTING("querying info by index") @@ -5955,23 +5956,73 @@ corder_info_by_idx(hid_t fapl) if((group_id2 = H5Gcreate(group_id, objname, (size_t)0)) < 0) TEST_ERROR if(H5Gclose(group_id2) < 0) TEST_ERROR - /* Get the link information for new object */ - if(H5Lget_info_by_idx(group_id, ".", H5L_INDEX_CORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR + /* Get the link information for new link, in increasing creation order */ + if(H5Lget_info_by_idx(group_id, ".", H5L_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR - /* Verify the link information for new object */ -#ifdef QAK -HDfprintf(stderr, "linfo.corder_valid = %t\n", linfo.corder_valid); -HDfprintf(stderr, "linfo.corder = %Hd\n", linfo.corder); -HDfprintf(stderr, "u = %u\n", u); -#endif /* QAK */ + /* Verify the link information for new link */ + if(linfo.corder != u) TEST_ERROR + + /* Get the link information for first link, in increasing creation order */ + if(H5Lget_info_by_idx(group_id, ".", H5L_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR + + /* Verify the link information for first link */ + if(linfo.corder != 0) TEST_ERROR + + /* Get the link information for new link, in decreasing creation order */ + if(H5Lget_info_by_idx(group_id, ".", H5L_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR + + /* Verify the link information for new link */ if(linfo.corder != u) TEST_ERROR + + /* Get the link information for first link, in decreasing creation order */ + if(H5Lget_info_by_idx(group_id, ".", H5L_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR + + /* Verify the link information for first link */ + if(linfo.corder != 0) TEST_ERROR } /* end for */ + /* Check for out of bound offset */ + H5E_BEGIN_TRY { + ret = H5Lget_info_by_idx(group_id, ".", H5L_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT); + } H5E_END_TRY; + if(ret >= 0) TEST_ERROR + H5E_BEGIN_TRY { + ret = H5Lget_info_by_idx(group_id, ".", H5L_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT); + } H5E_END_TRY; + if(ret >= 0) TEST_ERROR + /* Create another link, to push group into dense form */ sprintf(objname, "filler %u", max_compact); if((group_id2 = H5Gcreate(group_id, objname, (size_t)0)) < 0) TEST_ERROR if(H5Gclose(group_id2) < 0) TEST_ERROR + /* Get the link information for new link, in increasing creation order */ + if(H5Lget_info_by_idx(group_id, ".", H5L_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR + + /* Verify the link information for new link */ + if(linfo.corder != u) TEST_ERROR + + /* Get the link information for first link, in increasing creation order */ + if(H5Lget_info_by_idx(group_id, ".", H5L_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR + + /* Verify the link information for first link */ + if(linfo.corder != 0) TEST_ERROR + + /* Get the link information for new link, in decreasing creation order */ + if(H5Lget_info_by_idx(group_id, ".", H5L_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR + + /* Verify the link information for new link */ + if(linfo.corder != u) TEST_ERROR + + /* Get the link information for first link, in decreasing creation order */ + if(H5Lget_info_by_idx(group_id, ".", H5L_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR + + /* Verify the link information for first link */ + if(linfo.corder != 0) TEST_ERROR + + /* Verify state of group */ + if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR + /* Close the group */ if(H5Gclose(group_id) < 0) TEST_ERROR |