summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortdonovan <tdonovan@13f79535-47bb-0310-9956-ffa450edef68>2008-07-25 03:21:54 +0000
committertdonovan <tdonovan@13f79535-47bb-0310-9956-ffa450edef68>2008-07-25 03:21:54 +0000
commit0878ceafa6a7e880ed2b07de8d00c2d2c7a4286d (patch)
treefded4cd25cd19418ac1f314d7841657f230db218 /test
parent3f2c60077a406fdf0d9bd0a5b8756388da6f563a (diff)
downloadlibapr-0878ceafa6a7e880ed2b07de8d00c2d2c7a4286d.tar.gz
Moved new apr_file_link() function to open.c for all platforms
Fixed args & return value for Windows. re: PR 44841 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@679652 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/testfile.c19
-rw-r--r--test/testfilecopy.c20
2 files changed, 19 insertions, 20 deletions
diff --git a/test/testfile.c b/test/testfile.c
index dd1d277be..49d9a3ac9 100644
--- a/test/testfile.c
+++ b/test/testfile.c
@@ -71,6 +71,23 @@ static void test_open_read(abts_case *tc, void *data)
apr_file_close(filetest);
}
+static void link_existing(abts_case *tc, void *data)
+{
+ apr_status_t rv;
+
+ rv = apr_file_link("data/file_datafile.txt", "data/file_datafile2.txt");
+ apr_file_remove("data/file_datafile2.txt", p);
+ ABTS_ASSERT(tc, "Couldn't create hardlink to file", rv == APR_SUCCESS);
+}
+
+static void link_nonexisting(abts_case *tc, void *data)
+{
+ apr_status_t rv;
+
+ rv = apr_file_link("data/does_not_exist.txt", "data/fake.txt");
+ ABTS_ASSERT(tc, "", rv != APR_SUCCESS);
+}
+
static void test_read(abts_case *tc, void *data)
{
apr_status_t rv;
@@ -960,6 +977,8 @@ abts_suite *testfile(abts_suite *suite)
abts_run_test(suite, test_open_excl, NULL);
abts_run_test(suite, test_open_read, NULL);
abts_run_test(suite, test_open_readwrite, NULL);
+ abts_run_test(suite, link_existing, NULL);
+ abts_run_test(suite, link_nonexisting, NULL);
abts_run_test(suite, test_read, NULL);
abts_run_test(suite, test_readzero, NULL);
abts_run_test(suite, test_seek, NULL);
diff --git a/test/testfilecopy.c b/test/testfilecopy.c
index f1a64f1f8..5b64bc053 100644
--- a/test/testfilecopy.c
+++ b/test/testfilecopy.c
@@ -123,23 +123,6 @@ static void append_exist(abts_case *tc, void *data)
APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv);
}
-static void link_existing(abts_case *tc, void *data)
-{
- apr_status_t rv;
-
- rv = apr_file_link("data/file_datafile.txt", "data/file_datafile2.txt");
- apr_file_remove("data/file_datafile2.txt", p);
- ABTS_ASSERT(tc, "Couldn't create hardlink to file", rv == APR_SUCCESS);
-}
-
-static void link_nonexisting(abts_case *tc, void *data)
-{
- apr_status_t rv;
-
- rv = apr_file_link("data/does_not_exist.txt", "data/fake.txt");
- ABTS_ASSERT(tc, "", rv != APR_SUCCESS);
-}
-
abts_suite *testfilecopy(abts_suite *suite)
{
suite = ADD_SUITE(suite)
@@ -150,9 +133,6 @@ abts_suite *testfilecopy(abts_suite *suite)
abts_run_test(suite, append_nonexist, NULL);
abts_run_test(suite, append_exist, NULL);
- abts_run_test(suite, link_existing, NULL);
- abts_run_test(suite, link_nonexisting, NULL);
-
return suite;
}