Index: tests/OFArray/OFArray.m ================================================================== --- tests/OFArray/OFArray.m +++ tests/OFArray/OFArray.m @@ -17,22 +17,19 @@ #import "OFArray.h" #import "OFExceptions.h" #define CATCH_EXCEPTION(code, exception) \ - caught = NO; \ @try { \ code; \ + \ + puts("NOT CAUGHT!"); \ + return 1; \ } @catch (exception *e) { \ - caught = YES; \ puts("CAUGHT! Error string was:"); \ puts([e cString]); \ puts("Resuming..."); \ - } \ - if (!caught) { \ - puts("NOT CAUGHT!"); \ - return 1; \ } const char *str = "Hallo!"; #define TEST(type) \ @@ -96,11 +93,11 @@ CATCH_EXCEPTION([a item: [a items]], OFOutOfRangeException); \ \ [a free]; \ \ puts("Creating new array and using it to build a string..."); \ - a = [type newWithItemSize: 1]; \ + a = [type newWithItemSize: 1]; \ \ for (i = 0; i < strlen(str); i++) \ [a add: (void*)(str + i)]; \ [a add: ""]; \ \ @@ -114,11 +111,10 @@ [a free]; int main() { - BOOL caught; id a; void *p, *q; size_t i; puts("== TESTING OFArray =="); Index: tests/OFObject/OFObject.m ================================================================== --- tests/OFObject/OFObject.m +++ tests/OFObject/OFObject.m @@ -16,29 +16,25 @@ #import "OFObject.h" #import "OFExceptions.h" #define CATCH_EXCEPTION(code, exception) \ - caught = NO; \ @try { \ code; \ + \ + puts("NOT CAUGHT!"); \ + return 1; \ } @catch (exception *e) { \ - caught = YES; \ puts("CAUGHT! Error string was:"); \ puts([e cString]); \ puts("Resuming..."); \ - } \ - if (!caught) { \ - puts("NOT CAUGHT!"); \ - return 1; \ } int main() { OFObject *obj = [OFObject new]; - BOOL caught; void *p, *q, *r; /* Test freeing memory not allocated by obj */ puts("Freeing memory not allocated by object (should throw an " "exception)...");