const DecimalFormatSymbols& dfs;
IgnorablesMatcher& ignorables;
const Locale& locale;
-
-// const UChar* currencyCode, const UnicodeString* currency1,
-// const UnicodeString* currency2, const DecimalFormatSymbols* dfs,
-// IgnorablesMatcher* ignorables, const Locale* locale
};
TESTCASE_AUTO(Test11649_toPatternWithMultiCurrency);
TESTCASE_AUTO(Test13327_numberingSystemBufferOverflow);
TESTCASE_AUTO(Test13391_chakmaParsing);
+ TESTCASE_AUTO(Test11735_ExceptionIssue);
TESTCASE_AUTO(Test11035_FormatCurrencyAmount);
TESTCASE_AUTO(Test11318_DoubleConversion);
TESTCASE_AUTO_END;
}
DecimalFormat *dfmt = (DecimalFormat *) fmt.getAlias();
UnicodeString result;
- UnicodeString tripleIntlCurrency(" \\u00a4\\u00a4\\u00a4");
- tripleIntlCurrency = tripleIntlCurrency.unescape();
- assertEquals("", tripleIntlCurrency, dfmt->getPositiveSuffix(result));
+ assertEquals("", u" (unknown currency)", dfmt->getPositiveSuffix(result));
dfmt->setCurrency(USD);
// getPositiveSuffix() always returns the suffix for the
}
}
-void NumberFormatTest::checkExceptionIssue11735() {
- UErrorCode status;
+void NumberFormatTest::Test11735_ExceptionIssue() {
+ UErrorCode status = U_ZERO_ERROR;
Locale enLocale("en");
DecimalFormatSymbols symbols(enLocale, status);
void Test13327_numberingSystemBufferOverflow();
void Test13391_chakmaParsing();
- void checkExceptionIssue11735();
+ void Test11735_ExceptionIssue();
void Test11035_FormatCurrencyAmount();
void Test11318_DoubleConversion();
if (currency == null) {
currency = symbols.getCurrency();
}
- String currency1Sym = symbols.getCurrencySymbol();
- String currency2Sym = symbols.getInternationalCurrencySymbol();
if (currency == null) {
- return new CustomSymbolCurrency("XXX", currency1Sym, currency2Sym);
+ return Currency.getInstance("XXX");
}
if (!currency.equals(symbols.getCurrency())) {
return currency;
}
+ String currency1Sym = symbols.getCurrencySymbol();
+ String currency2Sym = symbols.getInternationalCurrencySymbol();
String currency1 = currency.getName(symbols.getULocale(), Currency.SYMBOL_NAME, null);
String currency2 = currency.getCurrencyCode();
if (!currency1.equals(currency1Sym) || !currency2.equals(currency2Sym)) {
public void testCurrencyPluralAffixOverrides() {
// The affix setters should override CurrencyPluralInfo, used in the plural currency constructor.
DecimalFormat df = (DecimalFormat) NumberFormat.getInstance(ULocale.ENGLISH, NumberFormat.PLURALCURRENCYSTYLE);
+ assertEquals("Defaults to unknown currency", " (unknown currency)", df.getPositiveSuffix());
df.setCurrency(Currency.getInstance("USD"));
+ assertEquals("Should resolve to CurrencyPluralInfo", " US dollars", df.getPositiveSuffix());
df.setPositiveSuffix("lala");
assertEquals("Custom suffix should round-trip", "lala", df.getPositiveSuffix());
assertEquals("Custom suffix should be used in formatting", "123.00lala", df.format(123));