Skip to content

Commit be6483d

Browse files
committed
Improve constant string support in tests.
This makes no difference to existing tests, but is needed for the ones in #138
1 parent ec5c0bc commit be6483d

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

Test/Test.m

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,31 @@
66
#include <assert.h>
77
#include "Test.h"
88

9-
@implementation NSConstantString @end
9+
@implementation NSConstantString
10+
- (void)dealloc
11+
{
12+
// Silence a warning
13+
if (0)
14+
{
15+
[super dealloc];
16+
}
17+
}
18+
@end
19+
20+
@interface NSTinyString : NSConstantString @end
21+
@implementation NSTinyString
22+
+ (void)load
23+
{
24+
if (sizeof(void*) > 4)
25+
{
26+
objc_registerSmallObjectClass_np(self, 4);
27+
}
28+
}
29+
- (Class)class { return [NSTinyString class]; }
30+
- (id)retain { return self; }
31+
- (id)autorelease { return self; }
32+
- (void)release {}
33+
@end
1034

1135
@implementation Test
1236
+ (Class)class { return self; }

0 commit comments

Comments
 (0)