Home | History | Annotate | Download | only in intltest
      1 /*
      2  *******************************************************************************
      3  * Copyright (C) 1996-2015, International Business Machines Corporation and    *
      4  * others. All Rights Reserved.                                                *
      5  *******************************************************************************
      6  */
      7 
      8 #ifndef ITRBNF_H
      9 #define ITRBNF_H
     10 
     11 #include "unicode/utypes.h"
     12 
     13 #if !UCONFIG_NO_FORMATTING
     14 
     15 #include "intltest.h"
     16 #include "unicode/rbnf.h"
     17 
     18 
     19 class IntlTestRBNF : public IntlTest {
     20  public:
     21 
     22   // IntlTest override
     23   virtual void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par);
     24 
     25 #if U_HAVE_RBNF
     26   /**
     27    * Perform an API test
     28    */
     29   virtual void TestAPI();
     30 
     31   void TestMultiplePluralRules();
     32 
     33   /**
     34    * Perform a simple spot check on the FractionalRuleSet logic
     35    */
     36   virtual void TestFractionalRuleSet();
     37 
     38 #if 0
     39   /**
     40    * Perform API tests on llong
     41    */
     42   virtual void TestLLong();
     43   virtual void TestLLongConstructors();
     44   virtual void TestLLongSimpleOperators();
     45 #endif
     46 
     47   /**
     48    * Perform a simple spot check on the English spellout rules
     49    */
     50   void TestEnglishSpellout();
     51 
     52   /**
     53    * Perform a simple spot check on the English ordinal-abbreviation rules
     54    */
     55   void TestOrdinalAbbreviations();
     56 
     57   /**
     58    * Perform a simple spot check on the duration-formatting rules
     59    */
     60   void TestDurations();
     61 
     62   /**
     63    * Perform a simple spot check on the Spanish spellout rules
     64    */
     65   void TestSpanishSpellout();
     66 
     67   /**
     68    * Perform a simple spot check on the French spellout rules
     69    */
     70   void TestFrenchSpellout();
     71 
     72   /**
     73    * Perform a simple spot check on the Swiss French spellout rules
     74    */
     75   void TestSwissFrenchSpellout();
     76 
     77   /**
     78    * Check that Belgian French matches Swiss French spellout rules
     79    */
     80   void TestBelgianFrenchSpellout();
     81 
     82   /**
     83    * Perform a simple spot check on the Italian spellout rules
     84    */
     85   void TestItalianSpellout();
     86 
     87   /**
     88    * Perform a simple spot check on the Portuguese spellout rules
     89    */
     90   void TestPortugueseSpellout();
     91 
     92   /**
     93    * Perform a simple spot check on the German spellout rules
     94    */
     95   void TestGermanSpellout();
     96 
     97   /**
     98    * Perform a simple spot check on the Thai spellout rules
     99    */
    100   void TestThaiSpellout();
    101 
    102   /**
    103    * Perform a simple spot check on the Swedish spellout rules
    104    */
    105   void TestSwedishSpellout();
    106 
    107   /**
    108    * Perform a simple spot check on small values
    109    */
    110   void TestSmallValues();
    111 
    112   /**
    113    * Test localizations using string data.
    114    */
    115   void TestLocalizations();
    116 
    117   /**
    118    * Test that all locales construct ok.
    119    */
    120   void TestAllLocales();
    121 
    122   /**
    123    * Test that hebrew fractions format without trailing '<'
    124    */
    125   void TestHebrewFraction();
    126 
    127   /**
    128    * Regression test, don't truncate
    129    * when doing multiplier substitution to a number format rule.
    130    */
    131   void TestMultiplierSubstitution();
    132 
    133   /**
    134    * Test the setDecimalFormatSymbols in RBNF
    135    */
    136   void TestSetDecimalFormatSymbols();
    137 
    138   /**
    139    * Test the plural rules in RBNF
    140    */
    141   void TestPluralRules();
    142 
    143     void TestInfinityNaN();
    144     void TestVariableDecimalPoint();
    145     void TestRounding();
    146 
    147 protected:
    148   virtual void doTest(RuleBasedNumberFormat* formatter, const char* const testData[][2], UBool testParsing);
    149   virtual void doLenientParseTest(RuleBasedNumberFormat* formatter, const char* testData[][2]);
    150 
    151 /* U_HAVE_RBNF */
    152 #else
    153 
    154   virtual void TestRBNFDisabled();
    155 
    156 /* U_HAVE_RBNF */
    157 #endif
    158 };
    159 
    160 #endif /* #if !UCONFIG_NO_FORMATTING */
    161 
    162 // endif ITRBNF_H
    163 #endif
    164