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