ObjFW  Diff

Differences From Artifact [f55dde2843]:

To Artifact [106dfbcd0f]:


14
15
16
17
18
19
20
21

22
23
24
25
26
27


28
29
30
31
32
33
34
14
15
16
17
18
19
20

21
22
23
24
25


26
27
28
29
30
31
32
33
34







-
+




-
-
+
+







#include <string.h>

#import "OFDataArray.h"
#import "OFAutoreleasePool.h"
#import "OFString.h"
#import "OFExceptions.h"

#import "main.h"
#import "TestsAppDelegate.h"

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

static void
do_tests(Class class)
@implementation TestsAppDelegate (OFDataArrayTests)
- (void)dataArrayTestsWithClass: (Class)class
{
	OFDataArray *array[4];
	void *data[2];
	Class other;

	TEST(@"+[dataArrayWithItemSize:]",
	    (array[0] = [class dataArrayWithItemSize: 4096]))
107
108
109
110
111
112
113
114

115
116
117
118
119
120

121
122
123

124
125
126

107
108
109
110
111
112
113

114

115
116
117
118

119
120
121

122
123
124
125
126







-
+
-




-
+


-
+



+
					    fromCArray: NULL])

	EXPECT_EXCEPTION(@"Detect out of range in -[removeNItems:]",
	    OFOutOfRangeException,
	    [array[0] removeNItems: [array[0] count] + 1])
}

void
- (void)dataArrayTests
dataarray_tests()
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];

	module = @"OFDataArray";
	do_tests([OFDataArray class]);
	[self dataArrayTestsWithClass: [OFDataArray class]];

	module = @"OFBigDataArray";
	do_tests([OFBigDataArray class]);
	[self dataArrayTestsWithClass: [OFBigDataArray class]];

	[pool drain];
}
@end