Bug 1003246 - Loosening assertion to allow for other valid inputs. r=jwatt

This commit is contained in:
Martin Thomson 2014-04-29 10:36:00 +02:00
parent 87e73b4f59
commit 9629e0c513

View File

@ -188,12 +188,12 @@ nsresult nsDateTimeFormatMac::FormatTMTime(nsILocale* locale,
CFSTR("h"), CFSTR("H"), CFSTR("h"), CFSTR("H"),
CFRangeMake(0, CFStringGetLength(newFormat)), CFRangeMake(0, CFStringGetLength(newFormat)),
0); 0);
NS_ASSERTION(replaceCount == 1, "Unexpected number of \"h\" occurrences"); NS_ASSERTION(replaceCount <= 2, "Unexpected number of \"h\" occurrences");
replaceCount = CFStringFindAndReplace(newFormat, replaceCount = CFStringFindAndReplace(newFormat,
CFSTR("a"), CFSTR(""), CFSTR("a"), CFSTR(""),
CFRangeMake(0, CFStringGetLength(newFormat)), CFRangeMake(0, CFStringGetLength(newFormat)),
0); 0);
NS_ASSERTION(replaceCount == 1, "Unexpected number of \"a\" occurrences"); NS_ASSERTION(replaceCount <= 1, "Unexpected number of \"a\" occurrences");
CFDateFormatterSetFormat(formatter, newFormat); CFDateFormatterSetFormat(formatter, newFormat);
CFRelease(newFormat); // note we don't own oldFormat CFRelease(newFormat); // note we don't own oldFormat
} }