You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2003/04/16 03:26:14 UTC

cvs commit: apr/test teststr.c

trawick     2003/04/15 18:26:14

  Modified:    test     teststr.c
  Log:
  since the string description for APR_ENOENT comes from the
  system library (on Unix-like systems, at least), don't
  assume that the message is always "No such file or directory"
  (it might not even be returned in English)
  
  for APR_ENOENT, just make sure we get some string back
  
  add a test for an APR-specific error code where we can
  expect a certain string from apr_strerror()
  
  Revision  Changes    Path
  1.15      +7 -3      apr/test/teststr.c
  
  Index: teststr.c
  ===================================================================
  RCS file: /home/cvs/apr/test/teststr.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- teststr.c	24 Mar 2003 17:14:43 -0000	1.14
  +++ teststr.c	16 Apr 2003 01:26:14 -0000	1.15
  @@ -184,11 +184,15 @@
   static void string_error(CuTest *tc)
   {
        char buf[128], *rv;
  -     
  +
  +     buf[0] = '\0';
        rv = apr_strerror(APR_ENOENT, buf, sizeof buf);
        CuAssertPtrEquals(tc, buf, rv);
  -     /* ### relax this comparison. */
  -     CuAssertStrEquals(tc, "No such file or directory", buf);
  +     CuAssertTrue(tc, strlen(buf) > 0);
  +
  +     rv = apr_strerror(APR_TIMEUP, buf, sizeof buf);
  +     CuAssertPtrEquals(tc, buf, rv);
  +     CuAssertStrEquals(tc, "The timeout specified has expired", buf);
   }
   
   CuSuite *teststr(void)