ICU-7282 The problem reported by ticket#7282 is only reproduced in ICU4J. Just adding the equivalent test case to ICU4C.
X-SVN-Rev: 28112
This commit is contained in:
parent
8719f0c410
commit
8096281cc9
@ -108,6 +108,7 @@ void NumberFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &n
|
||||
CASE(45,TestFormatAttributes);
|
||||
CASE(46,TestFieldPositionIterator);
|
||||
CASE(47,TestDecimal);
|
||||
CASE(48,TestCurrencyFractionDigits);
|
||||
default: name = ""; break;
|
||||
}
|
||||
}
|
||||
@ -6116,4 +6117,26 @@ void NumberFormatTest::TestDecimal() {
|
||||
|
||||
}
|
||||
|
||||
void NumberFormatTest::TestCurrencyFractionDigits() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UnicodeString text1, text2;
|
||||
double value = 99.12345;
|
||||
|
||||
// Create currenct instance
|
||||
NumberFormat* fmt = NumberFormat::createCurrencyInstance("ja_JP", status);
|
||||
ASSERT_SUCCESS(status);
|
||||
fmt->format(value, text1);
|
||||
|
||||
// Reset the same currency and format the test value again
|
||||
fmt->setCurrency(fmt->getCurrency(), status);
|
||||
ASSERT_SUCCESS(status);
|
||||
fmt->format(value, text2);
|
||||
|
||||
if (text1 != text2) {
|
||||
errln((UnicodeString)"NumberFormat::format() should return the same result - text1="
|
||||
+ text1 + " text2=" + text2);
|
||||
}
|
||||
delete fmt;
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
@ -146,6 +146,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
|
||||
void TestFieldPositionIterator();
|
||||
|
||||
void TestDecimal();
|
||||
void TestCurrencyFractionDigits();
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user