Skip to content

Commit

Permalink
ICU-22325 CLDR 44 alpha2 integration to ICU part three, source files …
Browse files Browse the repository at this point in the history
…changes
  • Loading branch information
DraganBesevic committed Sep 13, 2023
1 parent 6b08bb6 commit bb73529
Show file tree
Hide file tree
Showing 18 changed files with 160 additions and 76 deletions.
6 changes: 3 additions & 3 deletions icu4c/source/i18n/measunit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ static const char * const gSubTypes[] = {
"watt",
"atmosphere",
"bar",
"gasoline-equivalent",
"gasoline-energy-density",
"hectopascal",
"inch-ofhg",
"kilopascal",
Expand Down Expand Up @@ -1688,11 +1688,11 @@ MeasureUnit MeasureUnit::getBar() {
return MeasureUnit(18, 1);
}

MeasureUnit *MeasureUnit::createGasolineEquivalent(UErrorCode &status) {
MeasureUnit *MeasureUnit::createGasolineEnergyDensity(UErrorCode &status) {
return MeasureUnit::create(18, 2, status);
}

MeasureUnit MeasureUnit::getGasolineEquivalent() {
MeasureUnit MeasureUnit::getGasolineEnergyDensity() {
return MeasureUnit(18, 2);
}

Expand Down
12 changes: 6 additions & 6 deletions icu4c/source/i18n/unicode/measunit.h
Original file line number Diff line number Diff line change
Expand Up @@ -2882,20 +2882,20 @@ class U_I18N_API MeasureUnit: public UObject {

#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of pressure: gasoline-equivalent.
* Returns by pointer, unit of pressure: gasoline-energy-density.
* Caller owns returned value and must free it.
* Also see {@link #getGasolineEquivalent()}.
* Also see {@link #getGasolineEnergyDensity()}.
* @param status ICU error code.
* @draft ICU 74
*/
static MeasureUnit *createGasolineEquivalent(UErrorCode &status);
static MeasureUnit *createGasolineEnergyDensity(UErrorCode &status);

/**
* Returns by value, unit of pressure: gasoline-equivalent.
* Also see {@link #createGasolineEquivalent()}.
* Returns by value, unit of pressure: gasoline-energy-density.
* Also see {@link #createGasolineEnergyDensity()}.
* @draft ICU 74
*/
static MeasureUnit getGasolineEquivalent();
static MeasureUnit getGasolineEnergyDensity();
#endif /* U_HIDE_DRAFT_API */

/**
Expand Down
16 changes: 8 additions & 8 deletions icu4c/source/test/cintltst/cdattst.c
Original file line number Diff line number Diff line change
Expand Up @@ -2087,24 +2087,24 @@ static void TestHourCycle(void) {
// test some locales for which we have data
u"en_US", u"Tuesday, March 16, 1943 at 3:45:32 PM",
u"en_CA", u"Tuesday, March 16, 1943 at 3:45:32 p.m.",
u"en_GB", u"Tuesday, 16 March 1943 at 15:45:32",
u"en_AU", u"Tuesday, 16 March 1943 at 3:45:32 pm",
u"en_GB", u"Tuesday 16 March 1943 at 15:45:32",
u"en_AU", u"Tuesday 16 March 1943 at 3:45:32 pm",
// test a couple locales for which we don't have specific locale files (we should still get the correct hour cycle)
u"en_CO", u"Tuesday, March 16, 1943 at 3:45:32 PM",
u"en_MX", u"Tuesday, March 16, 1943 at 15:45:32",
u"en_MX", u"Tuesday, March 16, 1943 at 3:45:32 PM",
// test that the rg subtag does the right thing
u"en_US@rg=GBzzzz", u"Tuesday, March 16, 1943 at 15:45:32",
u"en_US@rg=CAzzzz", u"Tuesday, March 16, 1943 at 3:45:32 PM",
u"en_CA@rg=USzzzz", u"Tuesday, March 16, 1943 at 3:45:32 p.m.",
u"en_GB@rg=USzzzz", u"Tuesday, 16 March 1943 at 3:45:32 pm",
u"en_GB@rg=CAzzzz", u"Tuesday, 16 March 1943 at 3:45:32 pm",
u"en_GB@rg=AUzzzz", u"Tuesday, 16 March 1943 at 3:45:32 pm",
u"en_GB@rg=USzzzz", u"Tuesday 16 March 1943 at 3:45:32 pm",
u"en_GB@rg=CAzzzz", u"Tuesday 16 March 1943 at 3:45:32 pm",
u"en_GB@rg=AUzzzz", u"Tuesday 16 March 1943 at 3:45:32 pm",
// test that the hc ("hours") subtag does the right thing
u"en_US@hours=h23", u"Tuesday, March 16, 1943 at 15:45:32",
u"en_GB@hours=h12", u"Tuesday, 16 March 1943 at 3:45:32 pm",
u"en_GB@hours=h12", u"Tuesday 16 March 1943 at 3:45:32 pm",
// test that the rg and hc subtags do the right thing when used together
u"en_US@rg=GBzzzz;hours=h12", u"Tuesday, March 16, 1943 at 3:45:32 PM",
u"en_GB@rg=USzzzz;hours=h23", u"Tuesday, 16 March 1943 at 15:45:32",
u"en_GB@rg=USzzzz;hours=h23", u"Tuesday 16 March 1943 at 15:45:32",
};

for (int32_t i = 0; i < UPRV_LENGTHOF(testCases); i += 2) {
Expand Down
18 changes: 9 additions & 9 deletions icu4c/source/test/intltest/dtfmttst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4458,7 +4458,7 @@ void DateFormatTest::TestFormatsWithNumberSystems()
const UDate date = 1451556000000.0; // for UTC: grego 31-Dec-2015 10 AM, hebrew 19 tevet 5776, chinese yi-wei 11mo 21day
const TestFmtWithNumSysItem items[] = {
{ "haw@calendar=gregorian", DateFormat::kShort, UnicodeString("d/M/yy"), UnicodeString("31/xii/15") },
{ "he@calendar=hebrew", DateFormat::kLong, CharsToUnicodeString("d \\u05D1MMMM y"), CharsToUnicodeString("\\u05D9\\u05F4\\u05D8 \\u05D1\\u05D8\\u05D1\\u05EA \\u05EA\\u05E9\\u05E2\\u05F4\\u05D5") },
{ "he@calendar=hebrew", DateFormat::kLong, CharsToUnicodeString("d \\u05D1MMMM y"), CharsToUnicodeString("\\u05D9\\u05F4\\u05D8 \\u05D1\\u05D8\\u05D1\\u05EA \\u05EA\\u05E9\\u05E2\\u05F4\\u05D5") },
{ "zh@calendar=chinese", DateFormat::kLong, CharsToUnicodeString("rU\\u5E74MMMd"), CharsToUnicodeString("2015\\u4E59\\u672A\\u5E74\\u5341\\u4E00\\u6708\\u5EFF\\u4E00") },
{ "zh_Hant@calendar=chinese", DateFormat::kLong, CharsToUnicodeString("rU\\u5E74MMMd"), CharsToUnicodeString("2015\\u4E59\\u672A\\u5E74\\u51AC\\u6708\\u5EFF\\u4E00") },
{ "ja@calendar=chinese", DateFormat::kLong, CharsToUnicodeString("U\\u5E74MMMd\\u65E5"), CharsToUnicodeString("\\u4E59\\u672A\\u5E74\\u5341\\u4E00\\u6708\\u4E8C\\u4E00\\u65E5") },
Expand Down Expand Up @@ -5838,24 +5838,24 @@ void DateFormatTest::TestHourCycle() {
// test some locales for which we have data
{ "en-us", u"Tuesday, March 16, 1943 at 3:45:32 PM" },
{ "en-ca", u"Tuesday, March 16, 1943 at 3:45:32 p.m." },
{ "en-gb", u"Tuesday, 16 March 1943 at 15:45:32" },
{ "en-au", u"Tuesday, 16 March 1943 at 3:45:32 pm" },
{ "en-gb", u"Tuesday 16 March 1943 at 15:45:32" },
{ "en-au", u"Tuesday 16 March 1943 at 3:45:32 pm" },
// test a couple locales for which we don't have specific locale files (we should still get the correct hour cycle)
{ "en-co", u"Tuesday, March 16, 1943 at 3:45:32 PM" },
{ "en-mx", u"Tuesday, March 16, 1943 at 15:45:32" },
{ "en-mx", u"Tuesday, March 16, 1943 at 3:45:32 PM" },
// test that the rg subtag does the right thing
{ "en-us-u-rg-gbzzzz", u"Tuesday, March 16, 1943 at 15:45:32" },
{ "en-us-u-rg-cazzzz", u"Tuesday, March 16, 1943 at 3:45:32 PM" },
{ "en-ca-u-rg-uszzzz", u"Tuesday, March 16, 1943 at 3:45:32 p.m." },
{ "en-gb-u-rg-uszzzz", u"Tuesday, 16 March 1943 at 3:45:32 pm" },
{ "en-gb-u-rg-cazzzz", u"Tuesday, 16 March 1943 at 3:45:32 pm" },
{ "en-gb-u-rg-auzzzz", u"Tuesday, 16 March 1943 at 3:45:32 pm" },
{ "en-gb-u-rg-uszzzz", u"Tuesday 16 March 1943 at 3:45:32 pm" },
{ "en-gb-u-rg-cazzzz", u"Tuesday 16 March 1943 at 3:45:32 pm" },
{ "en-gb-u-rg-auzzzz", u"Tuesday 16 March 1943 at 3:45:32 pm" },
// test that the hc ("hours") subtag does the right thing
{ "en-us-u-hc-h23", u"Tuesday, March 16, 1943 at 15:45:32" },
{ "en-gb-u-hc-h12", u"Tuesday, 16 March 1943 at 3:45:32 pm" },
{ "en-gb-u-hc-h12", u"Tuesday 16 March 1943 at 3:45:32 pm" },
// test that the rg and hc subtags do the right thing when used together
{ "en-us-u-rg-gbzzzz-hc-h12", u"Tuesday, March 16, 1943 at 3:45:32 PM" },
{ "en-gb-u-rg-uszzzz-hc-h23", u"Tuesday, 16 March 1943 at 15:45:32" },
{ "en-gb-u-rg-uszzzz-hc-h23", u"Tuesday 16 March 1943 at 15:45:32" },
};

for (int32_t i = 0; i < UPRV_LENGTHOF(TEST_CASES); i++) {
Expand Down
2 changes: 1 addition & 1 deletion icu4c/source/test/intltest/dtptngts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void IntlTestDateTimePatternGeneratorAPI::testAPI(/*char *par*/)

UnicodeString patternResults_de_DE[] = {
// de_DE // 2 de_DE
UnicodeString("01/1999"), // 00: yM
UnicodeString("1/1999"), // 00: yM
UnicodeString("Jan. 1999"), // 01: yMMM
UnicodeString("13.1.1999"), // 02: yMd
UnicodeString("13. Jan. 1999"), // 03: yMMMd
Expand Down
4 changes: 2 additions & 2 deletions icu4c/source/test/intltest/measfmttest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4117,8 +4117,8 @@ void MeasureFormatTest::TestCompatible74() {
measureUnitValue = MeasureUnit::getAtmosphere();
measureUnit.adoptInstead(MeasureUnit::createBar(status));
measureUnitValue = MeasureUnit::getBar();
measureUnit.adoptInstead(MeasureUnit::createGasolineEquivalent(status));
measureUnitValue = MeasureUnit::getGasolineEquivalent();
measureUnit.adoptInstead(MeasureUnit::createGasolineEnergyDensity(status));
measureUnitValue = MeasureUnit::getGasolineEnergyDensity();
measureUnit.adoptInstead(MeasureUnit::createHectopascal(status));
measureUnitValue = MeasureUnit::getHectopascal();
measureUnit.adoptInstead(MeasureUnit::createInchHg(status));
Expand Down
4 changes: 2 additions & 2 deletions icu4c/source/test/intltest/numfmtst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8099,9 +8099,9 @@ void NumberFormatTest::TestAccountingCurrency() {
expect(NumberFormat::createInstance("de_DE", style, status),
(Formattable)(double)-23456.7, UnicodeString("-23.456,70\\u00A0\\u20AC").unescape(), true, status);
expect(NumberFormat::createInstance("en_ID", style, status),
(Formattable)(double)0, UnicodeString("IDR\\u00A00.00").unescape(), true, status);
(Formattable)(double)0, UnicodeString("Rp\\u00A00,00").unescape(), true, status);
expect(NumberFormat::createInstance("en_ID", style, status),
(Formattable)(double)-0.2, UnicodeString("(IDR\\u00A00.20)").unescape(), true, status);
(Formattable)(double)-0.2, UnicodeString("(Rp\\u00A00,20)").unescape(), true, status);
expect(NumberFormat::createInstance("sh_ME", style, status),
(Formattable)(double)0, UnicodeString("0,00\\u00A0\\u20AC").unescape(), true, status);
expect(NumberFormat::createInstance("sh_ME", style, status),
Expand Down
4 changes: 2 additions & 2 deletions icu4c/source/test/intltest/units_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ void unitsTestDataLineFn(void *context, char *fields[][2], int32_t fieldCount, U
StringPiece y = trimField(fields[2]);
StringPiece commentConversionFormula = trimField(fields[3]);
StringPiece utf8Expected = trimField(fields[4]);
StringPiece gasolineEquivalent("gasoline-equivalent");
StringPiece gasolineEnergyDensity("gasoline-energy-density");

if ( x.compare(gasolineEquivalent) == 0 && unitsTest->logKnownIssue("CLDR-17015", "Problem with gasoline-equivalent unit calculation")) {
if ( x.compare(gasolineEnergyDensity) == 0 && unitsTest->logKnownIssue("CLDR-17015", "Problem with gasoline-energy-density unit calculation")) {
return;
}

Expand Down
Loading

0 comments on commit bb73529

Please sign in to comment.