mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 14:31:31 +00:00
ICU-12701 more IBM i test fixes.
* intltest now builds. * fix for unpax-icu.sh to include the utf-16be file. * added an emacs coding line to 'encoded.utf16be' X-SVN-Rev: 39304
This commit is contained in:
parent
5e68fee567
commit
2bf1e2f0c1
13 changed files with 102 additions and 97 deletions
|
@ -25,6 +25,9 @@ else
|
|||
fi
|
||||
export QSH
|
||||
|
||||
# set this to "v" to list files as they are unpacked (default)
|
||||
VERBOSE_UNPACK="v"
|
||||
|
||||
# Set the following variable to the list of binary file suffixes (extensions)
|
||||
|
||||
|
||||
|
@ -78,13 +81,13 @@ echo "Extracting from $tar_file ..."
|
|||
echo ""
|
||||
|
||||
# extract everything as iso-8859-1 except these directories
|
||||
pax -C 819 -rcvf $tar_file $ebcdic_data
|
||||
pax -C 819 -rc${VERBOSE_UNPACK}f $tar_file $ebcdic_data
|
||||
|
||||
# extract files while converting them to EBCDIC
|
||||
echo ""
|
||||
echo "Extracting files which must be in ibm-37 ..."
|
||||
echo ""
|
||||
pax -C 37 -rvf $tar_file $ebcdic_data
|
||||
pax -C 37 -r${VERBOSE_UNPACK}f $tar_file $ebcdic_data
|
||||
|
||||
#****************************************************************************
|
||||
# For files we have restored as CCSID 37, check the BOM to see if they
|
||||
|
@ -139,7 +142,9 @@ fi
|
|||
|
||||
echo "# Processing special paths."
|
||||
# Process special paths
|
||||
more_bin_files=$(find icu -type f \( -name '*.zzz' `echo $binary_suffixes | sed -e 's%[a-zA-Z]*%-o -name \*.&%g'` \) -print)
|
||||
more_bin_opts=$(echo $binary_suffixes | sed -e 's%[a-zA-Z0-9]*%-o -name \*.&%g')
|
||||
# echo "Looking for additional files: find ... $more_bin_opts"
|
||||
more_bin_files=$(find icu -type f \( -name '*.zzz' $more_bin_opts \) -print)
|
||||
echo "Restoring binary files by special paths ($bin_count) ..."
|
||||
rm $more_bin_files
|
||||
pax -C 819 -rvf $tar_file $more_bin_files
|
||||
|
|
|
@ -569,7 +569,7 @@ void AlphabeticIndexTest::TestHaniFirst() {
|
|||
bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x03B1), status);
|
||||
assertEquals("getBucketIndex(Greek alpha)", 27, bucketIndex);
|
||||
// U+50005 is an unassigned code point which sorts at the end, independent of the Hani group.
|
||||
bucketIndex = index.getBucketIndex(UnicodeString(0x50005), status);
|
||||
bucketIndex = index.getBucketIndex(UnicodeString((UChar32)0x50005), status);
|
||||
assertEquals("getBucketIndex(U+50005)", 27, bucketIndex);
|
||||
bucketIndex = index.getBucketIndex(UnicodeString((UChar)0xFFFF), status);
|
||||
assertEquals("getBucketIndex(U+FFFF)", 27, bucketIndex);
|
||||
|
@ -598,7 +598,7 @@ void AlphabeticIndexTest::TestPinyinFirst() {
|
|||
bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x03B1), status);
|
||||
assertEquals("getBucketIndex(Greek alpha)", (int32_t)27, bucketIndex);
|
||||
// U+50005 is an unassigned code point which sorts at the end, independent of the Hani group.
|
||||
bucketIndex = index.getBucketIndex(UnicodeString(0x50005), status);
|
||||
bucketIndex = index.getBucketIndex(UnicodeString((UChar32)0x50005), status);
|
||||
assertEquals("getBucketIndex(U+50005)", 27, bucketIndex);
|
||||
bucketIndex = index.getBucketIndex(UnicodeString((UChar)0xFFFF), status);
|
||||
assertEquals("getBucketIndex(U+FFFF)", 27, bucketIndex);
|
||||
|
|
|
@ -110,7 +110,7 @@ DataDrivenNumberFormatTestSuite::~DataDrivenNumberFormatTestSuite() {
|
|||
}
|
||||
|
||||
UBool DataDrivenNumberFormatTestSuite::breaksC() {
|
||||
return (NFTT_GET_FIELD(fTuple, breaks, "").toUpper().indexOf(0x43) != -1);
|
||||
return (NFTT_GET_FIELD(fTuple, breaks, "").toUpper().indexOf((UChar)0x43) != -1);
|
||||
}
|
||||
|
||||
void DataDrivenNumberFormatTestSuite::setTupleField(UErrorCode &status) {
|
||||
|
|
|
@ -2124,7 +2124,7 @@ void IntlTestRBNF::TestPluralRules() {
|
|||
|
||||
// Make sure there are no divide by 0 errors.
|
||||
UnicodeString result;
|
||||
RuleBasedNumberFormat(ruRules, Locale("ru"), parseError, status).format(21000, result);
|
||||
RuleBasedNumberFormat(ruRules, Locale("ru"), parseError, status).format((int32_t)21000, result);
|
||||
if (result.compare(UNICODE_STRING_SIMPLE("twenty-one thousand")) != 0) {
|
||||
errln("Got " + result + " for 21000");
|
||||
}
|
||||
|
|
|
@ -999,17 +999,17 @@ void MeasureFormatTest::TestExamplesInDocs() {
|
|||
if (!assertSuccess("Error creating formatters", status)) {
|
||||
return;
|
||||
}
|
||||
Measure measureC(23, MeasureUnit::createCelsius(status), status);
|
||||
Measure measureF(70, MeasureUnit::createFahrenheit(status), status);
|
||||
Measure measureC((double)23, MeasureUnit::createCelsius(status), status);
|
||||
Measure measureF((double)70, MeasureUnit::createFahrenheit(status), status);
|
||||
Measure feetAndInches[] = {
|
||||
Measure(70, MeasureUnit::createFoot(status), status),
|
||||
Measure(5.3, MeasureUnit::createInch(status), status)};
|
||||
Measure((double)70, MeasureUnit::createFoot(status), status),
|
||||
Measure((double)5.3, MeasureUnit::createInch(status), status)};
|
||||
Measure footAndInch[] = {
|
||||
Measure(1, MeasureUnit::createFoot(status), status),
|
||||
Measure(1, MeasureUnit::createInch(status), status)};
|
||||
Measure((double)1, MeasureUnit::createFoot(status), status),
|
||||
Measure((double)1, MeasureUnit::createInch(status), status)};
|
||||
Measure inchAndFeet[] = {
|
||||
Measure(1, MeasureUnit::createInch(status), status),
|
||||
Measure(2, MeasureUnit::createFoot(status), status)};
|
||||
Measure((double)1, MeasureUnit::createInch(status), status),
|
||||
Measure((double)2, MeasureUnit::createFoot(status), status)};
|
||||
if (!assertSuccess("Error creating measurements.", status)) {
|
||||
return;
|
||||
}
|
||||
|
@ -1067,28 +1067,28 @@ void MeasureFormatTest::TestExamplesInDocs() {
|
|||
|
||||
void MeasureFormatTest::TestFormatPeriodEn() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
Measure t_19m[] = {Measure(19, MeasureUnit::createMinute(status), status)};
|
||||
Measure t_19m[] = {Measure((double)19, MeasureUnit::createMinute(status), status)};
|
||||
Measure t_1h_23_5s[] = {
|
||||
Measure(1.0, MeasureUnit::createHour(status), status),
|
||||
Measure(23.5, MeasureUnit::createSecond(status), status)
|
||||
Measure((double)1.0, MeasureUnit::createHour(status), status),
|
||||
Measure((double)23.5, MeasureUnit::createSecond(status), status)
|
||||
};
|
||||
Measure t_1h_23_5m[] = {
|
||||
Measure(1.0, MeasureUnit::createHour(status), status),
|
||||
Measure(23.5, MeasureUnit::createMinute(status), status)
|
||||
Measure((double)1.0, MeasureUnit::createHour(status), status),
|
||||
Measure((double)23.5, MeasureUnit::createMinute(status), status)
|
||||
};
|
||||
Measure t_1h_0m_23s[] = {
|
||||
Measure(
|
||||
1.0,
|
||||
(double)1.0,
|
||||
TimeUnit::createInstance(
|
||||
TimeUnit::UTIMEUNIT_HOUR, status),
|
||||
status),
|
||||
Measure(
|
||||
0.0,
|
||||
(double)0.0,
|
||||
TimeUnit::createInstance(
|
||||
TimeUnit::UTIMEUNIT_MINUTE, status),
|
||||
status),
|
||||
Measure(
|
||||
23,
|
||||
(double)23.0,
|
||||
TimeUnit::createInstance(
|
||||
TimeUnit::UTIMEUNIT_SECOND, status),
|
||||
status)
|
||||
|
@ -1617,8 +1617,8 @@ void MeasureFormatTest::helperTestMultiples(
|
|||
return;
|
||||
}
|
||||
Measure measures[] = {
|
||||
Measure(2, MeasureUnit::createMile(status), status),
|
||||
Measure(1, MeasureUnit::createFoot(status), status),
|
||||
Measure(2.0, MeasureUnit::createMile(status), status),
|
||||
Measure(1.0, MeasureUnit::createFoot(status), status),
|
||||
Measure(2.3, MeasureUnit::createInch(status), status)};
|
||||
if (!assertSuccess("Error creating measures", status)) {
|
||||
return;
|
||||
|
@ -1634,8 +1634,8 @@ void MeasureFormatTest::helperTestMultiples(
|
|||
void MeasureFormatTest::TestManyLocaleDurations() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
Measure measures[] = {
|
||||
Measure(5, MeasureUnit::createHour(status), status),
|
||||
Measure(37, MeasureUnit::createMinute(status), status)};
|
||||
Measure(5.0, MeasureUnit::createHour(status), status),
|
||||
Measure(37.0, MeasureUnit::createMinute(status), status)};
|
||||
if (!assertSuccess("Error creating measures", status)) {
|
||||
return;
|
||||
}
|
||||
|
@ -1697,8 +1697,8 @@ void MeasureFormatTest::TestGram() {
|
|||
if (!assertSuccess("Error creating format object", status)) {
|
||||
return;
|
||||
}
|
||||
Measure gram(1, MeasureUnit::createGram(status), status);
|
||||
Measure gforce(1, MeasureUnit::createGForce(status), status);
|
||||
Measure gram((double)1, MeasureUnit::createGram(status), status);
|
||||
Measure gforce((double)1, MeasureUnit::createGForce(status), status);
|
||||
if (!assertSuccess("Error creating measures", status)) {
|
||||
return;
|
||||
}
|
||||
|
@ -1821,7 +1821,7 @@ void MeasureFormatTest::TestFieldPosition() {
|
|||
NumberFormat::kDecimalSeparatorField,
|
||||
10,
|
||||
11);
|
||||
measure = Measure(43, MeasureUnit::createFoot(status), status);
|
||||
measure = Measure(43.0, MeasureUnit::createFoot(status), status);
|
||||
if (!assertSuccess("Error creating measure object 2", status)) {
|
||||
return;
|
||||
}
|
||||
|
@ -1843,16 +1843,16 @@ void MeasureFormatTest::TestFieldPositionMultiple() {
|
|||
return;
|
||||
}
|
||||
Measure first[] = {
|
||||
Measure(354, MeasureUnit::createMeter(status), status),
|
||||
Measure(23, MeasureUnit::createCentimeter(status), status)};
|
||||
Measure((double)354, MeasureUnit::createMeter(status), status),
|
||||
Measure((double)23, MeasureUnit::createCentimeter(status), status)};
|
||||
Measure second[] = {
|
||||
Measure(354, MeasureUnit::createMeter(status), status),
|
||||
Measure(23, MeasureUnit::createCentimeter(status), status),
|
||||
Measure(5.4, MeasureUnit::createMillimeter(status), status)};
|
||||
Measure((double)354, MeasureUnit::createMeter(status), status),
|
||||
Measure((double)23, MeasureUnit::createCentimeter(status), status),
|
||||
Measure((double)5.4, MeasureUnit::createMillimeter(status), status)};
|
||||
Measure third[] = {
|
||||
Measure(3, MeasureUnit::createMeter(status), status),
|
||||
Measure(23, MeasureUnit::createCentimeter(status), status),
|
||||
Measure(5, MeasureUnit::createMillimeter(status), status)};
|
||||
Measure((double)3, MeasureUnit::createMeter(status), status),
|
||||
Measure((double)23, MeasureUnit::createCentimeter(status), status),
|
||||
Measure((double)5, MeasureUnit::createMillimeter(status), status)};
|
||||
if (!assertSuccess("Error creating measure objects", status)) {
|
||||
return;
|
||||
}
|
||||
|
@ -1937,9 +1937,9 @@ void MeasureFormatTest::TestGroupingSeparator() {
|
|||
Measure ms[] = {
|
||||
Measure((int32_t)INT32_MAX, MeasureUnit::createYear(status), status),
|
||||
Measure((int32_t)INT32_MIN, MeasureUnit::createMonth(status), status),
|
||||
Measure(-987, MeasureUnit::createDay(status), status),
|
||||
Measure(1362, MeasureUnit::createHour(status), status),
|
||||
Measure(987, MeasureUnit::createMinute(status), status)};
|
||||
Measure(-987.0, MeasureUnit::createDay(status), status),
|
||||
Measure(1362.0, MeasureUnit::createHour(status), status),
|
||||
Measure(987.0, MeasureUnit::createMinute(status), status)};
|
||||
FieldPosition pos(NumberFormat::kGroupingSeparatorField);
|
||||
UnicodeString appendTo;
|
||||
fmt.formatMeasures(ms, 5, appendTo, pos, status);
|
||||
|
@ -1958,8 +1958,8 @@ void MeasureFormatTest::TestDoubleZero() {
|
|||
UErrorCode status = U_ZERO_ERROR;
|
||||
Measure measures[] = {
|
||||
Measure(4.7, MeasureUnit::createHour(status), status),
|
||||
Measure(23, MeasureUnit::createMinute(status), status),
|
||||
Measure(16, MeasureUnit::createSecond(status), status)};
|
||||
Measure(23.0, MeasureUnit::createMinute(status), status),
|
||||
Measure(16.0, MeasureUnit::createSecond(status), status)};
|
||||
Locale en("en");
|
||||
NumberFormat *nf = NumberFormat::createInstance(en, status);
|
||||
MeasureFormat fmt("en", UMEASFMT_WIDTH_WIDE, nf, status);
|
||||
|
@ -1995,7 +1995,7 @@ void MeasureFormatTest::TestUnitPerUnitResolution() {
|
|||
UErrorCode status = U_ZERO_ERROR;
|
||||
Locale en("en");
|
||||
MeasureFormat fmt("en", UMEASFMT_WIDTH_SHORT, status);
|
||||
Measure measure(50, MeasureUnit::createPound(status), status);
|
||||
Measure measure(50.0, MeasureUnit::createPound(status), status);
|
||||
LocalPointer<MeasureUnit> sqInch(MeasureUnit::createSquareInch(status));
|
||||
if (!assertSuccess("Create of format unit and per unit", status)) {
|
||||
return;
|
||||
|
@ -2018,7 +2018,7 @@ void MeasureFormatTest::TestIndividualPluralFallback() {
|
|||
IcuTestErrorCode errorCode(*this, "TestIndividualPluralFallback");
|
||||
MeasureFormat mf("fr_CA", UMEASFMT_WIDTH_SHORT, errorCode);
|
||||
LocalPointer<Measure> twoDeg(
|
||||
new Measure(2, MeasureUnit::createGenericTemperature(errorCode), errorCode), errorCode);
|
||||
new Measure(2.0, MeasureUnit::createGenericTemperature(errorCode), errorCode), errorCode);
|
||||
UnicodeString expected = UNICODE_STRING_SIMPLE("2\\u00B0").unescape();
|
||||
UnicodeString actual;
|
||||
assertEquals("2 deg temp in fr_CA", expected, mf.format(twoDeg.orphan(), actual, errorCode), TRUE);
|
||||
|
|
|
@ -321,7 +321,7 @@ void NumberFormat2Test::TestDigitListInterval() {
|
|||
DigitInterval result;
|
||||
DigitList digitList;
|
||||
{
|
||||
digitList.set(12345);
|
||||
digitList.set((int32_t)12345);
|
||||
verifyInterval(digitList.getSmallestInterval(result), 0, 5);
|
||||
}
|
||||
{
|
||||
|
@ -393,7 +393,7 @@ void NumberFormat2Test::TestQuantize() {
|
|||
DigitList digits;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
{
|
||||
digits.set(1);
|
||||
digits.set((int32_t)1);
|
||||
digits.quantize(quantity, status);
|
||||
verifyDigitList(".9996", digits);
|
||||
}
|
||||
|
@ -417,77 +417,77 @@ void NumberFormat2Test::TestQuantize() {
|
|||
void NumberFormat2Test::TestConvertScientificNotation() {
|
||||
DigitList digits;
|
||||
{
|
||||
digits.set(186283);
|
||||
digits.set((int32_t)186283);
|
||||
assertEquals("", 5, digits.toScientific(1, 1));
|
||||
verifyDigitList(
|
||||
"1.86283",
|
||||
digits);
|
||||
}
|
||||
{
|
||||
digits.set(186283);
|
||||
digits.set((int32_t)186283);
|
||||
assertEquals("", 0, digits.toScientific(6, 1));
|
||||
verifyDigitList(
|
||||
"186283",
|
||||
digits);
|
||||
}
|
||||
{
|
||||
digits.set(186283);
|
||||
digits.set((int32_t)186283);
|
||||
assertEquals("", -2, digits.toScientific(8, 1));
|
||||
verifyDigitList(
|
||||
"18628300",
|
||||
digits);
|
||||
}
|
||||
{
|
||||
digits.set(43561);
|
||||
digits.set((int32_t)43561);
|
||||
assertEquals("", 6, digits.toScientific(-1, 3));
|
||||
verifyDigitList(
|
||||
".043561",
|
||||
digits);
|
||||
}
|
||||
{
|
||||
digits.set(43561);
|
||||
digits.set((int32_t)43561);
|
||||
assertEquals("", 3, digits.toScientific(0, 3));
|
||||
verifyDigitList(
|
||||
"43.561",
|
||||
digits);
|
||||
}
|
||||
{
|
||||
digits.set(43561);
|
||||
digits.set((int32_t)43561);
|
||||
assertEquals("", 3, digits.toScientific(2, 3));
|
||||
verifyDigitList(
|
||||
"43.561",
|
||||
digits);
|
||||
}
|
||||
{
|
||||
digits.set(43561);
|
||||
digits.set((int32_t)43561);
|
||||
assertEquals("", 0, digits.toScientific(3, 3));
|
||||
verifyDigitList(
|
||||
"43561",
|
||||
digits);
|
||||
}
|
||||
{
|
||||
digits.set(43561);
|
||||
digits.set((int32_t)43561);
|
||||
assertEquals("", 0, digits.toScientific(5, 3));
|
||||
verifyDigitList(
|
||||
"43561",
|
||||
digits);
|
||||
}
|
||||
{
|
||||
digits.set(43561);
|
||||
digits.set((int32_t)43561);
|
||||
assertEquals("", -3, digits.toScientific(6, 3));
|
||||
verifyDigitList(
|
||||
"43561000",
|
||||
digits);
|
||||
}
|
||||
{
|
||||
digits.set(43561);
|
||||
digits.set((int32_t)43561);
|
||||
assertEquals("", -3, digits.toScientific(8, 3));
|
||||
verifyDigitList(
|
||||
"43561000",
|
||||
digits);
|
||||
}
|
||||
{
|
||||
digits.set(43561);
|
||||
digits.set((int32_t)43561);
|
||||
assertEquals("", -6, digits.toScientific(9, 3));
|
||||
verifyDigitList(
|
||||
"43561000000",
|
||||
|
@ -1456,19 +1456,19 @@ void NumberFormat2Test::TestAffixPattern() {
|
|||
second.remove();
|
||||
assertFalse("", second.iterator(iter).nextToken());
|
||||
assertTrue("", first.iterator(iter).nextToken());
|
||||
assertEquals("", AffixPattern::kPercent, iter.getTokenType());
|
||||
assertEquals("", (int32_t)AffixPattern::kPercent, iter.getTokenType());
|
||||
assertEquals("", 1, iter.getTokenLength());
|
||||
assertTrue("", iter.nextToken());
|
||||
UnicodeString str;
|
||||
assertEquals("", 500, iter.getLiteral(str).length());
|
||||
assertEquals("", AffixPattern::kLiteral, iter.getTokenType());
|
||||
assertEquals("", (int32_t)AffixPattern::kLiteral, iter.getTokenType());
|
||||
assertEquals("", 500, iter.getTokenLength());
|
||||
assertTrue("", iter.nextToken());
|
||||
assertEquals("", AffixPattern::kCurrency, iter.getTokenType());
|
||||
assertEquals("", (int32_t)AffixPattern::kCurrency, iter.getTokenType());
|
||||
assertEquals("", 2, iter.getTokenLength());
|
||||
assertTrue("", iter.nextToken());
|
||||
assertEquals("", 256, iter.getLiteral(str).length());
|
||||
assertEquals("", AffixPattern::kLiteral, iter.getTokenType());
|
||||
assertEquals("", (int32_t)AffixPattern::kLiteral, iter.getTokenType());
|
||||
assertEquals("", 256, iter.getTokenLength());
|
||||
assertFalse("", iter.nextToken());
|
||||
}
|
||||
|
@ -2534,7 +2534,7 @@ void NumberFormat2Test::TestPluralsAndRoundingScientific() {
|
|||
expectedAttributes);
|
||||
}
|
||||
{
|
||||
digits.set(-299792458);
|
||||
digits.set(-299792458.0);
|
||||
NumberFormat2Test_Attributes expectedAttributes[] = {
|
||||
{UNUM_SIGN_FIELD, 0, 1},
|
||||
{UNUM_INTEGER_FIELD, 1, 2},
|
||||
|
@ -2555,7 +2555,7 @@ void NumberFormat2Test::TestPluralsAndRoundingScientific() {
|
|||
options.fExponent.fAlwaysShowSign = TRUE;
|
||||
precision.fMinExponentDigits = 3;
|
||||
{
|
||||
digits.set(3);
|
||||
digits.set(3.0);
|
||||
NumberFormat2Test_Attributes expectedAttributes[] = {
|
||||
{UNUM_INTEGER_FIELD, 0, 1},
|
||||
{UNUM_DECIMAL_SEPARATOR_FIELD, 1, 2},
|
||||
|
@ -2631,7 +2631,7 @@ void NumberFormat2Test::TestPluralsAndRoundingScientific() {
|
|||
precision.fMantissa.fMax.setIntDigitCount(1);
|
||||
precision.fMantissa.fMax.setFracDigitCount(2);
|
||||
{
|
||||
digits.set(299792458);
|
||||
digits.set((int32_t)299792458);
|
||||
verifyAffixesAndPadding(
|
||||
"3.00E+008 Meters",
|
||||
aap,
|
||||
|
|
|
@ -169,7 +169,7 @@ static void intToStr(
|
|||
x = -x;
|
||||
}
|
||||
if (neg) {
|
||||
appendTo.append(0x2D);
|
||||
appendTo.append((UChar)0x2D);
|
||||
}
|
||||
int32_t len = uprv_itou(buffer, UPRV_LENGTHOF(buffer), (uint32_t) x, 10, 1);
|
||||
appendTo.append(buffer, 0, len);
|
||||
|
|
|
@ -56,24 +56,24 @@ void PluralMapTest::runIndexedTest(int32_t index, UBool exec, const char* &name,
|
|||
}
|
||||
|
||||
void PluralMapTest::TestToCategory() {
|
||||
assertEquals("", PluralMapBase::OTHER, PluralMapBase::toCategory("other"));
|
||||
assertEquals("", PluralMapBase::ZERO, PluralMapBase::toCategory("zero"));
|
||||
assertEquals("", PluralMapBase::ONE, PluralMapBase::toCategory("one"));
|
||||
assertEquals("", PluralMapBase::TWO, PluralMapBase::toCategory("two"));
|
||||
assertEquals("", PluralMapBase::FEW, PluralMapBase::toCategory("few"));
|
||||
assertEquals("", PluralMapBase::MANY, PluralMapBase::toCategory("many"));
|
||||
assertEquals("", PluralMapBase::NONE, PluralMapBase::toCategory("Many"));
|
||||
assertEquals("", (int32_t)PluralMapBase::OTHER, PluralMapBase::toCategory("other"));
|
||||
assertEquals("", (int32_t)PluralMapBase::ZERO, PluralMapBase::toCategory("zero"));
|
||||
assertEquals("", (int32_t)PluralMapBase::ONE, PluralMapBase::toCategory("one"));
|
||||
assertEquals("", (int32_t)PluralMapBase::TWO, PluralMapBase::toCategory("two"));
|
||||
assertEquals("", (int32_t)PluralMapBase::FEW, PluralMapBase::toCategory("few"));
|
||||
assertEquals("", (int32_t)PluralMapBase::MANY, PluralMapBase::toCategory("many"));
|
||||
assertEquals("", (int32_t)PluralMapBase::NONE, PluralMapBase::toCategory("Many"));
|
||||
assertEquals(
|
||||
"",
|
||||
PluralMapBase::FEW,
|
||||
(int32_t)PluralMapBase::FEW,
|
||||
PluralMapBase::toCategory(UnicodeString("few")));
|
||||
assertEquals(
|
||||
"",
|
||||
PluralMapBase::MANY,
|
||||
(int32_t)PluralMapBase::MANY,
|
||||
PluralMapBase::toCategory(UnicodeString("many")));
|
||||
assertEquals(
|
||||
"",
|
||||
PluralMapBase::NONE,
|
||||
(int32_t)PluralMapBase::NONE,
|
||||
PluralMapBase::toCategory(UnicodeString("Many")));
|
||||
}
|
||||
|
||||
|
@ -117,24 +117,24 @@ void PluralMapTest::TestIterate() {
|
|||
PluralMapBase::Category index = PluralMapBase::NONE;
|
||||
const UnicodeString *current = map.next(index);
|
||||
assertEquals("", "pickles", *current);
|
||||
assertEquals("", PluralMapBase::OTHER, index);
|
||||
assertEquals("", (int32_t)PluralMapBase::OTHER, index);
|
||||
current = map.next(index);
|
||||
assertEquals("", "pickle", *current);
|
||||
assertEquals("", PluralMapBase::ONE, index);
|
||||
assertEquals("", (int32_t)PluralMapBase::ONE, index);
|
||||
current = map.next(index);
|
||||
assertEquals("", "picklefew", *current);
|
||||
assertEquals("", PluralMapBase::FEW, index);
|
||||
assertEquals("", (int32_t)PluralMapBase::FEW, index);
|
||||
current = map.next(index);
|
||||
assertEquals("", PluralMapBase::CATEGORY_COUNT, index);
|
||||
assertEquals("", (int32_t)PluralMapBase::CATEGORY_COUNT, index);
|
||||
assertTrue("", current == NULL);
|
||||
|
||||
PluralMapForPluralMapTest map2;
|
||||
index = PluralMapBase::NONE;
|
||||
current = map2.next(index);
|
||||
assertEquals("", "", *current);
|
||||
assertEquals("", PluralMapBase::OTHER, index);
|
||||
assertEquals("", (int32_t)PluralMapBase::OTHER, index);
|
||||
current = map2.next(index);
|
||||
assertEquals("", PluralMapBase::CATEGORY_COUNT, index);
|
||||
assertEquals("", (int32_t)PluralMapBase::CATEGORY_COUNT, index);
|
||||
assertTrue("", current == NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,12 +40,12 @@ void QuantityFormatterTest::TestBasic() {
|
|||
assertFalse(
|
||||
"adding bad variant",
|
||||
fmt.addIfAbsent("a bad variant", "{0} pounds", status));
|
||||
assertEquals("adding bad variant status", U_ILLEGAL_ARGUMENT_ERROR, status);
|
||||
assertEquals("adding bad variant status", (int32_t)U_ILLEGAL_ARGUMENT_ERROR, status);
|
||||
status = U_ZERO_ERROR;
|
||||
assertFalse(
|
||||
"Adding bad pattern",
|
||||
fmt.addIfAbsent("other", "{0} {1} too many placeholders", status));
|
||||
assertEquals("adding bad pattern status", U_ILLEGAL_ARGUMENT_ERROR, status);
|
||||
assertEquals("adding bad pattern status", (int32_t)U_ILLEGAL_ARGUMENT_ERROR, status);
|
||||
status = U_ZERO_ERROR;
|
||||
assertFalse("isValid with no patterns", fmt.isValid());
|
||||
assertTrue(
|
||||
|
@ -121,9 +121,9 @@ void QuantityFormatterTest::TestBasic() {
|
|||
UnicodeString appendTo;
|
||||
assertEquals(
|
||||
"format singular",
|
||||
"1 pound",
|
||||
UnicodeString("1 pound"),
|
||||
fmt.format(
|
||||
1,
|
||||
1.0,
|
||||
*numfmt,
|
||||
*plurrule,
|
||||
appendTo,
|
||||
|
@ -132,9 +132,9 @@ void QuantityFormatterTest::TestBasic() {
|
|||
appendTo.remove();
|
||||
assertEquals(
|
||||
"format plural",
|
||||
"2 pounds",
|
||||
UnicodeString("2 pounds"),
|
||||
fmt.format(
|
||||
2,
|
||||
2.0,
|
||||
*numfmt,
|
||||
*plurrule,
|
||||
appendTo,
|
||||
|
|
|
@ -714,10 +714,10 @@ void RelativeDateTimeFormatterTest::TestGetters() {
|
|||
// copy and assignment.
|
||||
RelativeDateTimeFormatter fmt2(fmt);
|
||||
fmt3 = fmt2;
|
||||
assertEquals("style", UDAT_STYLE_NARROW, fmt3.getFormatStyle());
|
||||
assertEquals("style", (int32_t)UDAT_STYLE_NARROW, fmt3.getFormatStyle());
|
||||
assertEquals(
|
||||
"context",
|
||||
UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE,
|
||||
(int32_t)UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE,
|
||||
fmt3.getCapitalizationContext());
|
||||
assertSuccess("", status);
|
||||
}
|
||||
|
|
|
@ -90,10 +90,10 @@ void SimpleFormatterTest::TestNoArguments() {
|
|||
void SimpleFormatterTest::TestSyntaxErrors() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
SimpleFormatter fmt("{}", status);
|
||||
assertEquals("syntax error {}", U_ILLEGAL_ARGUMENT_ERROR, status);
|
||||
assertEquals("syntax error {}", (int32_t)U_ILLEGAL_ARGUMENT_ERROR, status);
|
||||
status = U_ZERO_ERROR;
|
||||
fmt.applyPattern("{12d", status);
|
||||
assertEquals("syntax error {12d", U_ILLEGAL_ARGUMENT_ERROR, status);
|
||||
assertEquals("syntax error {12d", (int32_t)U_ILLEGAL_ARGUMENT_ERROR, status);
|
||||
}
|
||||
|
||||
void SimpleFormatterTest::TestOneArgument() {
|
||||
|
@ -343,7 +343,7 @@ void SimpleFormatterTest::TestFormatReplaceNoOptimization() {
|
|||
return;
|
||||
}
|
||||
UnicodeString result("original");
|
||||
int offsets[4];
|
||||
int32_t offsets[4];
|
||||
UnicodeString freddy("freddy");
|
||||
UnicodeString frog("frog");
|
||||
UnicodeString by("by");
|
||||
|
@ -373,7 +373,7 @@ void SimpleFormatterTest::TestFormatReplaceNoOptimizationLeadingText() {
|
|||
return;
|
||||
}
|
||||
UnicodeString result("original");
|
||||
int offsets[4];
|
||||
int32_t offsets[4];
|
||||
UnicodeString freddy("freddy");
|
||||
UnicodeString frog("frog");
|
||||
UnicodeString by("by");
|
||||
|
@ -403,7 +403,7 @@ void SimpleFormatterTest::TestFormatReplaceOptimization() {
|
|||
return;
|
||||
}
|
||||
UnicodeString result("original");
|
||||
int offsets[4];
|
||||
int32_t offsets[4];
|
||||
UnicodeString freddy("freddy");
|
||||
UnicodeString frog("frog");
|
||||
UnicodeString by("by");
|
||||
|
@ -433,7 +433,7 @@ void SimpleFormatterTest::TestFormatReplaceNoOptimizationLeadingArgumentUsedTwic
|
|||
return;
|
||||
}
|
||||
UnicodeString result("original");
|
||||
int offsets[4];
|
||||
int32_t offsets[4];
|
||||
UnicodeString freddy("freddy");
|
||||
UnicodeString frog("frog");
|
||||
UnicodeString by("by");
|
||||
|
|
|
@ -410,7 +410,7 @@ struct LocaleData {
|
|||
numDone = 0;
|
||||
}
|
||||
|
||||
UBool nextTest(int &rLocaleIndex, int &rPatternIndex) {
|
||||
UBool nextTest(int32_t &rLocaleIndex, int32_t &rPatternIndex) {
|
||||
Mutex lock;
|
||||
if (patternIndex >= UPRV_LENGTHOF(PATTERNS) - 1) {
|
||||
if (localeIndex >= nLocales - 1) {
|
||||
|
|
BIN
icu4c/source/test/testdata/encoded.utf16be
vendored
BIN
icu4c/source/test/testdata/encoded.utf16be
vendored
Binary file not shown.
Loading…
Add table
Reference in a new issue