apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject cvs commit: apr/test teststr.c
Date Tue, 27 Aug 2002 00:15:52 GMT
jim         2002/08/26 17:15:51

  Modified:    test     teststr.c
  Log:
  Add another test...
  
  Revision  Changes    Path
  1.7       +11 -1     apr/test/teststr.c
  
  Index: teststr.c
  ===================================================================
  RCS file: /home/cvs/apr/test/teststr.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- teststr.c	26 Aug 2002 14:18:16 -0000	1.6
  +++ teststr.c	27 Aug 2002 00:15:51 -0000	1.7
  @@ -143,10 +143,20 @@
           fprintf(stderr, "OK\n");
       }
   
  -    fprintf(stderr, "Testing 0 length ..........  ");
  +    fprintf(stderr, "Testing 0 length with NULL ..........  ");
       rv = apr_snprintf(NULL, 0, "%sBAR", "FOO");
       if (rv != 6) {
           fprintf(stderr, "FAILED\n");
  +    }
  +    fprintf(stderr, "OK\n");
  +
  +    fprintf(stderr, "Testing 0 length with non-NULL ..........  ");
  +    rv = apr_snprintf(buff, 0, "%sBAR", "FOO");
  +    if (rv != 6) {
  +        fprintf(stderr, "FAILED (return val)\n");
  +    }
  +    if (strcmp(buff, "FOOBAR") == 0) {
  +        fprintf(stderr, "FAILED (mangled buff)\n");
       }
       fprintf(stderr, "OK\n");
   }
  
  
  

Mime
View raw message