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

View File

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

View File

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