Differences From Artifact [8332694435]:
- File tests/OFArrayTests.m — part of check-in [a855618045] at 2011-08-03 00:30:04 on branch trunk — Make OFArray an abstract class. (user: js, size: 8296) [annotate] [blame] [check-ins using]
To Artifact [723d9a0843]:
- File
tests/OFArrayTests.m
— part of check-in
[e1e7ffa903]
at
2011-09-22 23:25:42
on branch trunk
— Exceptions are now autoreleased.
This is safe as an "exception loop" can't happen, since if allocating
an exception fails, it throws an OFAllocFailedException which is
preallocated and can always be thrown.So, the worst case would be that an autorelease of an exception fails,
triggering an OFOutOfMemoryException for which there is no memory,
resulting in an OFAllocFailedException to be thrown. (user: js, size: 8249) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
208 209 210 211 212 213 214 | for (OFString *s in m[0]) { if (i == 0) [m[0] addObject: @""]; i++; } } @catch (OFEnumerationMutationException *e) { ok = YES; | < | 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | for (OFString *s in m[0]) { if (i == 0) [m[0] addObject: @""]; i++; } } @catch (OFEnumerationMutationException *e) { ok = YES; } TEST(@"Detection of mutation during Fast Enumeration", ok) [m[0] removeNObjects: 1]; #endif |
︙ | ︙ | |||
245 246 247 248 249 250 251 | @try { [a2 enumerateObjectsUsingBlock: ^ (id obj, size_t idx, BOOL *stop) { [a2 removeObjectAtIndex: idx]; }]; } @catch (OFEnumerationMutationException *e) { ok = YES; | < < | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | @try { [a2 enumerateObjectsUsingBlock: ^ (id obj, size_t idx, BOOL *stop) { [a2 removeObjectAtIndex: idx]; }]; } @catch (OFEnumerationMutationException *e) { ok = YES; } @catch (OFOutOfRangeException *e) { /* * Out of bounds access due to enumeration not being * detected. */ } TEST(@"Detection of mutation during enumeration using blocks", ok) } TEST(@"-[replaceObjectsUsingBlock:]", |
︙ | ︙ |