Stage 1 of clang compiler warning patches.

This commit is contained in:
Euan Thoms
2015-10-31 14:10:03 +08:00
parent 0b490a00c6
commit 3c62cc744e
85 changed files with 185 additions and 165 deletions
+2 -2
View File
@@ -245,10 +245,10 @@ NSString *_stringForCharacterAtIndex(NSUInteger index, NSString *str, NSUInteger
sc2 = _stringForCharacterAtIndex(i, str2, length2);
if ([sc1 isEqualToString: sc2])
finalSTR = [finalSTR stringByAppendingFormat: @"%u |%@|\n", i, sc1];
finalSTR = [finalSTR stringByAppendingFormat: @"%lu |%@|\n", i, sc1];
else
{
finalSTR = [finalSTR stringByAppendingFormat: @"%u |%@|%@|<--\n", i, sc1, sc2];
finalSTR = [finalSTR stringByAppendingFormat: @"%lu |%@|%@|<--\n", i, sc1, sc2];
differencesFound = YES;
}
}
+2 -4
View File
@@ -37,8 +37,8 @@
@"<johndown@test.com>", // email between brackets
@"\"<johndown@test.com>\" <johndown@test.com>", // doubled
// @"\"johndown@inverse.ca\" <johndown@test.com>", // with and without br.
@"Àñinéoblabla <johndown@test.com>", // accented full name
@"Àñinéoblabla Bla Blé <johndown@test.com>", // accented and multiword
@"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla?= <wolfgang@test.com>", // accented full name
@"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla_Bla_Bl=C3=A9?= <wolfgang@test.com>", // accented and multiword
@"John Down \"Bla Bla\" <johndown@test.com>", // partly quoted
@"John Down <johndown@test.com>", // full name + email
@"John, Down <johndown@test.com>", // full name with comma + email
@@ -123,8 +123,6 @@
testWithMessage([result isEqualToString: currentExp], error);
}
currentRaw++;
currentExp++;
}
}
@end
@@ -39,8 +39,8 @@
@"<wolfgang@test.com>", // email between brackets
@"\"<wolfgang@test.com>\" <wolfgang@test.com>", // doubled
@"\"wolfgang@inverse.ca\" <wolfgang@test.com>", // with and without br.
@"Àñinéoblabla <wolfgang@test.com>", // accented full name
@"Àñinéoblabla Bla Blé <wolfgang@test.com>", // accented and multiword
@"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla?= <wolfgang@test.com>", // accented full name
@"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla_Bla_Bl=C3=A9?= <wolfgang@test.com>", // accented and multiword
@"Wolfgang Sourdeau \"Bla Bla\" <wolfgang@test.com>", // partly quoted
@"Wolfgang Sourdeau <wolfgang@test.com>", // full name + email
nil };
@@ -50,8 +50,7 @@
@"\"<wolfgang@test.com>\" <wolfgang@test.com>", // doubled
@"\"wolfgang@inverse.ca\" <wolfgang@test.com>", // with and without br.
@"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla?= <wolfgang@test.com>", // accented full name
@"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla_Bla_Bl=C3=A9?= <wolfgang@test.com>", // accented
// and multiword
@"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla_Bla_Bl=C3=A9?= <wolfgang@test.com>", // accented and multiword
/* NOTE: the following are wrong but tolerated for now */
@"Wolfgang Sourdeau \"Bla Bla\" <wolfgang@test.com>", // partly quoted
+1 -1
View File
@@ -117,7 +117,7 @@
NSString *diff = [self stringFromDiffBetween: [NSString stringWithString: resultString]
and: [NSString stringWithString: expected]];
NSString *testErrorMsg = [NSString
stringWithFormat: @">> For %@ header received:\n%@[END]\n>> instead of:\n%@[END]\n>> for:\n%@\n>> diff:\n%@\n>> lengthReceived: %u lengthExpected: %u",
stringWithFormat: @">> For %@ header received:\n%@[END]\n>> instead of:\n%@[END]\n>> for:\n%@\n>> diff:\n%@\n>> lengthReceived: %lu lengthExpected: %lu",
header,
resultString,
expected,
+14
View File
@@ -34,6 +34,10 @@
- (void) test_rendering
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-string-compare"
CardElement *element;
CardVersitRenderer *renderer;
NSString *result;
@@ -137,10 +141,17 @@
testEquals(result, @"ELEM:NONEMPTY=coucou\r\n");
/** tests about parameters handling could be nice */
#pragma clang diagnostic pop
}
- (void) test_parsing
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-string-compare"
CardGroup *group;
CardElement *element;
NSString *versit;
@@ -201,6 +212,9 @@
element = [group firstChildWithTag: @"element"];
testEquals([element flattenedValueAtIndex: 0 forKey: @""], @"value");
testEquals([element value: 0 ofAttribute: @"param1"], @"paramvalue1, with comma");
#pragma clang diagnostic pop
}
@end
+3 -3
View File
@@ -107,7 +107,7 @@
[currentOccurrence descriptionWithCalendarFormat: dateFormat]];
testWithMessage([currentOccurrence isDateOnSameDay: [[occurrences objectAtIndex: j] startDate]], error);
}
error = [NSString stringWithFormat: @"Unexpected number of occurrences for recurrence rule %@ (found %i, expected %i)",
error = [NSString stringWithFormat: @"Unexpected number of occurrences for recurrence rule %@ (found %ld, expected %ld)",
[currentRule objectAtIndex: 1],
[occurrences count],
[currentRule count] - 2];
@@ -211,7 +211,7 @@
[currentOccurrence descriptionWithCalendarFormat: dateFormat]];
testWithMessage([currentOccurrence isDateOnSameDay: [[occurrences objectAtIndex: j] startDate]], error);
}
error = [NSString stringWithFormat: @"Unexpected number of occurrences for recurrence rule %@ (found %i, expected %i)",
error = [NSString stringWithFormat: @"Unexpected number of occurrences for recurrence rule %@ (found %ld, expected %ld)",
[currentRule objectAtIndex: 1],
[occurrences count],
[currentRule count] - 2];
@@ -376,7 +376,7 @@
[currentOccurrence descriptionWithCalendarFormat: dateFormat]];
testWithMessage([currentOccurrence isDateOnSameDay: [[occurrences objectAtIndex: j] startDate]], error);
}
error = [NSString stringWithFormat: @"Unexpected number of occurrences for recurrence rule %@ (found %i, expected %i)",
error = [NSString stringWithFormat: @"Unexpected number of occurrences for recurrence rule %@ (found %ld, expected %ld)",
[currentRule objectAtIndex: 1],
[occurrences count],
[currentRule count] - 2];
+2 -2
View File
@@ -80,8 +80,8 @@
testWithMessage ((NSInteger) [testDate timeIntervalSince1970]
== occurrenceSeconds[count],
([NSString stringWithFormat:
@"test %d: seconds do not match:"
@" delta = %d", count, delta]));
@"test %ld: seconds do not match:"
@" delta = %ld", count, delta]));
}
}