summaryrefslogtreecommitdiffstats
path: root/test/unlink.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-08-28 22:30:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-08-28 22:30:13 (GMT)
commitcae55b647da56ab390e048219efaef6a1afdccee (patch)
treedda27fc3626007a176e732585c28518d1a3d1eed /test/unlink.c
parent518e0ede771cbe1064fb8b42388450fd20fa3a62 (diff)
downloadhdf5-cae55b647da56ab390e048219efaef6a1afdccee.zip
hdf5-cae55b647da56ab390e048219efaef6a1afdccee.tar.gz
hdf5-cae55b647da56ab390e048219efaef6a1afdccee.tar.bz2
[svn-r14122] Description:
Move H5Gmove() to deprecated code section, replacing with H5Lmove() in source files. Tested on: FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (kagiso) Linux/64 2.6 (smirom) Solaris/32 5.10 (linew) Mac OS X/32 10.4.10 (amazon)
Diffstat (limited to 'test/unlink.c')
-rw-r--r--test/unlink.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/test/unlink.c b/test/unlink.c
index 01ddaf0..d87c39b 100644
--- a/test/unlink.c
+++ b/test/unlink.c
@@ -286,7 +286,7 @@ test_symlink(hid_t file)
/*-------------------------------------------------------------------------
* Function: test_rename
*
- * Purpose: Tests H5Gmove()
+ * Purpose: Tests H5Lmove()
*
* Return: Success: 0
*
@@ -306,34 +306,35 @@ test_rename(hid_t file)
/* Create a test group and rename something */
TESTING("object renaming");
- if((work = H5Gcreate2(file, "/test_rename", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- if((foo = H5Gcreate2(work, "foo", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Gmove(work, "foo", "bar") < 0) TEST_ERROR
- if((inner = H5Gcreate2(foo, "inner", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Gclose(inner) < 0) TEST_ERROR
- if(H5Gclose(foo) < 0) TEST_ERROR
+ if((work = H5Gcreate2(file, "/test_rename", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((foo = H5Gcreate2(work, "foo", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Lmove(work, "foo", H5L_SAME_LOC, "bar", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if((inner = H5Gcreate2(foo, "inner", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(inner) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(foo) < 0) FAIL_STACK_ERROR
if((inner = H5Gopen2(work, "bar/inner", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Gclose(inner) < 0) TEST_ERROR
+ if(H5Gclose(inner) < 0) FAIL_STACK_ERROR
PASSED();
/* Try renaming a symlink */
TESTING("symlink renaming");
- if(H5Lcreate_soft("link_value", work, "link_one", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Gmove(work, "link_one", "link_two") < 0) TEST_ERROR
- PASSED();
+ if(H5Lcreate_soft("link_value", work, "link_one", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lmove(work, "link_one", H5L_SAME_LOC, "link_two", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Cleanup */
- if (H5Gclose(work) < 0) goto error;
+ if (H5Gclose(work) < 0) FAIL_STACK_ERROR
+
+ PASSED();
return 0;
- error:
+error:
H5E_BEGIN_TRY {
H5Gclose(work);
H5Gclose(foo);
H5Gclose(inner);
} H5E_END_TRY;
return 1;
-}
+} /* end test_rename() */
/*-------------------------------------------------------------------------