Differences From Artifact [19f0fe9122]:
- File
tests/OFArrayTests.m
— part of check-in
[008be86a16]
at
2012-03-12 11:54:22
on branch trunk
— OFArray: +[arrayWithCArray:length:] -> +[arrayWithObjects:count:].
This is required for the new array literals. (user: js, size: 8884) [annotate] [blame] [check-ins using] [more...]
To Artifact [550ae86871]:
- File tests/OFArrayTests.m — part of check-in [6f0ef1c5e1] at 2012-06-06 13:14:23 on branch trunk — Remove -[OFMutableArray removeNObjects:]. (user: js, size: 8732) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
55 56 57 58 59 60 61 | TEST(@"-[description]", [[a[0] description ]isEqual: @"(\n\tFoo,\n\tBar,\n\tBaz\n)"]) TEST(@"-[addObject:]", R([m[0] addObject: c_ary[0]]) && R([m[0] addObject: c_ary[2]])) | | | | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | TEST(@"-[description]", [[a[0] description ]isEqual: @"(\n\tFoo,\n\tBar,\n\tBaz\n)"]) TEST(@"-[addObject:]", R([m[0] addObject: c_ary[0]]) && R([m[0] addObject: c_ary[2]])) TEST(@"-[insertObject:atIndex:]", R([m[0] insertObject: c_ary[1] atIndex: 1])) TEST(@"-[count]", [m[0] count] == 3 && [a[0] count] == 3 && [a[1] count] == 3) TEST(@"-[isEqual:]", [m[0] isEqual: a[0]] && [a[0] isEqual: a[1]]) TEST(@"-[objectAtIndex:]", |
︙ | ︙ | |||
119 120 121 122 123 124 125 | 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) | < < < < < | 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 | 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]]) | | | > | 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 | } } @catch (OFEnumerationMutationException *e) { ok = YES; } TEST(@"Detection of mutation during Fast Enumeration", ok) | | | 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]; |
︙ | ︙ |