15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include "config.h"
#import "OFSetTests.h"
@interface CustomSet: OFSet
{
OFMutableSet *_set;
}
@end
@implementation OFSetTests
- (Class)setClass
{
return [CustomSet class];
|
|
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include "config.h"
#import "OFSetTests.h"
@interface CustomSet: OFSet
{
OFSet *_set;
}
@end
@implementation OFSetTests
- (Class)setClass
{
return [CustomSet class];
|
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
|
OTAssertEqualObjects([set valueForKey: @"@count"],
[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];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
|
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
OTAssertEqualObjects([set valueForKey: @"@count"],
[OFNumber numberWithInt: 3]);
}
@end
@implementation CustomSet
- (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;
}
return self;
}
|