Differences From Artifact [a7923e2912]:
- File tests/OFBlockTests.m — part of check-in [39cb19595d] at 2010-12-25 19:31:43 on branch trunk — Add OFDate. (user: js, size: 1900) [annotate] [blame] [check-ins using]
To Artifact [a4019c97d2]:
- File
tests/OFBlockTests.m
— part of check-in
[86c967829f]
at
2010-12-27 01:15:36
on branch trunk
— Move global block to global scope.
Some old clang revisions do not create global blocks in local scopes.
Verified with clang r90573. (user: js, size: 1907) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #import "TestsAppDelegate.h" static OFString *module = @"OFBlock"; extern void *_NSConcreteStackBlock; extern void *_NSConcreteGlobalBlock; extern void *_NSConcreteMallocBlock; @implementation TestsAppDelegate (OFBlockTests) - (void)blockTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; __block int x; void (^s)() = ^ { x = 0; }; | > > < | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #import "TestsAppDelegate.h" static OFString *module = @"OFBlock"; extern void *_NSConcreteStackBlock; extern void *_NSConcreteGlobalBlock; extern void *_NSConcreteMallocBlock; static void (^g)() = ^ {}; @implementation TestsAppDelegate (OFBlockTests) - (void)blockTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; __block int x; void (^s)() = ^ { x = 0; }; void (^m)(); TEST(@"Class of stack block", (Class)&_NSConcreteStackBlock == objc_getClass("OFStackBlock") && [s isKindOfClass: [OFBlock class]]) TEST(@"Class of global block", |
︙ | ︙ |