summaryrefslogtreecommitdiff
path: root/test/testdir.c
diff options
context:
space:
mode:
authorBrian Havard <bjh@apache.org>2001-06-28 14:05:20 +0000
committerBrian Havard <bjh@apache.org>2001-06-28 14:05:20 +0000
commitca346f52f54d57c05a3243ab1dd790aebd4933fc (patch)
tree13ca763a6013570b51e2c4b039e53775f1f53fec /test/testdir.c
parent64d9ca0c32bac763980d045e8a70f5b1b7c17d94 (diff)
downloadapr-ca346f52f54d57c05a3243ab1dd790aebd4933fc.tar.gz
Make testdir more portable
- On anything not unix, a file must be closed before it can be deleted - Use APR_STATUS_IS_ENOENT to test for ENOENT. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61822 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testdir.c')
-rw-r--r--test/testdir.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/testdir.c b/test/testdir.c
index e20c219d2..fb6ae7a78 100644
--- a/test/testdir.c
+++ b/test/testdir.c
@@ -93,6 +93,8 @@ int main(void)
apr_file_open(&thefile, "dir1/file1",
APR_READ | APR_WRITE | APR_CREATE,
APR_OS_DEFAULT, pool))
+ STD_TEST_NEQ(" Closing dir1/file1",
+ apr_file_close(thefile))
/* Try to remove dir1. This should fail because it's not empty.
However, on a platform with threads disabled (such as FreeBSD),
@@ -112,9 +114,9 @@ int main(void)
underlying system readdir() returns NULL, the old value of
errno shouldn't cause a false alarm. We should get an ENOENT
back from apr_dir_read, and *not* the old errno. */
- TEST_NEQ(" get ENOENT on 3rd read",
- apr_dir_read(&finfo, finfo_flags, this_dir),
- APR_ENOENT, "OK", "Failed")
+ TEST_STATUS(" get ENOENT on 3rd read",
+ apr_dir_read(&finfo, finfo_flags, this_dir),
+ APR_STATUS_IS_ENOENT, "OK", "Failed")
/* Cleanup */
STD_TEST_NEQ(" Cleanup file1",