From d2695bab82ee29e31a8cfb724a5481943786ca4f Mon Sep 17 00:00:00 2001 From: Patrice Levesque Date: Wed, 10 Feb 2016 11:29:43 -0500 Subject: [PATCH] Better fix for *_stringForCharacterAtIndex's missing prototype --- Tests/Unit/SOGoTest.h | 2 -- Tests/Unit/SOGoTest.m | 60 +++++++++++++++++++++---------------------- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/Tests/Unit/SOGoTest.h b/Tests/Unit/SOGoTest.h index 119cb7e34..ed49be707 100644 --- a/Tests/Unit/SOGoTest.h +++ b/Tests/Unit/SOGoTest.h @@ -54,8 +54,6 @@ - (BOOL) run; -NSString *_stringForCharacterAtIndex(NSUInteger index, NSString *str, NSUInteger length); - - (NSString*) stringFromDiffBetween: (NSString*) str1 and: (NSString*) str2; @end diff --git a/Tests/Unit/SOGoTest.m b/Tests/Unit/SOGoTest.m index c5e4dbec1..408ca77d6 100644 --- a/Tests/Unit/SOGoTest.m +++ b/Tests/Unit/SOGoTest.m @@ -31,6 +31,36 @@ static NSString *SOGoTestAssertException = @"SOGoTestAssertException"; +/* Helper function for diffForString:andString */ +static NSString *_stringForCharacterAtIndex(NSUInteger index, NSString *str, NSUInteger length) +{ + NSString *chrStr; + unichar chr; + if (index < length) + { + chr = [str characterAtIndex: index]; + if (isprint(chr)) + { + chrStr = [NSString stringWithFormat: @"%c", chr]; + } + else + { + if (chr == 10) + chrStr = @"[NL]"; + else if (chr == 0) + chrStr = @"[\0]"; + else + chrStr = [NSString stringWithFormat: @"[NP: %u]", chr]; + } + } + else + { + chrStr = @"[none]"; + } + + return chrStr; +} + @implementation SOGoTest + (NSArray *) allTestClasses @@ -186,36 +216,6 @@ static NSString *SOGoTestAssertException = @"SOGoTestAssertException"; return YES; } -/* Helper function for diffForString:andString */ -NSString *_stringForCharacterAtIndex(NSUInteger index, NSString *str, NSUInteger length) -{ - NSString *chrStr; - unichar chr; - if (index < length) - { - chr = [str characterAtIndex: index]; - if (isprint(chr)) - { - chrStr = [NSString stringWithFormat: @"%c", chr]; - } - else - { - if (chr == 10) - chrStr = @"[NL]"; - else if (chr == 0) - chrStr = @"[\0]"; - else - chrStr = [NSString stringWithFormat: @"[NP: %u]", chr]; - } - } - else - { - chrStr = @"[none]"; - } - - return chrStr; -} - /* Returns a string with a very verbose diff of the two strings. In case the strings are equal it returns an empty string.