wrowe 2002/12/28 21:48:51
Modified: test testfile.c
Log:
Remove a bogus test. All of the original architects have argued against
testing for bogus (invalid) combinations of bits. This test checked a
POSIX behavior of requiring the caller to request read and/or write access.
On Win32 and some other platforms that support metadata access, opening
a file internally for no read or write access is entirely valid. E.g. to
modify the meta information, especially about directories on platforms
that don't support opening 'directories' for read/write access, APR already
uses apr_file_open() to handle the file metadata access. I see no
compelling reason to emulate POSIX's fail-on-no-read-or-write-request
behavior.
Revision Changes Path
1.62 +0 -22 apr/test/testfile.c
Index: testfile.c
===================================================================
RCS file: /home/cvs/apr/test/testfile.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- testfile.c 28 Dec 2002 20:44:55 -0000 1.61
+++ testfile.c 29 Dec 2002 05:48:51 -0000 1.62
@@ -68,27 +68,6 @@
#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;
@@ -525,7 +504,6 @@
{
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);