summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2010-04-27 20:33:46 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2010-04-27 20:33:46 (GMT)
commite48bb7e1c5c72c08c19e14d472974e34c9c88274 (patch)
tree820eefbc7b9dde7127a7b192bc3263e0fbaae4b8
parent5edb7aabe4ffd8de40c74e044ec442cbeefabc4a (diff)
downloadhdf5-e48bb7e1c5c72c08c19e14d472974e34c9c88274.zip
hdf5-e48bb7e1c5c72c08c19e14d472974e34c9c88274.tar.gz
hdf5-e48bb7e1c5c72c08c19e14d472974e34c9c88274.tar.bz2
[svn-r18644] 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 afd5872..f23a566 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