apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@apache.org
Subject cvs commit: apr/test test_apr.h
Date Wed, 20 Jun 2001 17:56:06 GMT
dreid       01/06/20 10:56:06

  Modified:    test     test_apr.h
  Log:
  Add a macro to allow us to time how long a function takes.
  
  Revision  Changes    Path
  1.6       +16 -2     apr/test/test_apr.h
  
  Index: test_apr.h
  ===================================================================
  RCS file: /home/cvs/apr/test/test_apr.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- test_apr.h	2001/05/14 12:57:06	1.5
  +++ test_apr.h	2001/06/20 17:56:04	1.6
  @@ -62,7 +62,12 @@
    * in the spacing, so use spaces instead :)
    * 
    */ 
  +
  +#ifndef APR_TEST_INCLUDES
  +#define APR_TEST_INCLUDES
  +
   #include "apr_strings.h"
  +#include "apr_time.h"
   
   #define TEST_EQ(str, func, value, good, bad) \
       printf("%-60s", str); \
  @@ -79,7 +84,7 @@
       }
   
   #define TEST_NEQ(str, func, value, good, bad) \
  -printf("%-60s", str); \
  +    printf("%-60s", str); \
       { \
       apr_status_t rv; \
       if ((rv = func) != value){ \
  @@ -106,4 +111,13 @@
   #define MSG_AND_EXIT(msg) \
       printf("%s\n", msg); \
       exit (-1);
  -    
  \ No newline at end of file
  +
  +#define TIME_FUNCTION(time, function) \
  +    { \
  +        apr_time_t tt = apr_time_now(); \
  +        function; \
  +        time = apr_time_now() - tt; \
  +    }
  +    
  +    
  +#endif /* APR_TEST_INCLUDES */
  
  
  

Mime
View raw message