OLD | NEW |
1 /********************************************************************* | 1 /********************************************************************* |
2 * COPYRIGHT: | 2 * COPYRIGHT: |
3 * Copyright (c) 2010-2014, International Business Machines Corporation and | 3 * Copyright (c) 2010-2014, International Business Machines Corporation and |
4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
5 *********************************************************************/ | 5 *********************************************************************/ |
6 | 6 |
7 #include "locnmtst.h" | 7 #include "locnmtst.h" |
8 #include "cstring.h" | 8 #include "cstring.h" |
9 | 9 |
10 /* | 10 /* |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 switch (index) { | 66 switch (index) { |
67 #if !UCONFIG_NO_FORMATTING | 67 #if !UCONFIG_NO_FORMATTING |
68 TESTCASE(0, TestCreate); | 68 TESTCASE(0, TestCreate); |
69 TESTCASE(1, TestCreateDialect); | 69 TESTCASE(1, TestCreateDialect); |
70 TESTCASE(2, TestWithKeywordsAndEverything); | 70 TESTCASE(2, TestWithKeywordsAndEverything); |
71 TESTCASE(3, TestUldnOpen); | 71 TESTCASE(3, TestUldnOpen); |
72 TESTCASE(4, TestUldnOpenDialect); | 72 TESTCASE(4, TestUldnOpenDialect); |
73 TESTCASE(5, TestUldnWithKeywordsAndEverything); | 73 TESTCASE(5, TestUldnWithKeywordsAndEverything); |
74 TESTCASE(6, TestUldnComponents); | 74 TESTCASE(6, TestUldnComponents); |
75 TESTCASE(7, TestRootEtc); | 75 TESTCASE(7, TestRootEtc); |
76 TESTCASE(8, TestKeywords); | 76 TESTCASE(8, TestCurrencyKeyword); |
77 TESTCASE(9, TestUntranslatedKeywords); | 77 TESTCASE(9, TestUnknownCurrencyKeyword); |
78 TESTCASE(10, TestPrivateUse); | 78 TESTCASE(10, TestUntranslatedKeywords); |
79 TESTCASE(11, TestUldnDisplayContext); | 79 TESTCASE(11, TestPrivateUse); |
| 80 TESTCASE(12, TestUldnDisplayContext); |
80 #endif | 81 #endif |
81 default: | 82 default: |
82 name = ""; | 83 name = ""; |
83 break; | 84 break; |
84 } | 85 } |
85 } | 86 } |
86 | 87 |
87 #if !UCONFIG_NO_FORMATTING | 88 #if !UCONFIG_NO_FORMATTING |
88 void LocaleDisplayNamesTest::TestCreate() { | 89 void LocaleDisplayNamesTest::TestCreate() { |
89 UnicodeString temp; | 90 UnicodeString temp; |
(...skipping 15 matching lines...) Expand all Loading... |
105 UnicodeString temp; | 106 UnicodeString temp; |
106 LocaleDisplayNames *ldn = LocaleDisplayNames::createInstance(Locale::getUS()); | 107 LocaleDisplayNames *ldn = LocaleDisplayNames::createInstance(Locale::getUS()); |
107 const char *locname = "en_Hant_US_VALLEY@calendar=gregorian;collation=phoneboo
k"; | 108 const char *locname = "en_Hant_US_VALLEY@calendar=gregorian;collation=phoneboo
k"; |
108 const char *target = "English (Traditional, United States, VALLEY, " | 109 const char *target = "English (Traditional, United States, VALLEY, " |
109 "Gregorian Calendar, Phonebook Sort Order)"; | 110 "Gregorian Calendar, Phonebook Sort Order)"; |
110 ldn->localeDisplayName(locname, temp); | 111 ldn->localeDisplayName(locname, temp); |
111 delete ldn; | 112 delete ldn; |
112 test_assert_equal(target, temp); | 113 test_assert_equal(target, temp); |
113 } | 114 } |
114 | 115 |
115 void LocaleDisplayNamesTest::TestKeywords() { | 116 void LocaleDisplayNamesTest::TestCurrencyKeyword() { |
| 117 UnicodeString temp; |
| 118 LocaleDisplayNames *ldn = LocaleDisplayNames::createInstance(Locale::getUS()); |
| 119 const char *locname = "ja@currency=JPY"; |
| 120 const char *target = "Japanese (Japanese Yen)"; |
| 121 ldn->localeDisplayName(locname, temp); |
| 122 delete ldn; |
| 123 test_assert_equal(target, temp); |
| 124 } |
| 125 |
| 126 void LocaleDisplayNamesTest::TestUnknownCurrencyKeyword() { |
116 UnicodeString temp; | 127 UnicodeString temp; |
117 LocaleDisplayNames *ldn = LocaleDisplayNames::createInstance(Locale::getUS()); | 128 LocaleDisplayNames *ldn = LocaleDisplayNames::createInstance(Locale::getUS()); |
118 const char *locname = "de@currency=XYZ"; | 129 const char *locname = "de@currency=XYZ"; |
119 const char *target = "German (Currency: XYZ)"; | 130 const char *target = "German (Currency: XYZ)"; |
120 ldn->localeDisplayName(locname, temp); | 131 ldn->localeDisplayName(locname, temp); |
121 delete ldn; | 132 delete ldn; |
122 test_assert_equal(target, temp); | 133 test_assert_equal(target, temp); |
123 } | 134 } |
124 | 135 |
125 void LocaleDisplayNamesTest::TestUntranslatedKeywords() { | 136 void LocaleDisplayNamesTest::TestUntranslatedKeywords() { |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 ldn->languageDisplayName("root", temp); | 386 ldn->languageDisplayName("root", temp); |
376 test_assert_equal("root", temp); | 387 test_assert_equal("root", temp); |
377 | 388 |
378 ldn->languageDisplayName("en_GB", temp); | 389 ldn->languageDisplayName("en_GB", temp); |
379 test_assert_equal("en_GB", temp); | 390 test_assert_equal("en_GB", temp); |
380 | 391 |
381 delete ldn; | 392 delete ldn; |
382 } | 393 } |
383 | 394 |
384 #endif /* UCONFIG_NO_FORMATTING */ | 395 #endif /* UCONFIG_NO_FORMATTING */ |
OLD | NEW |