apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/test testfmt.c
Date Fri, 18 Apr 2003 18:10:01 GMT
trawick     2003/04/18 11:10:01

  Modified:    test     testfmt.c
  Log:
  we already verify that apr-determined format strings work
  fine with the system library; might as well check that
  they work with apr_snprintf too
  
  Revision  Changes    Path
  1.10      +21 -7     apr/test/testfmt.c
  
  Index: testfmt.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testfmt.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- testfmt.c	15 Apr 2003 21:45:58 -0000	1.9
  +++ testfmt.c	18 Apr 2003 18:10:01 -0000	1.10
  @@ -63,7 +63,9 @@
       apr_ssize_t var = 0;
   
       sprintf(buf, "%" APR_SSIZE_T_FMT, var);
  -    CuAssertStrEquals(tc, buf, "0");
  +    CuAssertStrEquals(tc, "0", buf);
  +    apr_snprintf(buf, sizeof(buf), "%" APR_SSIZE_T_FMT, var);
  +    CuAssertStrEquals(tc, "0", buf);
   }
   
   static void size_t_fmt(CuTest *tc)
  @@ -72,7 +74,9 @@
       apr_size_t var = 0;
   
       sprintf(buf, "%" APR_SIZE_T_FMT, var);
  -    CuAssertStrEquals(tc, buf, "0");
  +    CuAssertStrEquals(tc, "0", buf);
  +    apr_snprintf(buf, sizeof(buf), "%" APR_SIZE_T_FMT, var);
  +    CuAssertStrEquals(tc, "0", buf);
   }
   
   static void off_t_fmt(CuTest *tc)
  @@ -81,7 +85,9 @@
       apr_off_t var = 0;
   
       sprintf(buf, "%" APR_OFF_T_FMT, var);
  -    CuAssertStrEquals(tc, buf, "0");
  +    CuAssertStrEquals(tc, "0", buf);
  +    apr_snprintf(buf, sizeof(buf), "%" APR_OFF_T_FMT, var);
  +    CuAssertStrEquals(tc, "0", buf);
   }
   
   static void pid_t_fmt(CuTest *tc)
  @@ -90,7 +96,9 @@
       pid_t var = 0;
   
       sprintf(buf, "%" APR_PID_T_FMT, var);
  -    CuAssertStrEquals(tc, buf, "0");
  +    CuAssertStrEquals(tc, "0", buf);
  +    apr_snprintf(buf, sizeof(buf), "%" APR_PID_T_FMT, var);
  +    CuAssertStrEquals(tc, "0", buf);
   }
   
   static void int64_t_fmt(CuTest *tc)
  @@ -99,7 +107,9 @@
       apr_int64_t var = 0;
   
       sprintf(buf, "%" APR_INT64_T_FMT, var);
  -    CuAssertStrEquals(tc, buf, "0");
  +    CuAssertStrEquals(tc, "0", buf);
  +    apr_snprintf(buf, sizeof(buf), "%" APR_INT64_T_FMT, var);
  +    CuAssertStrEquals(tc, "0", buf);
   }
   
   static void uint64_t_fmt(CuTest *tc)
  @@ -108,7 +118,9 @@
       apr_uint64_t var = 14000000;
   
       sprintf(buf, "%" APR_UINT64_T_FMT, var);
  -    CuAssertStrEquals(tc, buf, "14000000");
  +    CuAssertStrEquals(tc, "14000000", buf);
  +    apr_snprintf(buf, sizeof(buf), "%" APR_UINT64_T_FMT, var);
  +    CuAssertStrEquals(tc, "14000000", buf);
   }
   
   static void uint64_t_hex_fmt(CuTest *tc)
  @@ -117,7 +129,9 @@
       apr_uint64_t var = 14000000;
   
       sprintf(buf, "%" APR_UINT64_T_HEX_FMT, var);
  -    CuAssertStrEquals(tc, buf, "d59f80");
  +    CuAssertStrEquals(tc, "d59f80", buf);
  +    apr_snprintf(buf, sizeof(buf), "%" APR_UINT64_T_HEX_FMT, var);
  +    CuAssertStrEquals(tc, "d59f80", buf);
   }
   
   CuSuite *testfmt(void)
  
  
  

Mime
View raw message