mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-9397 Update some tests in intltest and cintltst to pass without data in 50.0.1
X-SVN-Rev: 31982
This commit is contained in:
parent
93ab318ce1
commit
d62e581e2c
8 changed files with 19 additions and 16 deletions
|
@ -104,7 +104,7 @@ static void TestOrdinalRules() {
|
|||
U_STRING_INIT(two, "two", 3);
|
||||
length = uplrules_select(upr, 2., keyword, 8, &errorCode);
|
||||
if (U_FAILURE(errorCode) || u_strCompare(keyword, length, two, 3, FALSE) != 0) {
|
||||
log_err("uplrules_select(en-ordinal, 2) failed - %s\n", u_errorName(errorCode));
|
||||
log_data_err("uplrules_select(en-ordinal, 2) failed - %s\n", u_errorName(errorCode));
|
||||
}
|
||||
uplrules_close(upr);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
errln("Failure in file %s, line %d", __FILE__, __LINE__);}}
|
||||
|
||||
#define TEST_ASSERT_SUCCESS(errcode) { if (U_FAILURE(errcode)) { \
|
||||
errcheckln(errcode, "Failure in file %s, line %d, status = \"%s\"", __FILE__, __LINE__, u_errorName(errcode));}}
|
||||
errcheckln(errcode, "Failure in file %s, line %d, status = \"%s\"", __FILE__, __LINE__, u_errorName(errcode));\
|
||||
return;}}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -6598,7 +6598,7 @@ void NumberFormatTest::TestFormatFastpaths() {
|
|||
FieldPosition pos;
|
||||
df.format(long_number, result, pos);
|
||||
if(U_FAILURE(status)||expect!=result) {
|
||||
errln("FAIL: expected '"+expect+"' got '"+result+"' status "+UnicodeString(u_errorName(status),""));
|
||||
errcheckln(status, "FAIL: expected '"+expect+"' got '"+result+"' status "+UnicodeString(u_errorName(status),""));
|
||||
} else {
|
||||
logln("OK: got expected '"+result+"' status "+UnicodeString(u_errorName(status),""));
|
||||
}
|
||||
|
@ -6617,7 +6617,7 @@ void NumberFormatTest::TestFormatFastpaths() {
|
|||
FieldPosition pos;
|
||||
df.format(long_number, result, pos);
|
||||
if(U_FAILURE(status)||expect!=result) {
|
||||
errln("FAIL: expected '"+expect+"' got '"+result+"' status "+UnicodeString(u_errorName(status),"")+" on -9223372036854775808");
|
||||
errcheckln(status, "FAIL: expected '"+expect+"' got '"+result+"' status "+UnicodeString(u_errorName(status),"")+" on -9223372036854775808");
|
||||
} else {
|
||||
logln("OK: got expected '"+result+"' status "+UnicodeString(u_errorName(status),"")+" on -9223372036854775808");
|
||||
}
|
||||
|
@ -6636,7 +6636,7 @@ void NumberFormatTest::TestFormatFastpaths() {
|
|||
FieldPosition pos;
|
||||
df.format(long_number, result, pos);
|
||||
if(U_FAILURE(status)||expect!=result) {
|
||||
errln("FAIL: expected '"+expect+"' got '"+result+"' status "+UnicodeString(u_errorName(status),"")+" on U_INT64_MAX");
|
||||
errcheckln(status, "FAIL: expected '"+expect+"' got '"+result+"' status "+UnicodeString(u_errorName(status),"")+" on U_INT64_MAX");
|
||||
} else {
|
||||
logln("OK: got expected '"+result+"' status "+UnicodeString(u_errorName(status),"")+" on U_INT64_MAX");
|
||||
}
|
||||
|
@ -6655,7 +6655,7 @@ void NumberFormatTest::TestFormatFastpaths() {
|
|||
FieldPosition pos;
|
||||
df.format(long_number, result, pos);
|
||||
if(U_FAILURE(status)||expect!=result) {
|
||||
errln("FAIL: expected '"+expect+"' got '"+result+"' status "+UnicodeString(u_errorName(status),"")+" on 0");
|
||||
errcheckln(status, "FAIL: expected '"+expect+"' got '"+result+"' status "+UnicodeString(u_errorName(status),"")+" on 0");
|
||||
} else {
|
||||
logln("OK: got expected '"+result+"' status "+UnicodeString(u_errorName(status),"")+" on 0");
|
||||
}
|
||||
|
@ -6669,7 +6669,7 @@ void NumberFormatTest::TestFormatFastpaths() {
|
|||
FieldPosition pos;
|
||||
df.format(long_number, result, pos);
|
||||
if(U_FAILURE(status)||expect!=result) {
|
||||
errln("FAIL: expected '"+expect+"' got '"+result+"' status "+UnicodeString(u_errorName(status),"")+" on -9223372036854775807");
|
||||
errcheckln(status, "FAIL: expected '"+expect+"' got '"+result+"' status "+UnicodeString(u_errorName(status),"")+" on -9223372036854775807");
|
||||
} else {
|
||||
logln("OK: got expected '"+result+"' status "+UnicodeString(u_errorName(status),"")+" on -9223372036854775807");
|
||||
}
|
||||
|
|
|
@ -584,7 +584,7 @@ PluralFormatTest::ordinalFormatTest(void) {
|
|||
IcuTestErrorCode errorCode(*this, "ordinalFormatTest");
|
||||
UnicodeString pattern("one{#st file}two{#nd file}few{#rd file}other{#th file}");
|
||||
PluralFormat pf(Locale::getEnglish(), UPLURAL_TYPE_ORDINAL, pattern, errorCode);
|
||||
if (errorCode.logIfFailureAndReset("PluralFormat(en, UPLURAL_TYPE_ORDINAL, pattern) failed")) {
|
||||
if (errorCode.logDataIfFailureAndReset("PluralFormat(en, UPLURAL_TYPE_ORDINAL, pattern) failed")) {
|
||||
return;
|
||||
}
|
||||
UnicodeString result = pf.format(321, errorCode);
|
||||
|
|
|
@ -544,7 +544,7 @@ void PluralRulesTest::testOrdinal() {
|
|||
}
|
||||
UnicodeString keyword = pr->select(2.);
|
||||
if (keyword != UNICODE_STRING("two", 3)) {
|
||||
errln("PluralRules(en-ordinal).select(2) failed");
|
||||
dataerrln("PluralRules(en-ordinal).select(2) failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1828,19 +1828,21 @@ void TestMessageFormat::TestSelectOrdinal() {
|
|||
FieldPosition ignore(0);
|
||||
UnicodeString result;
|
||||
assertEquals("plural-and-ordinal format(21) failed", "21 files, 21st file",
|
||||
m.format(args, 1, result, ignore, errorCode));
|
||||
m.format(args, 1, result, ignore, errorCode), TRUE);
|
||||
|
||||
args[0].setLong(2);
|
||||
assertEquals("plural-and-ordinal format(2) failed", "2 files, 2nd file",
|
||||
m.format(args, 1, result.remove(), ignore, errorCode));
|
||||
m.format(args, 1, result.remove(), ignore, errorCode), TRUE);
|
||||
|
||||
args[0].setLong(1);
|
||||
assertEquals("plural-and-ordinal format(1) failed", "1 file, 1st file",
|
||||
m.format(args, 1, result.remove(), ignore, errorCode));
|
||||
m.format(args, 1, result.remove(), ignore, errorCode), TRUE);
|
||||
|
||||
args[0].setLong(3);
|
||||
assertEquals("plural-and-ordinal format(3) failed", "3 files, 3rd file",
|
||||
m.format(args, 1, result.remove(), ignore, errorCode));
|
||||
m.format(args, 1, result.remove(), ignore, errorCode), TRUE);
|
||||
|
||||
errorCode.logDataIfFailureAndReset("");
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
|
@ -330,7 +330,7 @@ void TimeUnitTest::testGreekWithSanitization() {
|
|||
UErrorCode status = U_ZERO_ERROR;
|
||||
Locale elLoc("el");
|
||||
NumberFormat* numberFmt = NumberFormat::createInstance(Locale("el"), status);
|
||||
if (!assertSuccess("NumberFormat::createInstance for el locale", status)) return;
|
||||
if (!assertSuccess("NumberFormat::createInstance for el locale", status, TRUE)) return;
|
||||
numberFmt->setMaximumFractionDigits(1);
|
||||
|
||||
TimeUnitFormat* timeUnitFormat = new TimeUnitFormat(elLoc, status);
|
||||
|
|
|
@ -919,7 +919,7 @@ void TimeZoneTest::TestShortZoneIDs()
|
|||
" but it should be " +
|
||||
((kReferenceList[i].daylight)?"TRUE":"FALSE"));
|
||||
} else {
|
||||
errln("FAIL: Time Zone " + itsID + " use daylight is " +
|
||||
dataerrln("FAIL: Time Zone " + itsID + " use daylight is " +
|
||||
(usesDaylight?"TRUE":"FALSE") +
|
||||
" but it should be " +
|
||||
((kReferenceList[i].daylight)?"TRUE":"FALSE"));
|
||||
|
@ -935,7 +935,7 @@ void TimeZoneTest::TestShortZoneIDs()
|
|||
offsetInMinutes +
|
||||
" but it should be " + kReferenceList[i].offset);
|
||||
} else {
|
||||
errln("FAIL: Time Zone " + itsID + " raw offset is " +
|
||||
dataerrln("FAIL: Time Zone " + itsID + " raw offset is " +
|
||||
offsetInMinutes +
|
||||
" but it should be " + kReferenceList[i].offset);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue