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 3b825a2aa3
commit 5f3c045aca

View File

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