You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "William A. Rowe, Jr." <wr...@apache.org> on 2002/12/28 21:48:20 UTC

Re: cvs commit: apr/test testdup.c

This commit message made no sense (should have been the testfile.c
commit message.)

While I was tracking down segfaults, I needed somewhat unique filenames
to see which of these several tests segfaulted the test suite.  This gave
me the context I needed to clobber the bugs.

Seemed like a good change so I've committed it, but don't feel strongly
either way about it.  Uniquifiers are very pleasant when debugging, though.

Bill

At 02:44 PM 12/28/2002, wrowe@apache.org wrote:
>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);
>  
>  
>