mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-18 05:03:20 +00:00
Stage 1 of clang compiler warning patches.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user