summaryrefslogtreecommitdiff
path: root/test/testfile.c
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-12-29 19:41:20 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-12-29 19:41:20 +0000
commit1d07060e5af83f01204932f22983303449ebd12e (patch)
tree03ad9cf6a120e7c33dca4bb22ec845326eee56af /test/testfile.c
parentf28feed3d86b841e8faa1d9154cbec3d5c707fcd (diff)
downloadlibapr-1d07060e5af83f01204932f22983303449ebd12e.tar.gz
Readd the test removed since rev 1.60. Let others untangle the implications,
since only two coders care {again} and don't share the same opinion this discussion is entirely moot. Note this test fails on Win32. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64225 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testfile.c')
-rw-r--r--test/testfile.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/testfile.c b/test/testfile.c
index 1e2656eac..93d7b8c58 100644
--- a/test/testfile.c
+++ b/test/testfile.c
@@ -68,6 +68,27 @@
#define APR_BUFFERSIZE 4096 /* This should match APR's buffer size. */
+
+static void test_open_noreadwrite(CuTest *tc)
+{
+ apr_status_t rv;
+ apr_file_t *thefile = NULL;
+
+ rv = apr_file_open(&thefile, FILENAME,
+ APR_CREATE | APR_EXCL,
+ APR_UREAD | APR_UWRITE | APR_GREAD, p);
+ CuAssertTrue(tc, rv != APR_SUCCESS);
+ CuAssertIntEquals(tc, 1, APR_STATUS_IS_EACCES(rv));
+#if 0
+ /* I consider this a bug, if we are going to return an error, we shouldn't
+ * allocate the file pointer. But, this would make us fail the text, so
+ * I am commenting it out for now.
+ */
+ CuAssertPtrEquals(tc, NULL, thefile);
+#endif
+ apr_file_close(thefile);
+}
+
static void test_open_excl(CuTest *tc)
{
apr_status_t rv;
@@ -504,6 +525,7 @@ CuSuite *testfile(void)
{
CuSuite *suite = CuSuiteNew("File I/O");
+ SUITE_ADD_TEST(suite, test_open_noreadwrite);
SUITE_ADD_TEST(suite, test_open_excl);
SUITE_ADD_TEST(suite, test_open_read);
SUITE_ADD_TEST(suite, test_open_readwrite);