OSX compatibility fixes for zero width space character and initialising an NSURL

with bad strings.
This commit is contained in:
Richard Frith-Macdonald 2018-01-26 12:53:47 +00:00
parent 0e12e226c9
commit 7045f84acc
21 changed files with 31196 additions and 30499 deletions

View file

@ -15,6 +15,8 @@ int main()
NSString *str;
NSNumber *num;
unsigned i;
unichar bad[] = {'h', 't', 't', 'p', ':', '/', '/', 'w', 'w', 'w',
'.', 'w', '3', '.', 'o', 'r', 'g', '/', 0x200B};
unichar u = 163;
unichar buf[256];
@ -27,6 +29,10 @@ int main()
TEST_FOR_CLASS(@"NSURL", [NSURL URLWithString: @"http://www.w3.org/"],
"NSURL +URLWithString: returns an NSURL");
str = [NSString stringWithCharacters: bad length: sizeof(bad)/sizeof(*bad)];
url = [NSURL URLWithString: str];
PASS(nil == url, "Bad characters result in nil");
str = [NSString stringWithCharacters: &u length: 1];
url = [NSURL fileURLWithPath: str];
str = [[[NSFileManager defaultManager] currentDirectoryPath]