From 2ab2ddf5356117d16d1b0e9f78f9c74b6fdb2dc1 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 28 Jan 2015 22:42:47 +0100 Subject: Fix syntax highlighting for emoji et al. #2044 Voodoo magic provided by @Bibiko ;) --- UnitTests/SPParserUtilsTest.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'UnitTests') diff --git a/UnitTests/SPParserUtilsTest.m b/UnitTests/SPParserUtilsTest.m index 5066f8f7..994b166a 100644 --- a/UnitTests/SPParserUtilsTest.m +++ b/UnitTests/SPParserUtilsTest.m @@ -44,6 +44,9 @@ @implementation SPParserUtilsTest - (void)testUtf8strlen { + // NOTE!!: Those test do not verify that the utf8strlen() function works according to spec, + // but whether it produces the same results as NSString for the same input. + const char *empty = ""; NSString *emptyString = [NSString stringWithCString:empty encoding:NSUTF8StringEncoding]; STAssertEquals(utf8strlen(empty),[emptyString length], @"empty string"); @@ -52,8 +55,8 @@ // If any of those conditions fail, all of the following assumptions are moot. const char *charSeq = "\xF0\x9F\x8D\x8F"; //🍏 NSString *charString = [NSString stringWithCString:charSeq encoding:NSUTF8StringEncoding]; - STAssertEquals(strlen(charSeq), 4, @"assumption about storage for binary C string"); - STAssertEquals([charString length], 2, @"assumption about NSString internal storage of string"); + STAssertEquals(strlen(charSeq), (size_t)4, @"assumption about storage for binary C string"); + STAssertEquals([charString length], (NSUInteger)2, @"assumption about NSString internal storage of string"); const char *singleByteSeq = "Hello World!"; NSString *singleByteString = [NSString stringWithCString:singleByteSeq encoding:NSUTF8StringEncoding]; -- cgit v1.2.3