ICU-9397 Update tests to pass without data in ICU 50 RC
X-SVN-Rev: 32680
This commit is contained in:
parent
d2e6714df6
commit
f8365c92da
@ -2282,7 +2282,7 @@ void TestGetTZTransition() {
|
||||
|
||||
result = ucal_getTimeZoneTransitionDate(ucal, UCAL_TZ_TRANSITION_PREVIOUS, &transition1, &status);
|
||||
if (U_FAILURE(status) || result != itemPtr->hasPrev) {
|
||||
log_err("FAIL: %s ucal_getTimeZoneTransitionDate prev status %s, expected result %d but got %d\n",
|
||||
log_data_err("FAIL: %s ucal_getTimeZoneTransitionDate prev status %s, expected result %d but got %d\n",
|
||||
itemPtr->descrip, u_errorName(status), itemPtr->hasPrev, result);
|
||||
} else if (result) {
|
||||
ucal_setMillis(ucal, transition1, &status);
|
||||
@ -2296,7 +2296,7 @@ void TestGetTZTransition() {
|
||||
|
||||
result = ucal_getTimeZoneTransitionDate(ucal, UCAL_TZ_TRANSITION_NEXT, &transition1, &status);
|
||||
if (U_FAILURE(status) || result != itemPtr->hasNext) {
|
||||
log_err("FAIL: %s ucal_getTimeZoneTransitionDate next status %s, expected result %d but got %d\n",
|
||||
log_data_err("FAIL: %s ucal_getTimeZoneTransitionDate next status %s, expected result %d but got %d\n",
|
||||
itemPtr->descrip, u_errorName(status), itemPtr->hasNext, result);
|
||||
} else if (result) {
|
||||
ucal_setMillis(ucal, transition1, &status);
|
||||
|
@ -37,7 +37,7 @@ static void TestGenderInfo(void) {
|
||||
const UGenderInfo* actual_gi = ugender_getInstance("fr_CA", &status);
|
||||
UGender actual;
|
||||
if (U_FAILURE(status)) {
|
||||
log_err("Fail to create UGenderInfo - %s\n", u_errorName(status));
|
||||
log_err_status(status, "Fail to create UGenderInfo - %s (Are you missing data?)", u_errorName(status));
|
||||
return;
|
||||
}
|
||||
actual = ugender_getListGender(actual_gi, kAllFemale, LENGTHOF(kAllFemale), &status);
|
||||
|
@ -560,43 +560,44 @@ CalendarTest::TestGenericAPI()
|
||||
Calendar::getKeywordValuesForLocale("calendar", Locale("he"), FALSE, status));
|
||||
if (values.isNull() || U_FAILURE(status)) {
|
||||
dataerrln("FAIL: Calendar::getKeywordValuesForLocale(he): %s", u_errorName(status));
|
||||
}
|
||||
UBool containsHebrew = FALSE;
|
||||
const char *charValue;
|
||||
int32_t valueLength;
|
||||
while ((charValue = values->next(&valueLength, status)) != NULL) {
|
||||
if (valueLength == 6 && strcmp(charValue, "hebrew") == 0) {
|
||||
containsHebrew = TRUE;
|
||||
} else {
|
||||
UBool containsHebrew = FALSE;
|
||||
const char *charValue;
|
||||
int32_t valueLength;
|
||||
while ((charValue = values->next(&valueLength, status)) != NULL) {
|
||||
if (valueLength == 6 && strcmp(charValue, "hebrew") == 0) {
|
||||
containsHebrew = TRUE;
|
||||
}
|
||||
}
|
||||
if (!containsHebrew) {
|
||||
errln("Calendar::getKeywordValuesForLocale(he)->next() does not contain \"hebrew\"");
|
||||
}
|
||||
}
|
||||
if (!containsHebrew) {
|
||||
errln("Calendar::getKeywordValuesForLocale(he)->next() does not contain \"hebrew\"");
|
||||
}
|
||||
|
||||
values->reset(status);
|
||||
containsHebrew = FALSE;
|
||||
UnicodeString hebrew = UNICODE_STRING_SIMPLE("hebrew");
|
||||
const UChar *ucharValue;
|
||||
while ((ucharValue = values->unext(&valueLength, status)) != NULL) {
|
||||
UnicodeString value(FALSE, ucharValue, valueLength);
|
||||
if (value == hebrew) {
|
||||
containsHebrew = TRUE;
|
||||
values->reset(status);
|
||||
containsHebrew = FALSE;
|
||||
UnicodeString hebrew = UNICODE_STRING_SIMPLE("hebrew");
|
||||
const UChar *ucharValue;
|
||||
while ((ucharValue = values->unext(&valueLength, status)) != NULL) {
|
||||
UnicodeString value(FALSE, ucharValue, valueLength);
|
||||
if (value == hebrew) {
|
||||
containsHebrew = TRUE;
|
||||
}
|
||||
}
|
||||
if (!containsHebrew) {
|
||||
errln("Calendar::getKeywordValuesForLocale(he)->unext() does not contain \"hebrew\"");
|
||||
}
|
||||
}
|
||||
if (!containsHebrew) {
|
||||
errln("Calendar::getKeywordValuesForLocale(he)->unext() does not contain \"hebrew\"");
|
||||
}
|
||||
|
||||
values->reset(status);
|
||||
containsHebrew = FALSE;
|
||||
const UnicodeString *stringValue;
|
||||
while ((stringValue = values->snext(status)) != NULL) {
|
||||
if (*stringValue == hebrew) {
|
||||
containsHebrew = TRUE;
|
||||
values->reset(status);
|
||||
containsHebrew = FALSE;
|
||||
const UnicodeString *stringValue;
|
||||
while ((stringValue = values->snext(status)) != NULL) {
|
||||
if (*stringValue == hebrew) {
|
||||
containsHebrew = TRUE;
|
||||
}
|
||||
}
|
||||
if (!containsHebrew) {
|
||||
errln("Calendar::getKeywordValuesForLocale(he)->snext() does not contain \"hebrew\"");
|
||||
}
|
||||
}
|
||||
if (!containsHebrew) {
|
||||
errln("Calendar::getKeywordValuesForLocale(he)->snext() does not contain \"hebrew\"");
|
||||
}
|
||||
delete cal;
|
||||
}
|
||||
|
@ -181,8 +181,7 @@ void DateFormatTest::TestPatterns() {
|
||||
// actualPattern, locale);
|
||||
LocalPointer<DateTimePatternGenerator> generator(
|
||||
DateTimePatternGenerator::createInstance(locale, errorCode));
|
||||
if(errorCode.logIfFailureAndReset("DateTimePatternGenerator::createInstance() failed")) {
|
||||
errln(" for locale ID \"%s\"", EXPECTED[i].localeID);
|
||||
if(errorCode.logDataIfFailureAndReset("DateTimePatternGenerator::createInstance() failed for locale ID \"%s\"", EXPECTED[i].localeID)) {
|
||||
continue;
|
||||
}
|
||||
UnicodeString pattern = generator->getBestPattern(actualPattern, errorCode);
|
||||
|
@ -326,12 +326,12 @@ void LocaleDisplayNamesTest::TestUldnDisplayContext() {
|
||||
UChar nameBuf[ULOC_FULLNAME_CAPACITY];
|
||||
int32_t len = uldn_localeDisplayName(uldn, ctxtItemPtr->localeToBeNamed, nameBuf, ULOC_FULLNAME_CAPACITY, &status);
|
||||
if (U_FAILURE(status)) {
|
||||
errln(UnicodeString("FAIL: uldn_localeDisplayName status ") + (int)status);
|
||||
dataerrln(UnicodeString("FAIL: uldn_localeDisplayName status: ") + u_errorName(status));
|
||||
} else if (u_strcmp(ctxtItemPtr->result, nameBuf) != 0) {
|
||||
UnicodeString exp(ctxtItemPtr->result, u_strlen(ctxtItemPtr->result));
|
||||
UnicodeString got(nameBuf, len);
|
||||
errln(UnicodeString("FAIL: uldn_localeDisplayName, capitalization ") + ctxtItemPtr->capitalization +
|
||||
", expected " + exp + ", got " + got );
|
||||
dataerrln(UnicodeString("FAIL: uldn_localeDisplayName, capitalization ") + ctxtItemPtr->capitalization +
|
||||
", expected " + exp + ", got " + got );
|
||||
}
|
||||
}
|
||||
uldn_close(uldn);
|
||||
|
@ -1797,7 +1797,7 @@ void TestMessageFormat::testCoverage(void) {
|
||||
void TestMessageFormat::testGetFormatNames() {
|
||||
IcuTestErrorCode errorCode(*this, "testGetFormatNames");
|
||||
MessageFormat msgfmt("Hello, {alice,number} {oops,date,full} {zip,spellout} World.", Locale::getRoot(), errorCode);
|
||||
if(errorCode.logIfFailureAndReset("MessageFormat() failed")) {
|
||||
if(errorCode.logDataIfFailureAndReset("MessageFormat() failed")) {
|
||||
return;
|
||||
}
|
||||
LocalPointer<StringEnumeration> names(msgfmt.getFormatNames(errorCode));
|
||||
|
Loading…
Reference in New Issue
Block a user