35
36
37
38
39
40
41
42
43
44
45
46
|
}
@end
@implementation TestsAppDelegate (RuntimeARCTests)
- (void)runtimeARCTests
{
id object;
EXPECT_EXCEPTION(@"Exceptions in init", OFException,
object = [[RuntimeARCTest alloc] init])
}
@end
|
>
|
>
>
>
>
>
>
>
|
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
}
@end
@implementation TestsAppDelegate (RuntimeARCTests)
- (void)runtimeARCTests
{
id object;
__weak id weak;
EXPECT_EXCEPTION(@"Exceptions in init", OFException,
object = [[RuntimeARCTest alloc] init])
object = [[OFObject alloc] init];
weak = object;
TEST(@"weakly referencing an object", weak == object)
object = nil;
TEST(@"weak references becoming nil", weak == nil)
}
@end
|