Skip to content

Commit 27a27fe

Browse files
committed
Fix test
1 parent ad00633 commit 27a27fe

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/stdlib/Inputs/NSSlowTaggedLocalizedString/NSSlowTaggedLocalizedString.m

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
#import "NSSlowTaggedLocalizedString.h"
33
#import <dlfcn.h>
44
#import <objc/runtime.h>
5+
#import <Foundation/Foundation.h>
56

6-
//If and when CF starts linking Swift we may need to rethink this
7-
#import <CoreFoundation/CoreFoundation.h>
7+
/*
8+
This horrific mess is simulating the new-in-macOS-Ventura tagged pointer strings,
9+
which can have lengths >15 characters, which can cause problems in SmallString,
10+
which used to assume that would never happen. Once CI is running on Ventura or
11+
later, this can be rewritten to use a regular NSLocalizedString.
12+
*/
813

914
@implementation NSSlowTaggedLocalizedString
1015

11-
typedef struct _NSRange {
12-
uint64_t location;
13-
uint64_t length;
14-
} NSRange;
15-
1616
+ (instancetype) createTestString {
1717
#if __LP64__
1818
static dispatch_once_t onceToken;
1919
dispatch_once(&onceToken, ^{
20+
[[[NSString alloc] init] release]; //Make sure NSString is initialized
2021
Class tagClass = objc_lookUpClass("NSTaggedPointerString");
2122
Class ourClass = [NSSlowTaggedLocalizedString class];
2223

0 commit comments

Comments
 (0)