• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // © 2022 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 
4 #include "unicode/utypes.h"
5 
6 #if !UCONFIG_NO_FORMATTING
7 
8 #include "intltest.h"
9 #include "unicode/displayoptions.h"
10 #include "unicode/udisplayoptions.h"
11 
12 class DisplayOptionsTest : public IntlTest {
13   public:
14     void testDisplayOptionsDefault();
15     void testDisplayOptionsEachElement();
16     void testDisplayOptionsUpdating();
17     void testDisplayOptionsGetIdentifier();
18     void testDisplayOptionsFromIdentifier();
19 
20     void runIndexedTest(int32_t index, UBool exec, const char *&name, char *par = 0) override;
21 };
22 
runIndexedTest(int32_t index,UBool exec,const char * & name,char *)23 void DisplayOptionsTest::runIndexedTest(int32_t index, UBool exec, const char *&name, char *) {
24     if (exec) {
25         logln(u"TestSuite DisplayOptionsTest: ");
26     }
27     TESTCASE_AUTO_BEGIN;
28     TESTCASE_AUTO(testDisplayOptionsDefault);
29     TESTCASE_AUTO(testDisplayOptionsEachElement);
30     TESTCASE_AUTO(testDisplayOptionsUpdating);
31     TESTCASE_AUTO(testDisplayOptionsGetIdentifier);
32     TESTCASE_AUTO(testDisplayOptionsFromIdentifier);
33     TESTCASE_AUTO_END;
34 }
35 
testDisplayOptionsDefault()36 void DisplayOptionsTest::testDisplayOptionsDefault() {
37     icu::DisplayOptions displayOptions = icu::DisplayOptions::builder().build();
38     assertEquals(u"Test setting parameters", UDISPOPT_GRAMMATICAL_CASE_UNDEFINED,
39                  displayOptions.getGrammaticalCase());
40     assertEquals(u"Test default values: ", UDISPOPT_NOUN_CLASS_UNDEFINED,
41                  displayOptions.getNounClass());
42     assertEquals(u"Test default values: ", UDISPOPT_PLURAL_CATEGORY_UNDEFINED,
43                  displayOptions.getPluralCategory());
44     assertEquals(u"Test default values: ", UDISPOPT_CAPITALIZATION_UNDEFINED,
45                  displayOptions.getCapitalization());
46     assertEquals(u"Test default values: ", UDISPOPT_NAME_STYLE_UNDEFINED,
47                  displayOptions.getNameStyle());
48     assertEquals(u"Test default values: ", UDISPOPT_DISPLAY_LENGTH_UNDEFINED,
49                  displayOptions.getDisplayLength());
50     assertEquals(u"Test default values: ", UDISPOPT_SUBSTITUTE_HANDLING_UNDEFINED,
51                  displayOptions.getSubstituteHandling());
52 }
53 
testDisplayOptionsEachElement()54 void DisplayOptionsTest::testDisplayOptionsEachElement() {
55     icu::DisplayOptions displayOptions =
56         icu::DisplayOptions::builder()
57             .setGrammaticalCase(UDISPOPT_GRAMMATICAL_CASE_ABLATIVE)
58             .build();
59     assertEquals(u"Test setting parameters: ", UDISPOPT_GRAMMATICAL_CASE_ABLATIVE,
60                  displayOptions.getGrammaticalCase());
61 
62     displayOptions =
63         icu::DisplayOptions::builder().setNounClass(UDISPOPT_NOUN_CLASS_PERSONAL).build();
64     assertEquals(u"Test setting parameters: ", UDISPOPT_NOUN_CLASS_PERSONAL,
65                  displayOptions.getNounClass());
66 
67     displayOptions =
68         icu::DisplayOptions::builder().setPluralCategory(UDISPOPT_PLURAL_CATEGORY_FEW).build();
69     assertEquals(u"Test setting parameters: ", UDISPOPT_PLURAL_CATEGORY_FEW,
70                  displayOptions.getPluralCategory());
71 
72     displayOptions = icu::DisplayOptions::builder()
73                          .setCapitalization(UDISPOPT_CAPITALIZATION_BEGINNING_OF_SENTENCE)
74                          .build();
75     assertEquals(u"Test setting parameters: ", UDISPOPT_CAPITALIZATION_BEGINNING_OF_SENTENCE,
76                  displayOptions.getCapitalization());
77 
78     displayOptions = icu::DisplayOptions::builder()
79                          .setNameStyle(UDISPOPT_NAME_STYLE_STANDARD_NAMES)
80                          .build();
81     assertEquals(u"Test setting parameters: ", UDISPOPT_NAME_STYLE_STANDARD_NAMES,
82                  displayOptions.getNameStyle());
83 
84     displayOptions = icu::DisplayOptions::builder()
85                          .setDisplayLength(UDISPOPT_DISPLAY_LENGTH_FULL)
86                          .build();
87     assertEquals(u"Test setting parameters: ", UDISPOPT_DISPLAY_LENGTH_FULL,
88                  displayOptions.getDisplayLength());
89 
90     displayOptions = icu::DisplayOptions::builder()
91                          .setSubstituteHandling(UDISPOPT_SUBSTITUTE_HANDLING_NO_SUBSTITUTE)
92                          .build();
93     assertEquals(u"Test setting parameters: ", UDISPOPT_SUBSTITUTE_HANDLING_NO_SUBSTITUTE,
94                  displayOptions.getSubstituteHandling());
95 }
96 
testDisplayOptionsUpdating()97 void DisplayOptionsTest::testDisplayOptionsUpdating() {
98     DisplayOptions displayOptions = DisplayOptions::builder()
99                                         .setGrammaticalCase(UDISPOPT_GRAMMATICAL_CASE_ABLATIVE)
100                                         .build();
101     assertEquals(u"Test updating parameters: ", UDISPOPT_GRAMMATICAL_CASE_ABLATIVE,
102                  displayOptions.getGrammaticalCase());
103     assertEquals(u"Test updating parameters: ", UDISPOPT_NOUN_CLASS_UNDEFINED,
104                  displayOptions.getNounClass());
105     assertEquals(u"Test updating parameters: ", UDISPOPT_PLURAL_CATEGORY_UNDEFINED,
106                  displayOptions.getPluralCategory());
107     assertEquals(u"Test updating parameters: ", UDISPOPT_CAPITALIZATION_UNDEFINED,
108                  displayOptions.getCapitalization());
109     assertEquals(u"Test updating parameters: ", UDISPOPT_NAME_STYLE_UNDEFINED,
110                  displayOptions.getNameStyle());
111     assertEquals(u"Test updating parameters: ", UDISPOPT_DISPLAY_LENGTH_UNDEFINED,
112                  displayOptions.getDisplayLength());
113     assertEquals(u"Test updating parameters: ", UDISPOPT_SUBSTITUTE_HANDLING_UNDEFINED,
114                  displayOptions.getSubstituteHandling());
115 
116     displayOptions =
117         displayOptions.copyToBuilder().setNounClass(UDISPOPT_NOUN_CLASS_PERSONAL).build();
118     assertEquals(u"Test updating parameters: ", UDISPOPT_GRAMMATICAL_CASE_ABLATIVE,
119                  displayOptions.getGrammaticalCase());
120     assertEquals(u"Test updating parameters: ", UDISPOPT_NOUN_CLASS_PERSONAL,
121                  displayOptions.getNounClass());
122     assertEquals(u"Test updating parameters: ", UDISPOPT_PLURAL_CATEGORY_UNDEFINED,
123                  displayOptions.getPluralCategory());
124     assertEquals(u"Test updating parameters: ", UDISPOPT_CAPITALIZATION_UNDEFINED,
125                  displayOptions.getCapitalization());
126     assertEquals(u"Test updating parameters: ", UDISPOPT_NAME_STYLE_UNDEFINED,
127                  displayOptions.getNameStyle());
128     assertEquals(u"Test updating parameters: ", UDISPOPT_DISPLAY_LENGTH_UNDEFINED,
129                  displayOptions.getDisplayLength());
130     assertEquals(u"Test updating parameters: ", UDISPOPT_SUBSTITUTE_HANDLING_UNDEFINED,
131                  displayOptions.getSubstituteHandling());
132 
133     displayOptions =
134         displayOptions.copyToBuilder().setPluralCategory(UDISPOPT_PLURAL_CATEGORY_FEW).build();
135     assertEquals(u"Test updating parameters: ", UDISPOPT_GRAMMATICAL_CASE_ABLATIVE,
136                  displayOptions.getGrammaticalCase());
137     assertEquals(u"Test updating parameters: ", UDISPOPT_NOUN_CLASS_PERSONAL,
138                  displayOptions.getNounClass());
139     assertEquals(u"Test updating parameters: ", UDISPOPT_PLURAL_CATEGORY_FEW,
140                  displayOptions.getPluralCategory());
141     assertEquals(u"Test updating parameters: ", UDISPOPT_CAPITALIZATION_UNDEFINED,
142                  displayOptions.getCapitalization());
143     assertEquals(u"Test updating parameters: ", UDISPOPT_NAME_STYLE_UNDEFINED,
144                  displayOptions.getNameStyle());
145     assertEquals(u"Test updating parameters: ", UDISPOPT_DISPLAY_LENGTH_UNDEFINED,
146                  displayOptions.getDisplayLength());
147     assertEquals(u"Test updating parameters: ", UDISPOPT_SUBSTITUTE_HANDLING_UNDEFINED,
148                  displayOptions.getSubstituteHandling());
149 
150     displayOptions = displayOptions.copyToBuilder()
151                          .setCapitalization(UDISPOPT_CAPITALIZATION_BEGINNING_OF_SENTENCE)
152                          .build();
153     assertEquals(u"Test updating parameters: ", UDISPOPT_GRAMMATICAL_CASE_ABLATIVE,
154                  displayOptions.getGrammaticalCase());
155     assertEquals(u"Test updating parameters: ", UDISPOPT_NOUN_CLASS_PERSONAL,
156                  displayOptions.getNounClass());
157     assertEquals(u"Test updating parameters: ", UDISPOPT_PLURAL_CATEGORY_FEW,
158                  displayOptions.getPluralCategory());
159     assertEquals(u"Test updating parameters: ", UDISPOPT_CAPITALIZATION_BEGINNING_OF_SENTENCE,
160                  displayOptions.getCapitalization());
161     assertEquals(u"Test updating parameters: ", UDISPOPT_NAME_STYLE_UNDEFINED,
162                  displayOptions.getNameStyle());
163     assertEquals(u"Test updating parameters: ", UDISPOPT_DISPLAY_LENGTH_UNDEFINED,
164                  displayOptions.getDisplayLength());
165     assertEquals(u"Test updating parameters: ", UDISPOPT_SUBSTITUTE_HANDLING_UNDEFINED,
166                  displayOptions.getSubstituteHandling());
167 
168     displayOptions = displayOptions.copyToBuilder()
169                          .setNameStyle(UDISPOPT_NAME_STYLE_STANDARD_NAMES)
170                          .build();
171     assertEquals(u"Test updating parameters: ", UDISPOPT_GRAMMATICAL_CASE_ABLATIVE,
172                  displayOptions.getGrammaticalCase());
173     assertEquals(u"Test updating parameters: ", UDISPOPT_NOUN_CLASS_PERSONAL,
174                  displayOptions.getNounClass());
175     assertEquals(u"Test updating parameters: ", UDISPOPT_PLURAL_CATEGORY_FEW,
176                  displayOptions.getPluralCategory());
177     assertEquals(u"Test updating parameters: ", UDISPOPT_CAPITALIZATION_BEGINNING_OF_SENTENCE,
178                  displayOptions.getCapitalization());
179     assertEquals(u"Test updating parameters: ", UDISPOPT_NAME_STYLE_STANDARD_NAMES,
180                  displayOptions.getNameStyle());
181     assertEquals(u"Test updating parameters: ", UDISPOPT_DISPLAY_LENGTH_UNDEFINED,
182                  displayOptions.getDisplayLength());
183     assertEquals(u"Test updating parameters: ", UDISPOPT_SUBSTITUTE_HANDLING_UNDEFINED,
184                  displayOptions.getSubstituteHandling());
185 
186     displayOptions = displayOptions.copyToBuilder()
187                          .setDisplayLength(UDISPOPT_DISPLAY_LENGTH_FULL)
188                          .build();
189     assertEquals(u"Test updating parameters: ", UDISPOPT_GRAMMATICAL_CASE_ABLATIVE,
190                  displayOptions.getGrammaticalCase());
191     assertEquals(u"Test updating parameters: ", UDISPOPT_NOUN_CLASS_PERSONAL,
192                  displayOptions.getNounClass());
193     assertEquals(u"Test updating parameters: ", UDISPOPT_PLURAL_CATEGORY_FEW,
194                  displayOptions.getPluralCategory());
195     assertEquals(u"Test updating parameters: ", UDISPOPT_CAPITALIZATION_BEGINNING_OF_SENTENCE,
196                  displayOptions.getCapitalization());
197     assertEquals(u"Test updating parameters: ", UDISPOPT_NAME_STYLE_STANDARD_NAMES,
198                  displayOptions.getNameStyle());
199     assertEquals(u"Test updating parameters: ", UDISPOPT_DISPLAY_LENGTH_FULL,
200                  displayOptions.getDisplayLength());
201     assertEquals(u"Test updating parameters: ", UDISPOPT_SUBSTITUTE_HANDLING_UNDEFINED,
202                  displayOptions.getSubstituteHandling());
203 
204     displayOptions = displayOptions.copyToBuilder()
205                          .setSubstituteHandling(UDISPOPT_SUBSTITUTE_HANDLING_NO_SUBSTITUTE)
206                          .build();
207     assertEquals(u"Test updating parameters: ", UDISPOPT_GRAMMATICAL_CASE_ABLATIVE,
208                  displayOptions.getGrammaticalCase());
209     assertEquals(u"Test updating parameters: ", UDISPOPT_NOUN_CLASS_PERSONAL,
210                  displayOptions.getNounClass());
211     assertEquals(u"Test updating parameters: ", UDISPOPT_PLURAL_CATEGORY_FEW,
212                  displayOptions.getPluralCategory());
213     assertEquals(u"Test updating parameters: ", UDISPOPT_CAPITALIZATION_BEGINNING_OF_SENTENCE,
214                  displayOptions.getCapitalization());
215     assertEquals(u"Test updating parameters: ", UDISPOPT_NAME_STYLE_STANDARD_NAMES,
216                  displayOptions.getNameStyle());
217     assertEquals(u"Test updating parameters: ", UDISPOPT_DISPLAY_LENGTH_FULL,
218                  displayOptions.getDisplayLength());
219     assertEquals(u"Test updating parameters: ", UDISPOPT_SUBSTITUTE_HANDLING_NO_SUBSTITUTE,
220                  displayOptions.getSubstituteHandling());
221 }
222 
testDisplayOptionsGetIdentifier()223 void DisplayOptionsTest::testDisplayOptionsGetIdentifier() {
224 
225     assertEquals(u"test get identifier: ", "undefined",
226                  udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_UNDEFINED));
227     assertEquals(u"test get identifier: ", "ablative",
228                  udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_ABLATIVE));
229     assertEquals(u"test get identifier: ", "accusative",
230                  udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_ACCUSATIVE));
231     assertEquals(u"test get identifier: ", "comitative",
232                  udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_COMITATIVE));
233     assertEquals(u"test get identifier: ", "dative",
234                  udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_DATIVE));
235     assertEquals(u"test get identifier: ", "ergative",
236                  udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_ERGATIVE));
237     assertEquals(u"test get identifier: ", "genitive",
238                  udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_GENITIVE));
239     assertEquals(
240         u"test get identifier: ", "instrumental",
241         udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_INSTRUMENTAL));
242     assertEquals(u"test get identifier: ", "locative",
243                  udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_LOCATIVE));
244     assertEquals(
245         u"test get identifier: ", "locative_copulative",
246         udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_LOCATIVE_COPULATIVE));
247     assertEquals(u"test get identifier: ", "nominative",
248                  udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_NOMINATIVE));
249     assertEquals(u"test get identifier: ", "oblique",
250                  udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_OBLIQUE));
251     assertEquals(
252         u"test get identifier: ", "prepositional",
253         udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_PREPOSITIONAL));
254     assertEquals(u"test get identifier: ", "sociative",
255                  udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_SOCIATIVE));
256     assertEquals(u"test get identifier: ", "vocative",
257                  udispopt_getGrammaticalCaseIdentifier(UDISPOPT_GRAMMATICAL_CASE_VOCATIVE));
258 
259     assertEquals(u"test get identifier: ", "undefined",
260                  udispopt_getPluralCategoryIdentifier(UDISPOPT_PLURAL_CATEGORY_UNDEFINED));
261     assertEquals(u"test get identifier: ", "zero",
262                  udispopt_getPluralCategoryIdentifier(UDISPOPT_PLURAL_CATEGORY_ZERO));
263     assertEquals(u"test get identifier: ", "one",
264                  udispopt_getPluralCategoryIdentifier(UDISPOPT_PLURAL_CATEGORY_ONE));
265     assertEquals(u"test get identifier: ", "two",
266                  udispopt_getPluralCategoryIdentifier(UDISPOPT_PLURAL_CATEGORY_TWO));
267     assertEquals(u"test get identifier: ", "few",
268                  udispopt_getPluralCategoryIdentifier(UDISPOPT_PLURAL_CATEGORY_FEW));
269     assertEquals(u"test get identifier: ", "many",
270                  udispopt_getPluralCategoryIdentifier(UDISPOPT_PLURAL_CATEGORY_MANY));
271     assertEquals(u"test get identifier: ", "other",
272                  udispopt_getPluralCategoryIdentifier(UDISPOPT_PLURAL_CATEGORY_OTHER));
273 
274     assertEquals(u"test get identifier: ", "undefined",
275                  udispopt_getNounClassIdentifier(UDISPOPT_NOUN_CLASS_UNDEFINED));
276     assertEquals(u"test get identifier: ", "other",
277                  udispopt_getNounClassIdentifier(UDISPOPT_NOUN_CLASS_OTHER));
278     assertEquals(u"test get identifier: ", "neuter",
279                  udispopt_getNounClassIdentifier(UDISPOPT_NOUN_CLASS_NEUTER));
280     assertEquals(u"test get identifier: ", "feminine",
281                  udispopt_getNounClassIdentifier(UDISPOPT_NOUN_CLASS_FEMININE));
282     assertEquals(u"test get identifier: ", "masculine",
283                  udispopt_getNounClassIdentifier(UDISPOPT_NOUN_CLASS_MASCULINE));
284     assertEquals(u"test get identifier: ", "animate",
285                  udispopt_getNounClassIdentifier(UDISPOPT_NOUN_CLASS_ANIMATE));
286     assertEquals(u"test get identifier: ", "inanimate",
287                  udispopt_getNounClassIdentifier(UDISPOPT_NOUN_CLASS_INANIMATE));
288     assertEquals(u"test get identifier: ", "personal",
289                  udispopt_getNounClassIdentifier(UDISPOPT_NOUN_CLASS_PERSONAL));
290     assertEquals(u"test get identifier: ", "common",
291                  udispopt_getNounClassIdentifier(UDISPOPT_NOUN_CLASS_COMMON));
292 }
293 
testDisplayOptionsFromIdentifier()294 void DisplayOptionsTest::testDisplayOptionsFromIdentifier() {
295 
296     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_UNDEFINED,
297                  udispopt_fromGrammaticalCaseIdentifier(""));
298     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_UNDEFINED,
299                  udispopt_fromGrammaticalCaseIdentifier("undefined"));
300     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_ABLATIVE,
301                  udispopt_fromGrammaticalCaseIdentifier("ablative"));
302     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_ACCUSATIVE,
303                  udispopt_fromGrammaticalCaseIdentifier("accusative"));
304     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_COMITATIVE,
305                  udispopt_fromGrammaticalCaseIdentifier("comitative"));
306     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_DATIVE,
307                  udispopt_fromGrammaticalCaseIdentifier("dative"));
308     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_ERGATIVE,
309                  udispopt_fromGrammaticalCaseIdentifier("ergative"));
310     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_GENITIVE,
311                  udispopt_fromGrammaticalCaseIdentifier("genitive"));
312     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_INSTRUMENTAL,
313                  udispopt_fromGrammaticalCaseIdentifier("instrumental"));
314     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_LOCATIVE,
315                  udispopt_fromGrammaticalCaseIdentifier("locative"));
316     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_LOCATIVE_COPULATIVE,
317                  udispopt_fromGrammaticalCaseIdentifier("locative_copulative"));
318     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_NOMINATIVE,
319                  udispopt_fromGrammaticalCaseIdentifier("nominative"));
320     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_OBLIQUE,
321                  udispopt_fromGrammaticalCaseIdentifier("oblique"));
322     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_PREPOSITIONAL,
323                  udispopt_fromGrammaticalCaseIdentifier("prepositional"));
324     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_SOCIATIVE,
325                  udispopt_fromGrammaticalCaseIdentifier("sociative"));
326     assertEquals(u"test from identifier: ", UDISPOPT_GRAMMATICAL_CASE_VOCATIVE,
327                  udispopt_fromGrammaticalCaseIdentifier("vocative"));
328 
329     assertEquals(u"test from identifier: ", UDISPOPT_PLURAL_CATEGORY_UNDEFINED,
330                  udispopt_fromPluralCategoryIdentifier(""));
331     assertEquals(u"test from identifier: ", UDISPOPT_PLURAL_CATEGORY_UNDEFINED,
332                  udispopt_fromPluralCategoryIdentifier("undefined"));
333     assertEquals(u"test from identifier: ", UDISPOPT_PLURAL_CATEGORY_ZERO,
334                  udispopt_fromPluralCategoryIdentifier("zero"));
335     assertEquals(u"test from identifier: ", UDISPOPT_PLURAL_CATEGORY_ONE,
336                  udispopt_fromPluralCategoryIdentifier("one"));
337     assertEquals(u"test from identifier: ", UDISPOPT_PLURAL_CATEGORY_TWO,
338                  udispopt_fromPluralCategoryIdentifier("two"));
339     assertEquals(u"test from identifier: ", UDISPOPT_PLURAL_CATEGORY_FEW,
340                  udispopt_fromPluralCategoryIdentifier("few"));
341     assertEquals(u"test from identifier: ", UDISPOPT_PLURAL_CATEGORY_MANY,
342                  udispopt_fromPluralCategoryIdentifier("many"));
343     assertEquals(u"test from identifier: ", UDISPOPT_PLURAL_CATEGORY_OTHER,
344                  udispopt_fromPluralCategoryIdentifier("other"));
345 
346     assertEquals(u"test from identifier: ", UDISPOPT_NOUN_CLASS_UNDEFINED,
347                  udispopt_fromNounClassIdentifier(""));
348     assertEquals(u"test from identifier: ", UDISPOPT_NOUN_CLASS_UNDEFINED,
349                  udispopt_fromNounClassIdentifier("undefined"));
350     assertEquals(u"test from identifier: ", UDISPOPT_NOUN_CLASS_OTHER,
351                  udispopt_fromNounClassIdentifier("other"));
352     assertEquals(u"test from identifier: ", UDISPOPT_NOUN_CLASS_NEUTER,
353                  udispopt_fromNounClassIdentifier("neuter"));
354     assertEquals(u"test from identifier: ", UDISPOPT_NOUN_CLASS_FEMININE,
355                  udispopt_fromNounClassIdentifier("feminine"));
356     assertEquals(u"test from identifier: ", UDISPOPT_NOUN_CLASS_MASCULINE,
357                  udispopt_fromNounClassIdentifier("masculine"));
358     assertEquals(u"test from identifier: ", UDISPOPT_NOUN_CLASS_ANIMATE,
359                  udispopt_fromNounClassIdentifier("animate"));
360     assertEquals(u"test from identifier: ", UDISPOPT_NOUN_CLASS_INANIMATE,
361                  udispopt_fromNounClassIdentifier("inanimate"));
362     assertEquals(u"test from identifier: ", UDISPOPT_NOUN_CLASS_PERSONAL,
363                  udispopt_fromNounClassIdentifier("personal"));
364     assertEquals(u"test from identifier: ", UDISPOPT_NOUN_CLASS_COMMON,
365                  udispopt_fromNounClassIdentifier("common"));
366 }
367 
createDisplayOptionsTest()368 extern IntlTest *createDisplayOptionsTest() { return new DisplayOptionsTest(); }
369 
370 #endif /* #if !UCONFIG_NO_FORMATTING */
371