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 testdup.c
Date Sat, 28 Dec 2002 20:44:00 GMT
wrowe       2002/12/28 12:44:00

  Modified:    test     testdup.c
  Log:
    Fix several bugs where handle creation failed.  Win32 doesn't (and other
    platforms shouldn't) accept NULL as apr_file_close.
  
  Revision  Changes    Path
  1.8       +11 -7     apr/test/testdup.c
  
  Index: testdup.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testdup.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- testdup.c	11 Dec 2002 20:43:56 -0000	1.7
  +++ testdup.c	28 Dec 2002 20:43:59 -0000	1.8
  @@ -61,7 +61,7 @@
   
   #define TEST "Testing\n"
   #define TEST2 "Testing again\n"
  -#define FILENAME "data/testdup.file"
  +#define FILEPATH "data/"
   
   static void test_file_dup(CuTest *tc)
   {
  @@ -71,7 +71,8 @@
       apr_finfo_t finfo;
   
       /* First, create a new file, empty... */
  -    rv = apr_file_open(&file1, FILENAME, APR_READ | APR_WRITE | APR_CREATE|
  +    rv = apr_file_open(&file1, FILEPATH "testdup.file", 
  +                       APR_READ | APR_WRITE | APR_CREATE |
                          APR_DELONCLOSE, APR_OS_DEFAULT, p);
       CuAssertIntEquals(tc, APR_SUCCESS, rv);
       CuAssertPtrNotNull(tc, file1);
  @@ -86,7 +87,7 @@
       /* cleanup after ourselves */
       rv = apr_file_close(file3);
       CuAssertIntEquals(tc, APR_SUCCESS, rv);
  -    rv = apr_stat(&finfo, FILENAME, APR_FINFO_NORM, p);
  +    rv = apr_stat(&finfo, FILEPATH "testdup.file", APR_FINFO_NORM, p);
       CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv));
   }  
   
  @@ -101,7 +102,8 @@
       apr_off_t fpos;
   
       /* First, create a new file, empty... */
  -    rv = apr_file_open(&file1, FILENAME, APR_READ | APR_WRITE | APR_CREATE|
  +    rv = apr_file_open(&file1, FILEPATH "testdup.readwrite.file", 
  +                       APR_READ | APR_WRITE | APR_CREATE |
                          APR_DELONCLOSE, APR_OS_DEFAULT, p);
       CuAssertIntEquals(tc, APR_SUCCESS, rv);
       CuAssertPtrNotNull(tc, file1);
  @@ -130,7 +132,7 @@
   
       rv = apr_file_close(file3);
       CuAssertIntEquals(tc, APR_SUCCESS, rv);
  -    rv = apr_stat(&finfo, FILENAME, APR_FINFO_NORM, p);
  +    rv = apr_stat(&finfo, FILEPATH "testdup.readwrite.file", APR_FINFO_NORM, p);
       CuAssertIntEquals(tc, 1, APR_STATUS_IS_ENOENT(rv));
   }  
   
  @@ -140,7 +142,8 @@
       apr_file_t *file3 = NULL;
       apr_status_t rv;
   
  -    rv = apr_file_open(&file2, FILENAME, APR_READ | APR_WRITE | APR_CREATE |
  +    rv = apr_file_open(&file2, FILEPATH "testdup2.file", 
  +                       APR_READ | APR_WRITE | APR_CREATE |
                          APR_DELONCLOSE, APR_OS_DEFAULT, p);
       CuAssertIntEquals(tc, APR_SUCCESS, rv);
       CuAssertPtrNotNull(tc, file2);
  @@ -165,7 +168,8 @@
       char buff[50];
       apr_off_t fpos;
   
  -    rv = apr_file_open(&file2, FILENAME, APR_READ | APR_WRITE | APR_CREATE |
  +    rv = apr_file_open(&file2, FILEPATH "testdup2.readwrite.file", 
  +                       APR_READ | APR_WRITE | APR_CREATE |
                          APR_DELONCLOSE, APR_OS_DEFAULT, p);
       CuAssertIntEquals(tc, APR_SUCCESS, rv);
       CuAssertPtrNotNull(tc, file2);
  
  
  

Mime
View raw message