if (index > other.index) {
return 1;
}
- // TODO(icu-units#70): revisit when fixing normalization. For now we're
- // sorting binary prefixes before SI prefixes, as per enum values order.
+ // TODO: revisit if the spec dictates prefix sort order - it doesn't
+ // currently. For now we're sorting binary prefixes before SI prefixes,
+ // as per enum values order.
if (unitPrefix < other.unitPrefix) {
return -1;
}
{"kilogram-per-meter-per-second", "kilogram-per-meter-second"},
{"kilometer-per-second-per-megaparsec", "kilometer-per-megaparsec-second"},
- // TODO(ICU-21284): Add more test cases once the proper ranking is available.
+ // Correct order of units, as per unitQuantities in CLDR's units.xml
{"newton-meter", "newton-meter"},
{"meter-newton", "newton-meter"},
{"pound-force-foot", "pound-force-foot"},
continue;
}
- // TODO(ICU-21284,icu-units#70): fix normalization. Until then, ignore:
- if (uprv_strcmp(unit.getIdentifier(), "pound-force-foot") == 0) continue;
- if (uprv_strcmp(unit.getIdentifier(), "kilowatt-hour") == 0) continue;
- if (uprv_strcmp(unit.getIdentifier(), "newton-meter") == 0) continue;
-
// Prove that all built-in units are parseable, except "generic" temperature:
MeasureUnit parsed = MeasureUnit::forIdentifier(unit.getIdentifier(), status);
if (unit == MeasureUnit::getGenericTemperature()) {
if (index > other.index) {
return 1;
}
- // TODO(icu-units#70): revisit when fixing normalization. For now we're
- // sorting binary prefixes before SI prefixes, for consistency with ICU4C.
+ // TODO: revisit if the spec dictates prefix sort order - it doesn't
+ // currently. For now we're sorting binary prefixes before SI prefixes,
+ // as per ICU4C's enum values order.
if (this.getPrefix().getBase() < other.getPrefix().getBase()) {
return 1;
}
new TestCase("kilogram-per-meter-per-second", "kilogram-per-meter-second"),
new TestCase("kilometer-per-second-per-megaparsec", "kilometer-per-megaparsec-second"),
- // TODO(ICU-21284): Add more test cases once the proper ranking is available.
+ // Correct order of units, as per unitQuantities in CLDR's units.xml
new TestCase("newton-meter", "newton-meter"),
new TestCase("meter-newton", "newton-meter"),
new TestCase("pound-force-foot", "pound-force-foot"),
continue;
}
- // TODO(ICU-21284,icu-units#70): fix normalization. Until then, ignore:
- if (unit.getIdentifier() == "pound-force-foot") continue;
- if (unit.getIdentifier() == "kilowatt-hour") continue;
- if (unit.getIdentifier() == "newton-meter") continue;
-
// Prove that all built-in units are parseable, except "generic" temperature:
if (unit == MeasureUnit.GENERIC_TEMPERATURE) {
try {