X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/efa1e6592fb03ce23b15276b2b91d885a3ee7da5..57a6839dcb3bba09e8228b822b290604668416fe:/icuSources/test/intltest/numfmtst.h diff --git a/icuSources/test/intltest/numfmtst.h b/icuSources/test/intltest/numfmtst.h index d46add7c..f25a4250 100644 --- a/icuSources/test/intltest/numfmtst.h +++ b/icuSources/test/intltest/numfmtst.h @@ -1,6 +1,6 @@ /************************************************************************ * COPYRIGHT: - * Copyright (c) 1997-2012, International Business Machines Corporation + * Copyright (c) 1997-2014, International Business Machines Corporation * and others. All Rights Reserved. ************************************************************************/ @@ -160,9 +160,32 @@ class NumberFormatTest: public CalendarTimeZoneTest { void TestFormattableSize(); + void TestUFormattable(); + void TestEnumSet(); + void TestSignificantDigits(); + void TestShowZero(); + + void TestCompatibleCurrencies(); + void TestBug9936(); + void TestParseNegativeWithFaLocale(); + void TestParseNegativeWithAlternateMinusSign(); + + void TestCustomCurrencySignAndSeparator(); + + void TestParseSignsAndMarks(); + void Test10419RoundingWith0FractionDigits(); + void Test10468ApplyPattern(); + void TestRoundingScientific10542(); + void TestZeroScientific10547(); + void TestAccountingCurrency(); + void TestEquality(); + private: + UBool testFormattableAsUFormattable(const char *file, int line, Formattable &f); + + void expectParseCurrency(const NumberFormat &fmt, const UChar* currency, double amount, const char *text); static UBool equalValue(const Formattable& a, const Formattable& b); @@ -201,11 +224,21 @@ class NumberFormatTest: public CalendarTimeZoneTest { } void expect(NumberFormat* fmt, const Formattable& n, - const UnicodeString& exp, UErrorCode); + const UnicodeString& exp, UBool rt, UErrorCode errorCode); + + void expect(NumberFormat* fmt, const Formattable& n, + const char *exp, UBool rt, UErrorCode errorCode) { + expect(fmt, n, UnicodeString(exp, ""), rt, errorCode); + } + + void expect(NumberFormat* fmt, const Formattable& n, + const UnicodeString& exp, UErrorCode errorCode) { + expect(fmt, n, exp, TRUE, errorCode); + } void expect(NumberFormat* fmt, const Formattable& n, const char *exp, UErrorCode errorCode) { - expect(fmt, n, UnicodeString(exp, ""), errorCode); + expect(fmt, n, UnicodeString(exp, ""), TRUE, errorCode); } void expectCurrency(NumberFormat& nf, const Locale& locale, @@ -258,6 +291,16 @@ class NumberFormatTest: public CalendarTimeZoneTest { void checkRounding(DecimalFormat* df, double base, int iterations, double increment); double checkRound(DecimalFormat* df, double iValue, double lastParsed); + + void verifyRounding( + DecimalFormat& format, + const double *values, + const char * const *expected, + const DecimalFormat::ERoundingMode *roundingModes, + const char * const *descriptions, + int32_t valueSize, + int32_t roundingModeSize); + }; #endif /* #if !UCONFIG_NO_FORMATTING */