Test.h
changeset 20 5a71993a1a70
parent 12 66b870428f85
child 22 a9da6c5d3f7c
     1.1 --- a/Test.h	Sat May 31 11:26:17 2008 -0700
     1.2 +++ b/Test.h	Sat Mar 28 09:36:46 2009 -0700
     1.3 @@ -66,6 +66,7 @@
     1.4                                      IN_SEGMENT_NORETURN(Logging) {_AssertFailed(nil, _name, __FILE__, __LINE__,\
     1.5                                                          #COND,##MSG,NULL);} } }while(0)
     1.6  
     1.7 +// AssertEqual is for Obj-C objects
     1.8  #define AssertEqual(VAL,EXPECTED)   do{ id _val = VAL, _expected = EXPECTED;\
     1.9                                          Assert(_val==_expected || [_val isEqual: _expected], @"Unexpected value for %s: %@ (expected %@)", #VAL,_val,_expected); \
    1.10                                      }while(0)
    1.11 @@ -74,11 +75,10 @@
    1.12                                      }while(0)
    1.13  
    1.14  // AssertEq is for scalars (int, float...)
    1.15 -// Note: "typeof()" builtin function requires settingn C language dialect to GNU99.
    1.16 -#define AssertEq(VAL,EXPECTED)  do{ typeof(VAL) _val = VAL; typeof(EXPECTED) _expected = EXPECTED;\
    1.17 +#define AssertEq(VAL,EXPECTED)  do{ __typeof(VAL) _val = VAL; __typeof(EXPECTED) _expected = EXPECTED;\
    1.18                                      Assert(_val==_expected, @"Unexpected value for %s: %@ (expected %@)", #VAL,$object(_val),$object(_expected)); \
    1.19                                  }while(0)
    1.20 -#define CAssertEq(VAL,EXPECTED) do{ typeof(VAL) _val = VAL; typeof(EXPECTED) _expected = EXPECTED;\
    1.21 +#define CAssertEq(VAL,EXPECTED) do{ __typeof(VAL) _val = VAL; __typeof(EXPECTED) _expected = EXPECTED;\
    1.22                                      CAssert(_val==_expected, @"Unexpected value for %s: %@ (expected %@)", #VAL,$object(_val),$object(_expected)); \
    1.23                                  }while(0)
    1.24