apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: apr/test test_apr.h
Date Thu, 28 Jun 2001 13:56:39 GMT
bjh         01/06/28 06:56:39

  Modified:    test     test_apr.h
  Log:
  Add a standard test macro for testing a function's return value using an
  APR_STATUS_IS_* macro.
  
  Revision  Changes    Path
  1.7       +14 -0     apr/test/test_apr.h
  
  Index: test_apr.h
  ===================================================================
  RCS file: /home/cvs/apr/test/test_apr.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- test_apr.h	2001/06/20 17:56:04	1.6
  +++ test_apr.h	2001/06/28 13:56:37	1.7
  @@ -97,6 +97,20 @@
       printf("%s\n", good); \
       }
   
  +#define TEST_STATUS(str, func, testmacro, good, bad) \
  +    printf("%-60s", str); \
  +    { \
  +        apr_status_t rv = func; \
  +        if (!testmacro(rv)) { \
  +            char errmsg[200]; \
  +            printf("%s\n", bad); \
  +            fprintf(stderr, "Error was %d : %s\n", rv, \
  +                    apr_strerror(rv, (char*)&errmsg, 200)); \
  +            exit(-1); \
  +        } \
  +        printf("%s\n", good); \
  +    }
  +
   #define STD_TEST_NEQ(str, func) \
   	TEST_NEQ(str, func, APR_SUCCESS, "OK", "Failed");
   
  
  
  

Mime
View raw message