1 /********************************************************************
3 * Copyright (c) 1997-2010, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
8 #include "unicode/locid.h"
11 * Tests for the Locale class
13 class LocaleTest: public IntlTest {
16 virtual ~LocaleTest();
18 void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
21 * Test methods to set and get data fields
23 void TestBasicGetters(void);
25 * Test methods to set and get data fields
27 void TestParallelAPIValues(void);
29 * Use Locale to access Resource file data and compare against expected values
31 void TestSimpleResourceInfo(void);
33 * Use Locale to access Resource file display names and compare against expected values
35 void TestDisplayNames(void);
37 * Test methods for basic object behaviour
39 void TestSimpleObjectStuff(void);
41 * Test methods for POSIX parsing behavior
43 void TestPOSIXParsing(void);
45 * Test Locale::getAvailableLocales
47 void TestGetAvailableLocales(void);
49 * Test methods to set and access a custom data directory
51 void TestDataDirectory(void);
53 void TestISO3Fallback(void);
54 void TestGetLangsAndCountries(void);
55 void TestSimpleDisplayNames(void);
56 void TestUninstalledISO3Names(void);
57 void TestAtypicalLocales(void);
58 #if !UCONFIG_NO_FORMATTING
59 void TestThaiCurrencyFormat(void);
60 void TestEuroSupport(void);
62 void TestToString(void);
63 #if !UCONFIG_NO_FORMATTING
64 void Test4139940(void);
65 void Test4143951(void);
67 void Test4147315(void);
68 void Test4147317(void);
69 void Test4147552(void);
71 void TestVariantParsing(void);
73 /* Test getting keyword enumeratin */
74 void TestKeywordVariants(void);
76 /* Test getting keyword values */
77 void TestKeywordVariantParsing(void);
79 /* Test setting keyword values */
80 void TestSetKeywordValue(void);
82 /* Test getting the locale base name */
83 void TestGetBaseName(void);
85 #if !UCONFIG_NO_FORMATTING
86 void Test4105828(void) ;
89 void TestSetIsBogus(void);
91 void TestGetLocale(void);
93 void TestVariantWithOutCountry(void);
95 void TestCanonicalization(void);
97 #if !UCONFIG_NO_FORMATTING
98 static UDate date(int32_t y, int32_t m, int32_t d, int32_t hr = 0, int32_t min = 0, int32_t sec = 0);
101 void TestCurrencyByDate(void);
103 void TestGetVariantWithKeywords(void);
106 void _checklocs(const char* label,
108 const Locale& validLoc,
109 const Locale& actualLoc,
110 const char* expReqValid="gt",
111 const char* expValidActual="ge");
114 * routine to perform subtests, used by TestDisplayNames
116 void doTestDisplayNames(Locale& inLocale, int32_t compareIndex);
118 * additional intialization for datatables storing expected values
120 void setUpDataTable(void);
122 UnicodeString** dataTable;