ObjFW  Diff

Differences From Artifact [1073eae76a]:

To Artifact [550ae86871]:


119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137

	TEST(@"-[removeObject:]",
	    R([m[0] removeObject: c_ary[0]]) && [m[0] count] == 2)

	TEST(@"-[removeObjectIdenticalTo:]",
	    R([m[0] removeObjectIdenticalTo: c_ary[2]]) && [m[0] count] == 1)

	[m[0] addObject: c_ary[0]];
	[m[0] addObject: c_ary[1]];
	TEST(@"-[removeNObjects:]", R([m[0] removeNObjects: 2]) &&
	    [m[0] count] == 1 && [[m[0] objectAtIndex: 0] isEqual: c_ary[0]])

	m[1] = [[a[0] mutableCopy] autorelease];
	TEST(@"-[removeObjectAtIndex:]", R([m[1] removeObjectAtIndex: 1]) &&
	    [m[1] count] == 2 && [[m[1] objectAtIndex: 1] isEqual: c_ary[2]])

	m[1] = [[a[0] mutableCopy] autorelease];
	TEST(@"-[removeObjectsInRange:]",
	    R([m[1] removeObjectsInRange: of_range(0, 2)]) &&







<
<
<
<
<







119
120
121
122
123
124
125





126
127
128
129
130
131
132

	TEST(@"-[removeObject:]",
	    R([m[0] removeObject: c_ary[0]]) && [m[0] count] == 2)

	TEST(@"-[removeObjectIdenticalTo:]",
	    R([m[0] removeObjectIdenticalTo: c_ary[2]]) && [m[0] count] == 1)






	m[1] = [[a[0] mutableCopy] autorelease];
	TEST(@"-[removeObjectAtIndex:]", R([m[1] removeObjectAtIndex: 1]) &&
	    [m[1] count] == 2 && [[m[1] objectAtIndex: 1] isEqual: c_ary[2]])

	m[1] = [[a[0] mutableCopy] autorelease];
	TEST(@"-[removeObjectsInRange:]",
	    R([m[1] removeObjectsInRange: of_range(0, 2)]) &&
157
158
159
160
161
162
163
164
165

166
167
168
169
170
171
172
	TEST(@"-[sortedArray]",
	    [[m[1] sortedArray] isEqual: ([OFArray arrayWithObjects:
	    @"0", @"Bar", @"Baz", @"Foo", @"z", nil])])

	EXPECT_EXCEPTION(@"Detect out of range in -[objectAtIndex:]",
	    OFOutOfRangeException, [a[0] objectAtIndex: [a[0] count]])

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


	TEST(@"-[componentsJoinedByString:]",
	    (a[1] = [OFArray arrayWithObjects: @"foo", @"bar", @"baz", nil]) &&
	    [[a[1] componentsJoinedByString: @" "] isEqual: @"foo bar baz"] &&
	    (a[1] = [OFArray arrayWithObject: @"foo"]) &&
	    [[a[1] componentsJoinedByString: @" "] isEqual: @"foo"])








|
|
>







152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
	TEST(@"-[sortedArray]",
	    [[m[1] sortedArray] isEqual: ([OFArray arrayWithObjects:
	    @"0", @"Bar", @"Baz", @"Foo", @"z", nil])])

	EXPECT_EXCEPTION(@"Detect out of range in -[objectAtIndex:]",
	    OFOutOfRangeException, [a[0] objectAtIndex: [a[0] count]])

	EXPECT_EXCEPTION(@"Detect out of range in -[removeObjectsInRange:]",
	    OFOutOfRangeException, [m[0] removeObjectsInRange:
		of_range(0, [m[0] count] + 1)])

	TEST(@"-[componentsJoinedByString:]",
	    (a[1] = [OFArray arrayWithObjects: @"foo", @"bar", @"baz", nil]) &&
	    [[a[1] componentsJoinedByString: @" "] isEqual: @"foo bar baz"] &&
	    (a[1] = [OFArray arrayWithObject: @"foo"]) &&
	    [[a[1] componentsJoinedByString: @" "] isEqual: @"foo"])

230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
		}
	} @catch (OFEnumerationMutationException *e) {
		ok = YES;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)

	[m[0] removeNObjects: 1];
#endif

#ifdef OF_HAVE_BLOCKS
	{
		__block BOOL ok = YES;
		__block size_t count = 0;
		OFArray *cmp = a[0];







|







226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
		}
	} @catch (OFEnumerationMutationException *e) {
		ok = YES;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)

	[m[0] removeLastObject];
#endif

#ifdef OF_HAVE_BLOCKS
	{
		__block BOOL ok = YES;
		__block size_t count = 0;
		OFArray *cmp = a[0];