summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-src/source/test/intltest/itrbnf.h
blob: 8c23a7d5c6467b4691a3ce2e57c1add1f44680ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
 *******************************************************************************
 * Copyright (C) 1996-2015, International Business Machines Corporation and    *
 * others. All Rights Reserved.                                                *
 *******************************************************************************
 */

#ifndef ITRBNF_H
#define ITRBNF_H

#include "unicode/utypes.h"

#if !UCONFIG_NO_FORMATTING

#include "intltest.h"
#include "unicode/rbnf.h"


class IntlTestRBNF : public IntlTest {
 public:

  // IntlTest override
  virtual void runIndexedTest(int32_t index, UBool exec, const char* &name, char* par);

#if U_HAVE_RBNF
  /** 
   * Perform an API test
   */
  virtual void TestAPI();

  void TestMultiplePluralRules();

  /**
   * Perform a simple spot check on the FractionalRuleSet logic
   */
  virtual void TestFractionalRuleSet();

#if 0
  /**
   * Perform API tests on llong
   */
  virtual void TestLLong();
  virtual void TestLLongConstructors();
  virtual void TestLLongSimpleOperators();
#endif

  /**
   * Perform a simple spot check on the English spellout rules
   */
  void TestEnglishSpellout();

  /**
   * Perform a simple spot check on the English ordinal-abbreviation rules
   */
  void TestOrdinalAbbreviations();

  /**
   * Perform a simple spot check on the duration-formatting rules
   */
  void TestDurations();

  /**
   * Perform a simple spot check on the Spanish spellout rules
   */
  void TestSpanishSpellout();

  /**
   * Perform a simple spot check on the French spellout rules
   */
  void TestFrenchSpellout();

  /**
   * Perform a simple spot check on the Swiss French spellout rules
   */
  void TestSwissFrenchSpellout();

  /**
   * Check that Belgian French matches Swiss French spellout rules
   */
  void TestBelgianFrenchSpellout();

  /**
   * Perform a simple spot check on the Italian spellout rules
   */
  void TestItalianSpellout();

  /**
   * Perform a simple spot check on the Portuguese spellout rules
   */
  void TestPortugueseSpellout();

  /**
   * Perform a simple spot check on the German spellout rules
   */
  void TestGermanSpellout();

  /**
   * Perform a simple spot check on the Thai spellout rules
   */
  void TestThaiSpellout();

  /**
   * Perform a simple spot check on the Swedish spellout rules
   */
  void TestSwedishSpellout();

  /**
   * Perform a simple spot check on small values
   */
  void TestSmallValues();

  /**
   * Test localizations using string data.
   */
  void TestLocalizations();

  /**
   * Test that all locales construct ok.
   */
  void TestAllLocales();

  /**
   * Test that hebrew fractions format without trailing '<'
   */
  void TestHebrewFraction();

  /**
   * Regression test, don't truncate
   * when doing multiplier substitution to a number format rule.
   */
  void TestMultiplierSubstitution();

  /**
   * Test the setDecimalFormatSymbols in RBNF
   */
  void TestSetDecimalFormatSymbols();

  /**
   * Test the plural rules in RBNF
   */
  void TestPluralRules();

    void TestInfinityNaN();
    void TestVariableDecimalPoint();
    void TestRounding();

protected:
  virtual void doTest(RuleBasedNumberFormat* formatter, const char* const testData[][2], UBool testParsing);
  virtual void doLenientParseTest(RuleBasedNumberFormat* formatter, const char* testData[][2]);

/* U_HAVE_RBNF */
#else

  virtual void TestRBNFDisabled();

/* U_HAVE_RBNF */
#endif
};

#endif /* #if !UCONFIG_NO_FORMATTING */

// endif ITRBNF_H
#endif