Differences From Artifact [202f1a62ea]:
- File tests/OFBlockTests.m — part of check-in [cda44767f4] at 2011-03-24 19:42:30 on branch trunk — Get rid of OFExceptions.h. (user: js, size: 2197) [annotate] [blame] [check-ins using]
To Artifact [0518f13692]:
- File
tests/OFBlockTests.m
— part of check-in
[7caa622124]
at
2011-07-18 03:01:36
on branch 0.5
— Fix reference counting for blocks.
Hopefully, there is no weird situation left where it fails... (user: js, size: 2257) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
18 19 20 21 22 23 24 | #import "OFBlock.h" #import "OFString.h" #import "OFAutoreleasePool.h" #if defined(OF_OBJFW_RUNTIME) # include <objfw-rt.h> | | | | | | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #import "OFBlock.h" #import "OFString.h" #import "OFAutoreleasePool.h" #if defined(OF_OBJFW_RUNTIME) # include <objfw-rt.h> #elif defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME) # include <objc/runtime.h> #elif defined(OF_OLD_GNU_RUNTIME) # include <objc/objc-api.h> #endif #if defined(OF_OLD_GNU_RUNTIME) || defined(OF_OBJFW_RUNTIME) # define objc_getClass objc_get_class #endif #import "TestsAppDelegate.h" |
︙ | ︙ | |||
57 58 59 60 61 62 63 | (Class)&_NSConcreteGlobalBlock == objc_getClass("OFGlobalBlock") && [g isKindOfClass: [OFBlock class]]) TEST(@"Class of a malloc block", (Class)&_NSConcreteMallocBlock == objc_getClass("OFMallocBlock")) TEST(@"Copying a stack block", | > | | | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | (Class)&_NSConcreteGlobalBlock == objc_getClass("OFGlobalBlock") && [g isKindOfClass: [OFBlock class]]) TEST(@"Class of a malloc block", (Class)&_NSConcreteMallocBlock == objc_getClass("OFMallocBlock")) TEST(@"Copying a stack block", (m = [[s copy] autorelease]) && [m class] == objc_getClass("OFMallocBlock") && [m isKindOfClass: [OFBlock class]]) TEST(@"Copying a global block", (id)g == [[g copy] autorelease]) TEST(@"Copying a malloc block", (id)m == [m copy] && [m retainCount] == 2) TEST(@"Autorelease a stack block", R([s autorelease])) TEST(@"Autorelease a global block", R([g autorelease])) TEST(@"Autorelease a malloc block", R([m autorelease])) [pool drain]; } @end |