]>
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 TestVariantParsing(void);
75 /* Test getting keyword enumeration */
76 void TestKeywordVariants(void);
77 void TestCreateUnicodeKeywords(void);
79 /* Test getting keyword values */
80 void TestKeywordVariantParsing(void);
81 void TestCreateKeywordSet(void);
82 void TestCreateUnicodeKeywordSet(void);
83 void TestGetKeywordValueStdString(void);
84 void TestGetUnicodeKeywordValueStdString(void);
86 /* Test setting keyword values */
87 void TestSetKeywordValue(void);
88 void TestSetKeywordValueStringPiece(void);
89 void TestSetUnicodeKeywordValueStringPiece(void);
91 /* Test getting the locale base name */
92 void TestGetBaseName(void);
94 #if !UCONFIG_NO_FORMATTING
95 void Test4105828(void) ;
98 void TestSetIsBogus(void);
100 void TestGetLocale(void);
102 void TestVariantWithOutCountry(void);
104 void TestCanonicalization(void);
106 #if !UCONFIG_NO_FORMATTING
107 static UDate
date(int32_t y
, int32_t m
, int32_t d
, int32_t hr
= 0, int32_t min
= 0, int32_t sec
= 0);
110 void TestCurrencyByDate(void);
112 void TestGetVariantWithKeywords(void);
113 void TestIsRightToLeft();
119 void TestAddLikelySubtags();
120 void TestMinimizeSubtags();
121 void TestAddLikelyAndMinimizeSubtags();
123 void TestForLanguageTag();
124 void TestToLanguageTag();
126 void TestMoveAssign();
129 void TestBug20407iVariantPreferredValue();
131 void TestBug13417VeryLongLanguageTag();
133 void TestBug11053UnderlineTimeZone();
136 void TestUndScript();
137 void TestUndRegion();
141 void _checklocs(const char* label
,
143 const Locale
& validLoc
,
144 const Locale
& actualLoc
,
145 const char* expReqValid
="gt",
146 const char* expValidActual
="ge");
149 * routine to perform subtests, used by TestDisplayNames
151 void doTestDisplayNames(Locale
& inLocale
, int32_t compareIndex
);
153 * additional intialization for datatables storing expected values
155 void setUpDataTable(void);
157 UnicodeString
** dataTable
;
207 #if !UCONFIG_NO_COLLATION
209 * Check on registered collators.
210 * @param expectExtra if non-null, the locale ID of an 'extra' locale that is registered.
212 void checkRegisteredCollators(const char *expectExtra
= NULL
);