]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/intltest/numfmtst.h
ICU-531.31.tar.gz
[apple/icu.git] / icuSources / test / intltest / numfmtst.h
index da44791fb19b36afea3c892d228f6a5a07cbdab1..f25a4250a69b77efa9526d43c5426a0fe9068f8e 100644 (file)
@@ -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.
  ************************************************************************/
 
@@ -156,9 +156,36 @@ class NumberFormatTest: public CalendarTimeZoneTest {
     void TestExplicitParents();
     void TestAvailableNumberingSystems();
     void Test9087();
+    void TestFormatFastpaths();
 
+    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);
 
@@ -197,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,
@@ -254,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 */