Skip to content

Commit

Permalink
Improve constant string support in tests.
Browse files Browse the repository at this point in the history
This makes no difference to existing tests, but is needed for the ones
in #138
  • Loading branch information
davidchisnall committed May 2, 2020
1 parent ec5c0bc commit be6483d
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion Test/Test.m
Expand Up @@ -6,7 +6,31 @@
#include <assert.h>
#include "Test.h"

@implementation NSConstantString @end
@implementation NSConstantString
- (void)dealloc
{
// Silence a warning
if (0)
{
[super dealloc];
}
}
@end

@interface NSTinyString : NSConstantString @end
@implementation NSTinyString
+ (void)load
{
if (sizeof(void*) > 4)
{
objc_registerSmallObjectClass_np(self, 4);
}
}
- (Class)class { return [NSTinyString class]; }
- (id)retain { return self; }
- (id)autorelease { return self; }
- (void)release {}
@end

@implementation Test
+ (Class)class { return self; }
Expand Down

0 comments on commit be6483d

Please sign in to comment.