ObjFW  Diff

Differences From Artifact [cec219c44a]:

To Artifact [ee44914ba7]:


23
24
25
26
27
28
29
30

31
32
33
34
35
36
37
23
24
25
26
27
28
29

30
31
32
33
34
35
36
37







-
+








static OFString *module = @"OFData";
const char *str = "Hello!";

@implementation TestsAppDelegate (OFDataTests)
- (void)dataTests
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	void *pool = objc_autoreleasePoolPush();
	OFMutableData *mutable;
	OFData *immutable;
	void *raw[2];
	of_range_t range;

	TEST(@"+[dataWithItemSize:]",
	    (mutable = [OFMutableData dataWithItemSize: 4096]))
204
205
206
207
208
209
210
211

212
213
204
205
206
207
208
209
210

211
212
213







-
+


	    OFOutOfRangeException, [mutable addItems: raw[0]
					       count: SIZE_MAX])

	EXPECT_EXCEPTION(@"Detect out of range in -[removeItemsInRange:]",
	    OFOutOfRangeException,
	    [mutable removeItemsInRange: of_range(mutable.count, 1)])

	[pool drain];
	objc_autoreleasePoolPop(pool);
}
@end