checkConsistency("en@calendar=ethiopic-amete-alem");
}
void IntlCalendarTest::checkConsistency(const char* locale) {
- // Check 2.5 years in quick mode and 8000 years in exhaustive mode.
- int32_t numOfDaysToTest = static_cast<int32_t>((quick ? 2.5 : 8000) * 365);
+ // Check 2.5 years in quick mode and 6000 years in exhaustive mode.
+ int32_t numOfDaysToTest = static_cast<int32_t>((quick ? 2.5 : 6000) * 365);
constexpr int32_t msInADay = 1000*60*60*24;
std::string msg("TestConsistency");
IcuTestErrorCode status(*this, (msg + locale).c_str());
if (status.errIfFailureAndReset("Cannot create calendar %s", locale)) {
return;
}
+ const char* type = base->getType();
+ // Do not ignore in quick mode
+ bool ignoreOrdinaryMonth12Bug = (!quick) && (strcmp("chinese", type) == 0 || strcmp("dangi", type) == 0);
+ bool ignoreICU22258 = (!quick) && (strcmp("dangi", type) == 0);
UDate test = Calendar::getNow();
base->setTimeZone(*(TimeZone::getGMT()));
int32_t j;
return;
}
if (test != result) {
+ if (ignoreOrdinaryMonth12Bug &&
+ base->get(UCAL_ORDINAL_MONTH, status) == 12) {
+ logKnownIssue("ICU-22230", "Problem December in Leap Year");
+ status.reset();
+ continue;
+ }
+ int32_t year = base->get(UCAL_YEAR, status);
+ int32_t month = base->get(UCAL_MONTH, status) + 1;
+ int32_t date = base->get(UCAL_DATE, status);
+ if (ignoreICU22258 && (year == 4 || year == 34) && month == 12 && date == 30) {
+ logKnownIssue("ICU-22258",
+ "Dangi Problem in 1988/2/17=>4/12/30 and 1958/2/18=>34/12/30");
+ status.reset();
+ continue;
+ }
+
errln((UnicodeString)"Round trip conversion produces different "
"time from " + test + " to " + result + " delta: " +
(result - test) +
g->get(UCAL_DATE, status) + ") \n" +
" Calendar[" + base->getType() +
"](e=" + base->get(UCAL_ERA, status) + " " +
- base->get(UCAL_YEAR, status) + "/" +
- (base->get(UCAL_MONTH, status) + 1) + "/" +
- base->get(UCAL_DATE, status) + ") ordinalMonth=" +
+ year + "/" + month + "/" + date +
+ ") ordinalMonth=" +
base->get(UCAL_ORDINAL_MONTH, status));
-
status.errIfFailureAndReset();
- return;
}
}
- status.errIfFailureAndReset();
}
void IntlCalendarTest::simpleTest(const Locale& loc, const UnicodeString& expect, UDate expectDate, UErrorCode& status)