Index: tests/ForwardingTests.m ================================================================== --- tests/ForwardingTests.m +++ tests/ForwardingTests.m @@ -205,11 +205,11 @@ [t forwardingTargetTest: 0xDEADBEEF : -1 : 1.25 : 2.75] == 0x12345678) TEST(@"-[forwardingTargetForSelector:] variable arguments", - [([t forwardingTargetVarArgTest: FMT, ARGS]) isEqual: RESULT]) + [[t forwardingTargetVarArgTest: FMT, ARGS] isEqual: RESULT]) /* * Don't try fpret on Win64 if we don't have stret forwarding, as * long double is handled as a struct there. */ # if !defined(_WIN64) || defined(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET) Index: tests/OFArrayTests.m ================================================================== --- tests/OFArrayTests.m +++ tests/OFArrayTests.m @@ -92,11 +92,11 @@ TEST(@"-[indexOfObjectIdenticalTo:]", [a[1] indexOfObjectIdenticalTo: c_ary[1]] == 1) TEST(@"-[objectsInRange:]", [[a[0] objectsInRange: of_range(1, 2)] isEqual: - ([OFArray arrayWithObjects: c_ary[1], c_ary[2], nil])]) + [OFArray arrayWithObjects: c_ary[1], c_ary[2], nil]]) TEST(@"-[replaceObject:withObject:]", R([m[0] replaceObject: c_ary[1] withObject: c_ary[0]]) && [[m[0] objectAtIndex: 0] isEqual: c_ary[0]] && @@ -134,29 +134,29 @@ m[1] = [[a[0] mutableCopy] autorelease]; [m[1] addObject: @"qux"]; [m[1] addObject: @"last"]; TEST(@"-[reverse]", - R([m[1] reverse]) && [m[1] isEqual: ([OFArray arrayWithObjects: - @"last", @"qux", @"Baz", @"Bar", @"Foo", nil])]) + R([m[1] reverse]) && [m[1] isEqual: [OFArray arrayWithObjects: + @"last", @"qux", @"Baz", @"Bar", @"Foo", nil]]) m[1] = [[a[0] mutableCopy] autorelease]; [m[1] addObject: @"qux"]; [m[1] addObject: @"last"]; TEST(@"-[reversedArray]", - [[m[1] reversedArray] isEqual: ([OFArray arrayWithObjects: - @"last", @"qux", @"Baz", @"Bar", @"Foo", nil])]) + [[m[1] reversedArray] isEqual: [OFArray arrayWithObjects: + @"last", @"qux", @"Baz", @"Bar", @"Foo", nil]]) m[1] = [[a[0] mutableCopy] autorelease]; [m[1] addObject: @"0"]; [m[1] addObject: @"z"]; TEST(@"-[sortedArray]", - [[m[1] sortedArray] isEqual: ([OFArray arrayWithObjects: - @"0", @"Bar", @"Baz", @"Foo", @"z", nil])] && + [[m[1] sortedArray] isEqual: [OFArray arrayWithObjects: + @"0", @"Bar", @"Baz", @"Foo", @"z", nil]] && [[m[1] sortedArrayWithOptions: OF_ARRAY_SORT_DESCENDING] - isEqual: ([OFArray arrayWithObjects: - @"z", @"Foo", @"Baz", @"Bar", @"0", nil])]) + isEqual: [OFArray arrayWithObjects: + @"z", @"Foo", @"Baz", @"Bar", @"0", nil]]) EXPECT_EXCEPTION(@"Detect out of range in -[objectAtIndex:]", OFOutOfRangeException, [a[0] objectAtIndex: [a[0] count]]) EXPECT_EXCEPTION(@"Detect out of range in -[removeObjectsInRange:]", @@ -313,15 +313,15 @@ [[[m[0] filteredArrayUsingBlock: ^ bool (id obj, size_t idx) { return [obj isEqual: @"foo"]; }] description] isEqual: @"(\n\tfoo\n)"]) TEST(@"-[foldUsingBlock:]", - [([OFArray arrayWithObjects: [OFMutableString string], @"foo", - @"bar", @"baz", nil]) foldUsingBlock: ^ id (id left, id right) { + [[OFArray arrayWithObjects: [OFMutableString string], @"foo", + @"bar", @"baz", nil] foldUsingBlock: ^ id (id left, id right) { [left appendString: right]; return left; }]) #endif [pool drain]; } @end Index: tests/OFDictionaryTests.m ================================================================== --- tests/OFDictionaryTests.m +++ tests/OFDictionaryTests.m @@ -66,16 +66,16 @@ TEST(@"-[description]", [[dict description] isEqual: @"{\n\tkey1 = value1;\n\tkey2 = value2;\n}"]) TEST(@"-[allKeys]", - [[dict allKeys] isEqual: ([OFArray arrayWithObjects: keys[0], - keys[1], nil])]) + [[dict allKeys] isEqual: [OFArray arrayWithObjects: keys[0], + keys[1], nil]]) TEST(@"-[allObjects]", - [[dict allObjects] isEqual: ([OFArray arrayWithObjects: values[0], - values[1], nil])]) + [[dict allObjects] isEqual: [OFArray arrayWithObjects: values[0], + values[1], nil]]) TEST(@"-[keyEnumerator]", (key_enum = [dict keyEnumerator])) TEST(@"-[objectEnumerator]", (obj_enum = [dict objectEnumerator])) TEST(@"OFEnumerator's -[nextObject]", Index: tests/OFHTTPClientTests.m ================================================================== --- tests/OFHTTPClientTests.m +++ tests/OFHTTPClientTests.m @@ -111,11 +111,11 @@ (client = [OFHTTPClient client]) && R(request = [OFHTTPRequest requestWithURL: url]) && R(response = [client performRequest: request])) TEST(@"Normalization of server header keys", - ([[response headers] objectForKey: @"Content-Length"] != nil)) + [[response headers] objectForKey: @"Content-Length"] != nil) TEST(@"Correct parsing of data", (data = [response readDataArrayTillEndOfStream]) && [data count] == 7 && !memcmp([data items], "foo\nbar", 7)) Index: tests/OFObjectTests.m ================================================================== --- tests/OFObjectTests.m +++ tests/OFObjectTests.m @@ -93,12 +93,12 @@ o = [[[OFObject alloc] init] autorelease]; m = [[[MyObj alloc] init] autorelease]; TEST(@"-[description]", [[o description] isEqual: - ([OFString stringWithFormat: @"", o])] && + [OFString stringWithFormat: @"", o]] && [[m description] isEqual: - ([OFString stringWithFormat: @"", m])]) + [OFString stringWithFormat: @"", m]]) [pool drain]; } @end Index: tests/OFSetTests.m ================================================================== --- tests/OFSetTests.m +++ tests/OFSetTests.m @@ -60,11 +60,11 @@ (mutableSet = [[set1 mutableCopy] autorelease])); TEST(@"-[addObject:]", R([mutableSet addObject: @"baz"]) && [mutableSet isEqual: set2] && R([mutableSet addObject: @"y"]) && [mutableSet isEqual: - ([OFSet setWithObjects: @"foo", @"bar", @"baz", @"x", @"y", nil])]) + [OFSet setWithObjects: @"foo", @"bar", @"baz", @"x", @"y", nil]]) TEST(@"-[removeObject:]", R([mutableSet removeObject: @"y"]) && [mutableSet isEqual: set1]) TEST(@"-[isSubsetOfSet:]", @@ -73,25 +73,25 @@ ![set1 isSubsetOfSet: mutableSet]); TEST(@"-[intersectsSet:]", [(set2 = [OFSet setWithObjects: @"x", nil]) intersectsSet: set1] && [set1 intersectsSet: set2] && - ![([OFSet setWithObjects: @"1", nil]) intersectsSet: set1]); + ![[OFSet setWithObjects: @"1", nil] intersectsSet: set1]); TEST(@"-[minusSet:]", - R([mutableSet minusSet: ([OFSet setWithObjects: @"x", nil])]) && - [mutableSet isEqual: ([OFSet setWithObjects: @"baz", @"bar", nil])]) + R([mutableSet minusSet: [OFSet setWithObjects: @"x", nil]]) && + [mutableSet isEqual: [OFSet setWithObjects: @"baz", @"bar", nil]]) TEST(@"-[intersectSet:]", - R([mutableSet intersectSet: ([OFSet setWithObjects: @"baz", - nil])]) && [mutableSet isEqual: ([OFSet setWithObjects: @"baz", - nil])]) + R([mutableSet intersectSet: [OFSet setWithObjects: @"baz", + nil]]) && [mutableSet isEqual: [OFSet setWithObjects: @"baz", + nil]]) TEST(@"-[unionSet:]", - R([mutableSet unionSet: ([OFSet setWithObjects: @"x", @"bar", - nil])]) && [mutableSet isEqual: ([OFSet setWithObjects: @"baz", - @"bar", @"x", nil])]) + R([mutableSet unionSet: [OFSet setWithObjects: @"x", @"bar", + nil]]) && [mutableSet isEqual: [OFSet setWithObjects: @"baz", + @"bar", @"x", nil]]) #ifdef OF_HAVE_FAST_ENUMERATION ok = true; i = 0; Index: tests/TestsAppDelegate.h ================================================================== --- tests/TestsAppDelegate.h +++ tests/TestsAppDelegate.h @@ -15,16 +15,16 @@ */ #import "OFApplication.h" #import "OFXMLElementBuilder.h" -#define TEST(test, cond) \ +#define TEST(test, ...) \ { \ [self outputTesting: test \ inModule: module]; \ \ - if (cond) \ + if (__VA_ARGS__) \ [self outputSuccess: test \ inModule: module]; \ else { \ [self outputFailure: test \ inModule: module]; \ @@ -51,11 +51,11 @@ [self outputFailure: test \ inModule: module]; \ _fails++; \ } \ } -#define R(x) (x, 1) +#define R(...) (__VA_ARGS__, 1) @class OFString; @interface TestsAppDelegate: OFObject {