yapf/unittest/unittest.h
changeset 3900 4984308f9125
child 3971 2116cd6db7fd
equal deleted inserted replaced
3899:4c5b1de6cb17 3900:4984308f9125
       
     1 /* $Id$ */
       
     2 
       
     3 #define UNITTEST
       
     4 
       
     5 extern int num_tests_failed;
       
     6 extern int num_tests_total;
       
     7 
       
     8 extern bool _dbg;
       
     9 #define DBG if(_dbg) printf
       
    10 
       
    11 
       
    12 #define CHECK_INT(case_num, val, should_be) \
       
    13 { \
       
    14 	if((val) != (should_be)) { \
       
    15 	res |= (1 << case_num); \
       
    16 	printf("\n****** ERROR in case %d: " #val " = %d (should be %d)!", case_num, (val), (should_be)); \
       
    17 	} \
       
    18 }
       
    19 
       
    20 typedef int(*TESTPROC)(bool silent);
       
    21 
       
    22 //#undef FORCEINLINE
       
    23 //#define FORCEINLINE
       
    24 
       
    25 
       
    26 #if defined(_WIN32) || defined(_WIN64)
       
    27 #  include <windows.h>
       
    28 #else
       
    29 #endif
       
    30 
       
    31 
       
    32 
       
    33 
       
    34