apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/test testfile.c
Date Sun, 29 Dec 2002 19:41:20 GMT
wrowe       2002/12/29 11:41:20

  Modified:    test     testfile.c
  Log:
    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.
  
  Revision  Changes    Path
  1.63      +22 -0     apr/test/testfile.c
  
  Index: testfile.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testfile.c,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- testfile.c	29 Dec 2002 05:48:51 -0000	1.62
  +++ testfile.c	29 Dec 2002 19:41:20 -0000	1.63
  @@ -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 *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);
  
  
  

Mime
View raw message