summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2010-04-27 20:34:44 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2010-04-27 20:34:44 (GMT)
commit8b93f9640ece907960efb056a1b09bad2580c37e (patch)
tree8e8b82e504da50210d8959dc2e9fcf994e44b239
parent36823c3ca15f3f8795fbf5dc735434447166e179 (diff)
downloadhdf5-8b93f9640ece907960efb056a1b09bad2580c37e.zip
hdf5-8b93f9640ece907960efb056a1b09bad2580c37e.tar.gz
hdf5-8b93f9640ece907960efb056a1b09bad2580c37e.tar.bz2
[svn-r18645] Add testing of H5Lcopy() and H5Lmove() between files for soft and external
links. Tested: Fedora (too minor for commit test)
-rw-r--r--test/links.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/test/links.c b/test/links.c
index 3cfc959..c402e20 100644
--- a/test/links.c
+++ b/test/links.c
@@ -1140,11 +1140,13 @@ test_move(hid_t fapl, hbool_t new_format)
if((grp_2 = H5Gcreate2(file_a, "group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((grp_move = H5Gcreate2(grp_1, "group_move", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- /* Create hard and soft links. */
+ /* Create hard, soft and external links. */
if(H5Lcreate_hard(grp_1, "group_move", H5L_SAME_LOC, "hard", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
if(H5Lcreate_soft("/group1/group_move", grp_2, "soft", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
+ if(H5Lcreate_external("filename", "pathname", grp_2, "ext", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR
/* Move a group within the file. Both of source and destination use
* H5L_SAME_LOC. Should fail. */
@@ -1159,6 +1161,18 @@ test_move(hid_t fapl, hbool_t new_format)
!=FAIL) TEST_ERROR
} H5E_END_TRY;
+ /* Move a soft link across files. Should succeed. */
+ if(H5Lmove(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR
+ if(H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != TRUE)
+ TEST_ERROR
+
+ /* Move an external link across files. Should succeed. */
+ if(H5Lmove(grp_2, "ext", file_b, "ext_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR
+ if(H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != TRUE)
+ TEST_ERROR
+
/* Move a group across groups in the same file while renaming it. */
if(H5Lmove(grp_1, "group_move", grp_2, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
@@ -1286,11 +1300,13 @@ test_copy(hid_t fapl, hbool_t new_format)
if((grp_2 = H5Gcreate2(file_a, "group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((grp_move = H5Gcreate2(grp_1, "group_copy", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- /* Create hard and soft links. */
+ /* Create hard, soft and external links. */
if(H5Lcreate_hard(grp_1, "group_copy", H5L_SAME_LOC, "hard", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
if(H5Lcreate_soft("/group1/group_copy", grp_2, "soft", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
+ if(H5Lcreate_external("filename", "pathname", grp_2, "ext", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR
/* Copy a group within the file. Both of source and destination use
* H5L_SAME_LOC. Should fail. */
@@ -1305,6 +1321,18 @@ test_copy(hid_t fapl, hbool_t new_format)
!=FAIL) TEST_ERROR
} H5E_END_TRY;
+ /* Copy a soft link across files. Should succeed. */
+ if(H5Lcopy(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR
+ if(H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != TRUE)
+ TEST_ERROR
+
+ /* Copy an external link across files. Should succeed. */
+ if(H5Lcopy(grp_2, "ext", file_b, "ext_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR
+ if(H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != TRUE)
+ TEST_ERROR
+
/* Move a group across groups in the same file while renaming it. */
if(H5Lcopy(grp_1, "group_copy", grp_2, "group_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR