summaryrefslogtreecommitdiffstats
path: root/test/links.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-31 13:13:40 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-31 13:13:40 (GMT)
commite15bdb05e6bf52525c1df48f8e8e01aba3ce288b (patch)
treeb6a77169711c84362d7cbb252cb8d288b2656ba6 /test/links.c
parentb969dce6e5625dd9d9f9cc42717a1b2027fdeeb1 (diff)
downloadhdf5-e15bdb05e6bf52525c1df48f8e8e01aba3ce288b.zip
hdf5-e15bdb05e6bf52525c1df48f8e8e01aba3ce288b.tar.gz
hdf5-e15bdb05e6bf52525c1df48f8e8e01aba3ce288b.tar.bz2
[svn-r14225] Description:
Change H5Oget_info -> H5Oget_info_by_name and re-add H5Oget_info in a simpler form for querying a particular object, to align with other new API routines. Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'test/links.c')
-rw-r--r--test/links.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/test/links.c b/test/links.c
index 9f648ba..bee4f07 100644
--- a/test/links.c
+++ b/test/links.c
@@ -298,8 +298,8 @@ cklinks(hid_t fapl, hbool_t new_format)
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR
/* Hard link */
- if(H5Oget_info(file, "d1", &oinfo1, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info(file, "grp1/hard", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name(file, "d1", &oinfo1, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name(file, "grp1/hard", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5O_TYPE_DATASET != oinfo2.type) {
H5_FAILED();
printf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
@@ -315,7 +315,7 @@ cklinks(hid_t fapl, hbool_t new_format)
if(H5Lexists(file, "grp1/hard", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
/* Symbolic link */
- if(H5Oget_info(file, "grp1/soft", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name(file, "grp1/soft", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5O_TYPE_DATASET != oinfo2.type) {
H5_FAILED();
printf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
@@ -337,11 +337,11 @@ cklinks(hid_t fapl, hbool_t new_format)
/* Dangling link */
H5E_BEGIN_TRY {
- status = H5Oget_info(file, "grp1/dangle", &oinfo2, H5P_DEFAULT);
+ status = H5Oget_info_by_name(file, "grp1/dangle", &oinfo2, H5P_DEFAULT);
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" H5Oget_info() should have failed for a dangling link.");
+ puts(" H5Oget_info_by_name() should have failed for a dangling link.");
TEST_ERROR
} /* end if */
if(H5Lget_info(file, "grp1/dangle", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
@@ -364,11 +364,11 @@ cklinks(hid_t fapl, hbool_t new_format)
/* Recursive link */
H5E_BEGIN_TRY {
- status = H5Oget_info(file, "grp1/recursive", &oinfo2, H5P_DEFAULT);
+ status = H5Oget_info_by_name(file, "grp1/recursive", &oinfo2, H5P_DEFAULT);
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" H5Oget_info() should have failed for a recursive link.");
+ puts(" H5Oget_info_by_name() should have failed for a recursive link.");
TEST_ERROR
} /* end if */
if(H5Lget_info(file, "grp1/recursive", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
@@ -434,11 +434,11 @@ ck_new_links(hid_t fapl, hbool_t new_format)
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
/* Get hard link info */
- if(H5Oget_info(file, "/grp1/dataset2", &oi_dset, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name(file, "/grp1/dataset2", &oi_dset, H5P_DEFAULT) < 0)
TEST_ERROR
- if(H5Oget_info(file, "/grp1/hard1", &oi_hard1, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name(file, "/grp1/hard1", &oi_hard1, H5P_DEFAULT) < 0)
TEST_ERROR
- if(H5Oget_info(file, "/grp2/hard2", &oi_hard2, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name(file, "/grp2/hard2", &oi_hard2, H5P_DEFAULT) < 0)
TEST_ERROR
/* Check hard links */
@@ -1343,7 +1343,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
/* Get the group's link's information */
if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
old_cset = linfo.cset;
if(old_cset != H5T_CSET_UTF8) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
@@ -1362,7 +1362,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
/* Get the link's character set & modification time . They should be unchanged */
if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
if(old_cset != linfo.cset) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
@@ -1370,7 +1370,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
/* Create a new link to the group. It should have a different creation order value but the same modification time */
if(H5Lcreate_hard(file_id, "group", file_id, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info(file_id, "group2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name(file_id, "group2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
if(H5Lget_info(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(old_corder == linfo.corder) TEST_ERROR
@@ -1383,7 +1383,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
* should not change.
*/
if(H5Lcopy(file_id, "group", file_id, "group_copied", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info(file_id, "group_copied", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name(file_id, "group_copied", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
if(H5Lget_info(file_id, "group_copied", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
@@ -1394,7 +1394,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
/* Move the link with the default property list. */
if(H5Lmove(file_id, "group_copied", file_id, "group_copied2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info(file_id, "group_copied2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name(file_id, "group_copied2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
if(H5Lget_info(file_id, "group_copied2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
@@ -1404,7 +1404,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR
/* Check that the original link is unchanged */
- if(H5Oget_info(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
@@ -1415,7 +1415,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
* Its creation order value will change, but modification time should not
* change. */
if(H5Lmove(file_id, "group", file_id, "group_moved", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info(file_id, "group_moved", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name(file_id, "group_moved", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
if(H5Lget_info(file_id, "group_moved", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
@@ -1426,7 +1426,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
/* Move the link again using the default property list. */
if(H5Lmove(file_id, "group_moved", file_id, "group_moved_again", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info(file_id, "group_moved_again", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name(file_id, "group_moved_again", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
if(H5Lget_info(file_id, "group_moved_again", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
@@ -2686,7 +2686,7 @@ external_link_query(hid_t fapl, hbool_t new_format)
if(HDstrcmp(object_name, "/dst")) TEST_ERROR
/* Query information about object that external link points to */
- if(H5Oget_info(fid, "src", &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name(fid, "src", &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5O_TYPE_GROUP != oi.type) {
H5_FAILED();
puts(" Unexpected object type - should have been a group");
@@ -3420,8 +3420,8 @@ external_link_closing(hid_t fapl, hbool_t new_format)
/* Test that getting info works */
if(H5Lget_info(fid1, "elink/elink/elink/type1", &li, H5P_DEFAULT) < 0) TEST_ERROR
if(H5Lget_info(fid1, "elink/elink/elink", &li, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info(fid1, "elink/elink/elink/type1", &oi, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info(fid1, "elink/elink/elink", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name(fid1, "elink/elink/elink/type1", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name(fid1, "elink/elink/elink", &oi, H5P_DEFAULT) < 0) TEST_ERROR
/* Test move */
if(H5Lmove(fid1, "elink/elink/elink/group1", fid1,
@@ -3508,7 +3508,7 @@ external_link_closing(hid_t fapl, hbool_t new_format)
if(H5Gclose(gid) < 0) TEST_ERROR
if((gid = H5Gcreate2(fid1, "elink/elink2/group2/group3/group4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(gid) < 0) TEST_ERROR
- if(H5Oget_info(fid1, "elink/elink2/group2/group3/group4", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name(fid1, "elink/elink2/group2/group3/group4", &oi, H5P_DEFAULT) < 0) TEST_ERROR
/* Add a few regular groups and a soft link in file2 using intermediate group creation */
if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) TEST_ERROR
@@ -6407,7 +6407,7 @@ link_info_by_idx_old(hid_t fapl)
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Retrieve group's address on disk */
- if(H5Oget_info(group_id2, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(group_id2, &oi) < 0) TEST_ERROR
objno[u] = oi.addr;
/* Close group */
@@ -6900,7 +6900,7 @@ delete_by_idx_old(hid_t fapl)
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Retrieve group's address on disk */
- if(H5Oget_info(group_id2, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(group_id2, &oi) < 0) TEST_ERROR
objno[u] = oi.addr;
/* Close group */
@@ -6973,7 +6973,7 @@ delete_by_idx_old(hid_t fapl)
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Retrieve group's address on disk */
- if(H5Oget_info(group_id2, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(group_id2, &oi) < 0) TEST_ERROR
objno[u] = oi.addr;
/* Close group */
@@ -7973,7 +7973,7 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
if((obj_id = H5Oopen_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT)) < 0) TEST_ERROR
/* Get the object's information */
- if(H5Oget_info(obj_id, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(obj_id, &oi) < 0) TEST_ERROR
/* Check that the object is the correct one */
if(order == H5_ITER_INC) {
@@ -7999,7 +7999,7 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
*/
/* Get the address of the root group in the file to mount */
- if(H5Oget_info(mount_file_id, "/", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(mount_file_id, &oi) < 0) TEST_ERROR
mnt_root_addr = oi.addr;
/* Mount a file over a group in main group */
@@ -8011,7 +8011,7 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
if((obj_id = H5Oopen_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)mnt_idx, H5P_DEFAULT)) < 0) TEST_ERROR
/* Get the object's information */
- if(H5Oget_info(obj_id, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(obj_id, &oi) < 0) TEST_ERROR
/* Check that the object is the root of the mounted file and not in the previous file */
if(H5F_addr_ne(oi.addr, mnt_root_addr)) TEST_ERROR
@@ -8162,7 +8162,7 @@ open_by_idx(hid_t fapl)
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Retrieve group's address on disk */
- if(H5Oget_info(group_id2, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(group_id2, &oi) < 0) TEST_ERROR
objno[u] = oi.addr;
/* Close group created */
@@ -8197,7 +8197,7 @@ open_by_idx(hid_t fapl)
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Retrieve group's address on disk */
- if(H5Oget_info(group_id2, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(group_id2, &oi) < 0) TEST_ERROR
objno[u] = oi.addr;
/* Close group created */
@@ -8339,7 +8339,7 @@ open_by_idx_old(hid_t fapl)
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Retrieve group's address on disk */
- if(H5Oget_info(group_id2, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(group_id2, &oi) < 0) TEST_ERROR
objno[u] = oi.addr;
/* Close group created */
@@ -8438,7 +8438,7 @@ object_info_check(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type,
sprintf(objname, "filler %02u", u);
/* Query the object's information, by name */
- if(H5Oget_info(group_id, objname, &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name(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
@@ -8603,7 +8603,7 @@ object_info(hid_t fapl)
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Retrieve group's address on disk */
- if(H5Oget_info(group_id2, ".", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(group_id2, &oinfo) < 0) TEST_ERROR
objno[u] = oinfo.addr;
/* Create attributes on new object */
@@ -8651,7 +8651,7 @@ object_info(hid_t fapl)
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Retrieve group's address on disk */
- if(H5Oget_info(group_id2, ".", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(group_id2, &oinfo) < 0) TEST_ERROR
objno[u] = oinfo.addr;
/* Create attributes on new object */
@@ -8800,7 +8800,7 @@ object_info_old(hid_t fapl)
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Retrieve group's address on disk */
- if(H5Oget_info(group_id2, ".", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(group_id2, &oinfo) < 0) TEST_ERROR
objno[u] = oinfo.addr;
/* Create attributes on new object */
@@ -9594,8 +9594,8 @@ timestamps(hid_t fapl)
if(track_times != TRUE) TEST_ERROR
/* Query the object information for each group */
- if(H5Oget_info(group_id, ".", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info(group_id2, ".", &oinfo2, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR
+ if(H5Oget_info(group_id2, &oinfo2) < 0) TEST_ERROR
/* Sanity check object information for each group */
if(oinfo.atime != 0) TEST_ERROR
@@ -9641,8 +9641,8 @@ timestamps(hid_t fapl)
if(track_times != TRUE) TEST_ERROR
/* Query the object information for each group */
- if(H5Oget_info(group_id, ".", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info(group_id2, ".", &oinfo2, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR
+ if(H5Oget_info(group_id2, &oinfo2) < 0) TEST_ERROR
/* Sanity check object information for each group */
if(oinfo.atime != 0) TEST_ERROR