3aaa52af8d
X-SVN-Rev: 596
126 lines
3.0 KiB
C++
126 lines
3.0 KiB
C++
/********************************************************************
|
|
* COPYRIGHT:
|
|
* Copyright (c) 1997-1999, International Business Machines Corporation and
|
|
* others. All Rights Reserved.
|
|
********************************************************************/
|
|
|
|
#include "intltest.h"
|
|
#include "unicode/locid.h"
|
|
|
|
/**
|
|
* Tests for the Locale class
|
|
**/
|
|
class LocaleTest: public IntlTest {
|
|
public:
|
|
LocaleTest();
|
|
~LocaleTest();
|
|
|
|
void runIndexedTest( int32_t index, bool_t exec, char* &name, char* par = NULL );
|
|
|
|
/**
|
|
* Test methods to set and get data fields
|
|
**/
|
|
void TestBasicGetters(void);
|
|
/**
|
|
* Use Locale to access Resource file data and compare against expected values
|
|
**/
|
|
void TestSimpleResourceInfo(void);
|
|
/**
|
|
* Use Locale to access Resource file display names and compare against expected values
|
|
**/
|
|
void TestDisplayNames(void);
|
|
/**
|
|
* Test methods for basic object behaviour
|
|
**/
|
|
void TestSimpleObjectStuff(void);
|
|
/**
|
|
* Test methods for POSIX parsing behavior
|
|
**/
|
|
void TestPOSIXParsing(void);
|
|
/**
|
|
* Test Locale::getAvailableLocales
|
|
**/
|
|
void TestGetAvailableLocales(void);
|
|
/**
|
|
* Test methods to set and access a custom data directory
|
|
**/
|
|
void TestDataDirectory(void);
|
|
|
|
void TestISO3Fallback(void);
|
|
void TestGetLangsAndCountries(void);
|
|
void Test4126880(void);
|
|
void TestBug4135316(void);
|
|
void TestSimpleDisplayNames(void);
|
|
void TestUninstalledISO3Names(void);
|
|
void TestAtypicalLocales(void);
|
|
void TestNullDefault(void);
|
|
void TestThaiCurrencyFormat(void);
|
|
void TestEuroSupport(void);
|
|
void TestToString(void);
|
|
void Test4139940(void);
|
|
void Test4143951(void);
|
|
void Test4147315(void);
|
|
void Test4147317(void);
|
|
void Test4147552(void);
|
|
|
|
void TestVariantParsing(void);
|
|
|
|
void Test4105828(void) ;
|
|
|
|
static UDate date(int32_t y, int32_t m, int32_t d, int32_t hr = 0, int32_t min = 0, int32_t sec = 0);
|
|
|
|
private:
|
|
/**
|
|
* routine to perform subtests, used by TestDisplayNames
|
|
**/
|
|
void doTestDisplayNames(Locale& inLocale, int32_t compareIndex, bool_t defaultIsFrench);
|
|
/**
|
|
* additional intialization for datatables storing expected values
|
|
**/
|
|
void setUpDataTable(void);
|
|
|
|
static UnicodeString** dataTable;
|
|
|
|
enum {
|
|
ENGLISH = 0,
|
|
FRENCH = 1,
|
|
CROATIAN = 2,
|
|
GREEK = 3,
|
|
NORWEGIAN = 4,
|
|
MAX_LOCALES = 4
|
|
};
|
|
|
|
enum {
|
|
LANG = 0,
|
|
CTRY = 1,
|
|
VAR = 2,
|
|
NAME = 3,
|
|
LANG3 = 4,
|
|
CTRY3 = 5,
|
|
LCID = 6,
|
|
DLANG_EN = 7,
|
|
DCTRY_EN = 8,
|
|
DVAR_EN = 9,
|
|
DNAME_EN = 10,
|
|
DLANG_FR = 11,
|
|
DCTRY_FR = 12,
|
|
DVAR_FR = 13,
|
|
DNAME_FR = 14,
|
|
DLANG_HR = 15,
|
|
DCTRY_HR = 16,
|
|
DVAR_HR = 17,
|
|
DNAME_HR = 18,
|
|
DLANG_EL = 19,
|
|
DCTRY_EL = 20,
|
|
DVAR_EL = 21,
|
|
DNAME_EL = 22,
|
|
DLANG_RT = 23,
|
|
DCTRY_RT = 24,
|
|
DVAR_RT = 25,
|
|
DNAME_RT = 26
|
|
};
|
|
};
|
|
|
|
|
|
|