14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
*/
#include "config.h"
#import "OTAppDelegate.h"
#import "OFColor.h"
#import "OFSet.h"
#import "OFStdIOStream.h"
#import "OFValue.h"
#import "OTTestCase.h"
#import "OTAssertionFailedException.h"
|
>
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
*/
#include "config.h"
#import "OTAppDelegate.h"
#import "OFColor.h"
#import "OFMethodSignature.h"
#import "OFSet.h"
#import "OFStdIOStream.h"
#import "OFValue.h"
#import "OTTestCase.h"
#import "OTAssertionFailedException.h"
|
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
return nil;
@try {
tests = [OFMutableSet set];
for (Method *iter = methods; *iter != NULL; iter++) {
SEL selector = method_getName(*iter);
if (selector == NULL)
continue;
if (strncmp(sel_getName(selector), "test", 4) == 0)
[tests addObject:
[OFValue valueWithPointer: selector]];
}
} @finally {
OFFreeMemory(methods);
}
if (class_getSuperclass(class) != Nil)
[tests unionSet:
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
|
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
return nil;
@try {
tests = [OFMutableSet set];
for (Method *iter = methods; *iter != NULL; iter++) {
SEL selector = method_getName(*iter);
void *pool;
OFMethodSignature *sig;
if (selector == NULL)
continue;
if (strncmp(sel_getName(selector), "test", 4) != 0)
continue;
pool = objc_autoreleasePoolPush();
sig = [OFMethodSignature signatureWithObjCTypes:
method_getTypeEncoding(*iter)];
if (strcmp(sig.methodReturnType, "v") == 0 &&
sig.numberOfArguments == 2 &&
strcmp([sig argumentTypeAtIndex: 0], "@") == 0 &&
strcmp([sig argumentTypeAtIndex: 1], ":") == 0)
[tests addObject:
[OFValue valueWithPointer: selector]];
objc_autoreleasePoolPop(pool);
}
} @finally {
OFFreeMemory(methods);
}
if (class_getSuperclass(class) != Nil)
[tests unionSet:
|