]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/intltest/numfmtst.h
ICU-64243.0.1.tar.gz
[apple/icu.git] / icuSources / test / intltest / numfmtst.h
index 04d1f8fa3e7e3a3f97a1813c45c0328a7df98466..7dbd31c2df6d97eb941befcc963f417755d132a9 100644 (file)
@@ -1,3 +1,5 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /************************************************************************
  * COPYRIGHT:
  * Copyright (c) 1997-2016, International Business Machines Corporation
@@ -14,6 +16,7 @@
 #include "unicode/numfmt.h"
 #include "unicode/decimfmt.h"
 #include "caltztst.h"
+#include "datadrivennumberformattestsuite.h"
 
 /**
  * Expected field positions from field position iterator. Tests should
@@ -28,6 +31,35 @@ struct NumberFormatTest_Attributes {
     int32_t epos;
 };
 
+
+/**
+ * Header for the data-driven test, powered by numberformattestspecification.txt
+ */
+class NumberFormatDataDrivenTest : public DataDrivenNumberFormatTestSuite {
+  public:
+    void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par );
+    void TestNumberFormatTestTuple();
+    void TestDataDrivenICU4C();
+
+  protected:
+    UBool isFormatPass(
+            const NumberFormatTestTuple &tuple,
+            UnicodeString &appendErrorMessage,
+            UErrorCode &status);
+    UBool isToPatternPass(
+            const NumberFormatTestTuple &tuple,
+            UnicodeString &appendErrorMessage,
+            UErrorCode &status);
+    UBool isParsePass(
+            const NumberFormatTestTuple &tuple,
+            UnicodeString &appendErrorMessage,
+            UErrorCode &status);
+    UBool isParseCurrencyPass(
+            const NumberFormatTestTuple &tuple,
+            UnicodeString &appendErrorMessage,
+            UErrorCode &status);
+};
+
 /**
  * Performs various in-depth test on NumberFormat
  **/
@@ -43,6 +75,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
     void TestAPI(void);
 
     void TestCoverage(void);
+    void TestLocalizedPatternSymbolCoverage();
 
     /**
      * Test the handling of quotes
@@ -65,6 +98,8 @@ class NumberFormatTest: public CalendarTimeZoneTest {
      **/
     //void TestDigitList(void);
 
+    void Test20186_SpacesAroundSemicolon(void);
+
     /**
      * Test localized currency patterns.
      */
@@ -118,6 +153,8 @@ class NumberFormatTest: public CalendarTimeZoneTest {
 
     void TestCurrencyNames(void);
 
+    void Test20484_NarrowSymbolFallback(void);
+
     void TestCurrencyAmount(void);
 
     void TestCurrencyUnit(void);
@@ -153,6 +190,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
     void TestSpaceParsing();
     void TestMultiCurrencySign();
     void TestCurrencyFormatForMixParsing();
+    void TestMismatchedCurrencyFormatFail();
     void TestDecimalFormatCurrencyParse();
     void TestCurrencyIsoPluralFormat();
     void TestCurrencyParsing();
@@ -196,8 +234,6 @@ class NumberFormatTest: public CalendarTimeZoneTest {
     void TestEquality();
 
     void TestCurrencyUsage();
-    void TestNumberFormatTestTuple();
-    void TestDataDriven();
 
     void TestDoubleLimit11439();
     void TestFastPathConsistent11524();
@@ -208,13 +244,58 @@ class NumberFormatTest: public CalendarTimeZoneTest {
     void TestFractionalDigitsForCurrency();
     void TestFormatCurrencyPlural();
     void Test11868();
+    void Test11739_ParseLongCurrency();
+    void Test13035_MultiCodePointPaddingInPattern();
+    void Test13737_ParseScientificStrict();
     void Test10727_RoundingZero();
     void Test11376_getAndSetPositivePrefix();
     void Test11475_signRecognition();
     void Test11640_getAffixes();
     void Test11649_toPatternWithMultiCurrency();
-
-    void checkExceptionIssue11735();
+    void Test13327_numberingSystemBufferOverflow();
+    void Test13391_chakmaParsing();
+
+    void Test11735_ExceptionIssue();
+    void Test11035_FormatCurrencyAmount();
+    void Test11318_DoubleConversion();
+    void TestParsePercentRegression();
+    void TestMultiplierWithScale();
+    void TestFastFormatInt32();
+    void Test11646_Equality();
+    void TestParseNaN();
+    void TestFormatFailIfMoreThanMaxDigits();
+    void TestParseCaseSensitive();
+    void TestParseNoExponent();
+    void TestSignAlwaysShown();
+    void TestMinimumGroupingDigits();
+    void Test11897_LocalizedPatternSeparator();
+    void Test13055_PercentageRounding();
+    void Test11839();
+    void Test10354();
+    void Test11645_ApplyPatternEquality();
+    void Test12567();
+    void Test11626_CustomizeCurrencyPluralInfo();
+    void Test20073_StrictPercentParseErrorIndex();
+    void Test13056_GroupingSize();
+    void Test11025_CurrencyPadding();
+    void Test11648_ExpDecFormatMalPattern();
+    void Test11649_DecFmtCurrencies();
+    void Test13148_ParseGroupingSeparators();
+    void Test12753_PatternDecimalPoint();
+    void Test11647_PatternCurrencySymbols();
+    void Test11913_BigDecimal();
+    void Test11020_RoundingInScientificNotation();
+    void Test11640_TripleCurrencySymbol();
+    void Test13763_FieldPositionIteratorOffset();
+    void Test13777_ParseLongNameNonCurrencyMode();
+    void Test13804_EmptyStringsWhenParsing();
+    void Test20037_ScientificIntegerOverflow();
+    void Test13840_ParseLongStringCrash();
+    void Test13850_EmptyStringCurrency();
+    void Test20348_CurrencyPrefixOverride();
+    void Test20358_GroupingInPattern();
+    void Test13731_DefaultCurrency();
+    void Test20499_CurrencyVisibleDigitsPlural();
 
  private:
     UBool testFormattableAsUFormattable(const char *file, int line, Formattable &f);