apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/test testmmap.c
Date Fri, 13 Dec 2002 00:40:44 GMT
rbb         2002/12/12 16:40:44

  Modified:    test     testmmap.c
  Log:
  Fix the mmap tests.  We need to use the EOL macro for the tests.
  
  Revision  Changes    Path
  1.39      +7 -4      apr/test/testmmap.c
  
  Index: testmmap.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testmmap.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- testmmap.c	12 Dec 2002 00:30:38 -0000	1.38
  +++ testmmap.c	13 Dec 2002 00:40:44 -0000	1.39
  @@ -107,10 +107,11 @@
   static void test_get_filesize(CuTest *tc)
   {
       apr_status_t rv;
  +    int fsize = strlen("This is the MMAP data file."APR_EOL_STR);
   
       rv = apr_file_info_get(&finfo, APR_FINFO_NORM, thefile);
       CuAssertIntEquals(tc, rv, APR_SUCCESS);
  -    CuAssertIntEquals(tc, finfo.size, 28);
  +    CuAssertIntEquals(tc, fsize, finfo.size);
   }
   
   static void test_mmap_create(CuTest *tc)
  @@ -124,10 +125,12 @@
   
   static void test_mmap_contents(CuTest *tc)
   {
  +    int fsize = strlen("This is the MMAP data file."APR_EOL_STR);
  +    
       CuAssertPtrNotNull(tc, themmap);
       CuAssertPtrNotNull(tc, themmap->mm);
  -    CuAssertIntEquals(tc, themmap->size, 28);
  -    CuAssertStrEquals(tc, themmap->mm, "This is the MMAP data file.\n");
  +    CuAssertIntEquals(tc, fsize, themmap->size);
  +    CuAssertStrEquals(tc, themmap->mm, "This is the MMAP data file."APR_EOL_STR);
   }
   
   static void test_mmap_delete(CuTest *tc)
  @@ -146,7 +149,7 @@
   
       CuAssertPtrNotNull(tc, themmap);
       rv = apr_mmap_offset(&addr, themmap, 5);
  -    CuAssertStrEquals(tc, addr, "This is the MMAP data file.\n" + 5);
  +    CuAssertStrEquals(tc, addr, "This is the MMAP data file."APR_EOL_STR + 5);
   }
   #endif
   
  
  
  

Mime
View raw message