Index: new_tests/OFArrayTests.m ================================================================== --- new_tests/OFArrayTests.m +++ new_tests/OFArrayTests.m @@ -17,11 +17,11 @@ #import "OFArrayTests.h" @interface CustomArray: OFArray { - OFMutableArray *_array; + OFArray *_array; } @end static OFString *const cArray[] = { @"Foo", @@ -277,46 +277,17 @@ [OFNumber numberWithInt: 2]); } @end @implementation CustomArray -- (instancetype)init -{ - self = [super init]; - - @try { - _array = [[OFMutableArray alloc] init]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObject: (id)object arguments: (va_list)arguments -{ - self = [super init]; - - @try { - _array = [[OFMutableArray alloc] initWithObject: object - arguments: arguments]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { self = [super init]; @try { - _array = [[OFMutableArray alloc] initWithObjects: objects - count: count]; + _array = [[OFArray alloc] initWithObjects: objects + count: count]; } @catch (id e) { [self release]; @throw e; } Index: new_tests/OFMutableArrayTests.m ================================================================== --- new_tests/OFMutableArrayTests.m +++ new_tests/OFMutableArrayTests.m @@ -172,39 +172,10 @@ [OFIRI IRIWithString: @"http://qux.quxqux:1234/"], nil])); } @end @implementation CustomMutableArray -- (instancetype)init -{ - self = [super init]; - - @try { - _array = [[OFMutableArray alloc] init]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObject: (id)object arguments: (va_list)arguments -{ - self = [super init]; - - @try { - _array = [[OFMutableArray alloc] initWithObject: object - arguments: arguments]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { self = [super init]; @try { Index: new_tests/OFMutableSetTests.m ================================================================== --- new_tests/OFMutableSetTests.m +++ new_tests/OFMutableSetTests.m @@ -91,59 +91,17 @@ OTAssertEqual(_mutableSet.count, 0); } @end @implementation CustomMutableSet -- (instancetype)init -{ - self = [super init]; - - @try { - _set = [[OFMutableSet alloc] init]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithSet: (OFSet *)set -{ - self = [super init]; - - @try { - _set = [[OFMutableSet alloc] initWithSet: set]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithArray: (OFArray *)array -{ - self = [super init]; - - @try { - _set = [[OFMutableSet alloc] initWithArray: array]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments -{ - self = [super init]; - - @try { - _set = [[OFMutableSet alloc] initWithObject: firstObject - arguments: arguments]; +- (instancetype)initWithObjects: (id const *)objects count: (size_t)count +{ + self = [super init]; + + @try { + _set = [[OFMutableSet alloc] initWithObjects: objects + count: count]; } @catch (id e) { [self release]; @throw e; } Index: new_tests/OFSetTests.m ================================================================== --- new_tests/OFSetTests.m +++ new_tests/OFSetTests.m @@ -17,11 +17,11 @@ #import "OFSetTests.h" @interface CustomSet: OFSet { - OFMutableSet *_set; + OFSet *_set; } @end @implementation OFSetTests - (Class)setClass @@ -186,59 +186,16 @@ [OFNumber numberWithInt: 3]); } @end @implementation CustomSet -- (instancetype)init -{ - self = [super init]; - - @try { - _set = [[OFMutableSet alloc] init]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithSet: (OFSet *)set -{ - self = [super init]; - - @try { - _set = [[OFMutableSet alloc] initWithSet: set]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithArray: (OFArray *)array -{ - self = [super init]; - - @try { - _set = [[OFMutableSet alloc] initWithArray: array]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments -{ - self = [super init]; - - @try { - _set = [[OFMutableSet alloc] initWithObject: firstObject - arguments: arguments]; +- (instancetype)initWithObjects: (id const *)objects count: (size_t)count +{ + self = [super init]; + + @try { + _set = [[OFSet alloc] initWithObjects: objects count: count]; } @catch (id e) { [self release]; @throw e; }