58
59
60
61
62
63
64
65
66
67
68
|
[[a[2] objectAtIndex: 1] isEqual: c_ary[1]] &&
[[a[2] objectAtIndex: 2] isEqual: c_ary[2]])
TEST(@"-[removeNObjects:]", [a[0] removeNObjects: 2] &&
[a[0] count] == 1 && [[a[0] objectAtIndex: 0] isEqual: c_ary[0]])
EXPECT_EXCEPTION(@"Detect out of range in -[objectAtIndex:]",
OFOutOfRangeException, [a[0] objectAtIndex: 1])
[pool release];
}
|
|
>
>
>
|
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
[[a[2] objectAtIndex: 1] isEqual: c_ary[1]] &&
[[a[2] objectAtIndex: 2] isEqual: c_ary[2]])
TEST(@"-[removeNObjects:]", [a[0] removeNObjects: 2] &&
[a[0] count] == 1 && [[a[0] objectAtIndex: 0] isEqual: c_ary[0]])
EXPECT_EXCEPTION(@"Detect out of range in -[objectAtIndex:]",
OFOutOfRangeException, [a[0] objectAtIndex: [a[0] count]])
EXPECT_EXCEPTION(@"Detect out of range in -[removeNItems:]",
OFOutOfRangeException, [a[0] removeNObjects: [a[0] count] + 1])
[pool release];
}
|