]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/loctest.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
5 * Copyright (c) 1997-2015, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 ********************************************************************/
10 #include "unicode/locid.h"
13 * Tests for the Locale class
15 class LocaleTest
: public IntlTest
{
18 virtual ~LocaleTest();
20 void runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* par
= NULL
);
23 * Test methods to set and get data fields
25 void TestBasicGetters(void);
27 * Test methods to set and get data fields
29 void TestParallelAPIValues(void);
31 * Use Locale to access Resource file data and compare against expected values
33 void TestSimpleResourceInfo(void);
35 * Use Locale to access Resource file display names and compare against expected values
37 void TestDisplayNames(void);
39 * Test methods for basic object behaviour
41 void TestSimpleObjectStuff(void);
43 * Test methods for POSIX parsing behavior
45 void TestPOSIXParsing(void);
47 * Test Locale::getAvailableLocales
49 void TestGetAvailableLocales(void);
51 * Test methods to set and access a custom data directory
53 void TestDataDirectory(void);
55 void TestISO3Fallback(void);
56 void TestGetLangsAndCountries(void);
57 void TestSimpleDisplayNames(void);
58 void TestUninstalledISO3Names(void);
59 void TestAtypicalLocales(void);
60 #if !UCONFIG_NO_FORMATTING
61 void TestThaiCurrencyFormat(void);
62 void TestEuroSupport(void);
64 void TestToString(void);
65 #if !UCONFIG_NO_FORMATTING
66 void Test4139940(void);
67 void Test4143951(void);
69 void Test4147315(void);
70 void Test4147317(void);
71 void Test4147552(void);
73 void Test20639_DeprecatesISO3Language();
75 void TestVariantParsing(void);
77 /* Test getting keyword enumeration */
78 void TestKeywordVariants(void);
79 void TestCreateUnicodeKeywords(void);
81 /* Test getting keyword values */
82 void TestKeywordVariantParsing(void);
83 void TestCreateKeywordSet(void);
84 void TestCreateKeywordSetEmpty(void);
85 void TestCreateUnicodeKeywordSet(void);
86 void TestCreateUnicodeKeywordSetEmpty(void);
87 void TestGetKeywordValueStdString(void);
88 void TestGetUnicodeKeywordValueStdString(void);
90 /* Test setting keyword values */
91 void TestSetKeywordValue(void);
92 void TestSetKeywordValueStringPiece(void);
93 void TestSetUnicodeKeywordValueStringPiece(void);
95 /* Test getting the locale base name */
96 void TestGetBaseName(void);
98 #if !UCONFIG_NO_FORMATTING
99 void Test4105828(void) ;
102 void TestSetIsBogus(void);
104 void TestGetLocale(void);
106 void TestVariantWithOutCountry(void);
108 void TestCanonicalization(void);
110 #if !UCONFIG_NO_FORMATTING
111 static UDate
date(int32_t y
, int32_t m
, int32_t d
, int32_t hr
= 0, int32_t min
= 0, int32_t sec
= 0);
114 void TestCurrencyByDate(void);
116 void TestGetVariantWithKeywords(void);
117 void TestIsRightToLeft();
122 void TestConstructorAcceptsBCP47();
124 void TestAddLikelySubtags();
125 void TestMinimizeSubtags();
126 void TestAddLikelyAndMinimizeSubtags();
128 void TestForLanguageTag();
129 void TestToLanguageTag();
131 void TestMoveAssign();
134 void TestBug20407iVariantPreferredValue();
136 void TestBug13417VeryLongLanguageTag();
138 void TestBug11053UnderlineTimeZone();
141 void TestUndScript();
142 void TestUndRegion();
144 void TestRangeIterator();
145 void TestPointerConvertingIterator();
146 void TestTagConvertingIterator();
147 void TestCapturingTagConvertingIterator();
148 void TestSetUnicodeKeywordValueInLongLocale();
149 void TestSetUnicodeKeywordValueNullInLongLocale();
152 void _checklocs(const char* label
,
154 const Locale
& validLoc
,
155 const Locale
& actualLoc
,
156 const char* expReqValid
="gt",
157 const char* expValidActual
="ge");
160 * routine to perform subtests, used by TestDisplayNames
162 void doTestDisplayNames(Locale
& inLocale
, int32_t compareIndex
);
164 * additional intialization for datatables storing expected values
166 void setUpDataTable(void);
168 UnicodeString
** dataTable
;
218 #if !UCONFIG_NO_COLLATION
220 * Check on registered collators.
221 * @param expectExtra if non-null, the locale ID of an 'extra' locale that is registered.
223 void checkRegisteredCollators(const char *expectExtra
= NULL
);