diff -r 66b870428f85 -r 1af6415650bf Test.h --- a/Test.h Sat May 31 11:26:17 2008 -0700 +++ b/Test.h Tue Jun 17 14:57:48 2008 -0700 @@ -66,6 +66,7 @@ IN_SEGMENT_NORETURN(Logging) {_AssertFailed(nil, _name, __FILE__, __LINE__,\ #COND,##MSG,NULL);} } }while(0) +// AssertEqual is for Obj-C objects #define AssertEqual(VAL,EXPECTED) do{ id _val = VAL, _expected = EXPECTED;\ Assert(_val==_expected || [_val isEqual: _expected], @"Unexpected value for %s: %@ (expected %@)", #VAL,_val,_expected); \ }while(0) @@ -74,11 +75,10 @@ }while(0) // AssertEq is for scalars (int, float...) -// Note: "typeof()" builtin function requires settingn C language dialect to GNU99. -#define AssertEq(VAL,EXPECTED) do{ typeof(VAL) _val = VAL; typeof(EXPECTED) _expected = EXPECTED;\ +#define AssertEq(VAL,EXPECTED) do{ __typeof(VAL) _val = VAL; __typeof(EXPECTED) _expected = EXPECTED;\ Assert(_val==_expected, @"Unexpected value for %s: %@ (expected %@)", #VAL,$object(_val),$object(_expected)); \ }while(0) -#define CAssertEq(VAL,EXPECTED) do{ typeof(VAL) _val = VAL; typeof(EXPECTED) _expected = EXPECTED;\ +#define CAssertEq(VAL,EXPECTED) do{ __typeof(VAL) _val = VAL; __typeof(EXPECTED) _expected = EXPECTED;\ CAssert(_val==_expected, @"Unexpected value for %s: %@ (expected %@)", #VAL,$object(_val),$object(_expected)); \ }while(0)