ICU-11640 Minor code cleanup

X-SVN-Rev: 41415
This commit is contained in:
Shane Carr 2018-05-19 08:04:15 +00:00
parent 898f5a6b11
commit 8265a37aa4
2 changed files with 14 additions and 13 deletions
icu4c/source/test/intltest
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format

View File

@ -9026,19 +9026,20 @@ void NumberFormatTest::Test11020_RoundingInScientificNotation() {
fmt.format(12301.2, result);
assertEquals("Rounding increment should be applied after magnitude scaling", u"1,25E4", result);
}
void NumberFormatTest::Test11640_TripleCurrencySymbol() {
IcuTestErrorCode status(*this, "PercentageRounding");
UnicodeString actual;
DecimalFormat *dFormat = new DecimalFormat("¤¤¤ 0", status);
if (U_FAILURE(status)) {
dataerrln("Failure creating DecimalFormat %s", u_errorName(status));
return;
}
dFormat->setCurrency(u"USD");
UnicodeString result;
dFormat->getPositivePrefix(result);
assertEquals("Tryple-currency should give long name on getPositivePrefix",
"US dollars ", result);
IcuTestErrorCode status(*this, "Test11640_TripleCurrencySymbol");
UnicodeString actual;
DecimalFormat *dFormat = new DecimalFormat("¤¤¤ 0", status);
if (U_FAILURE(status)) {
dataerrln("Failure creating DecimalFormat %s", u_errorName(status));
return;
}
dFormat->setCurrency(u"USD");
UnicodeString result;
dFormat->getPositivePrefix(result);
assertEquals("Triple-currency should give long name on getPositivePrefix",
"US dollars ", result);
}
#endif /* #if !UCONFIG_NO_FORMATTING */

View File

@ -5018,7 +5018,7 @@ public class NumberFormatTest extends TestFmwk {
}
@Test
public void Test11640() {
public void Test11640_TripleCurrencySymbol() {
DecimalFormat df = (DecimalFormat) NumberFormat.getInstance();
df.applyPattern("¤¤¤ 0");
String result = df.getPositivePrefix();