ICU-2131 Stop using the LocaleProxy deprecated code hack

X-SVN-Rev: 9746
This commit is contained in:
George Rhoten 2002-08-21 00:16:30 +00:00
parent d55add77df
commit d3c17fa8bc
22 changed files with 1164 additions and 1164 deletions

View File

@ -98,7 +98,7 @@ CollationAPITest::TestProperty(/* char* par */)
logln("The property tests begin : ");
logln("Test ctors : ");
col = Collator::createInstance(Locale::ENGLISH, success);
col = Collator::createInstance(Locale::getEnglish(), success);
if (U_FAILURE(success))
{
@ -173,7 +173,7 @@ CollationAPITest::TestProperty(/* char* par */)
doAssert(rcol->getRules().length() != 0, "da_DK rules does not have length 0");
delete rcol;
col = Collator::createInstance(Locale::FRENCH, success);
col = Collator::createInstance(Locale::getFrench(), success);
if (U_FAILURE(success))
{
errln("Creating French collation failed.");
@ -438,7 +438,7 @@ CollationAPITest::TestHashCode(/* char* par */)
logln("hashCode tests begin.");
UErrorCode success = U_ZERO_ERROR;
Collator *col1 = 0;
col1 = Collator::createInstance(Locale::ENGLISH, success);
col1 = Collator::createInstance(Locale::getEnglish(), success);
if (U_FAILURE(success))
{
errln("Default collation creation failed.");
@ -455,7 +455,7 @@ CollationAPITest::TestHashCode(/* char* par */)
}
Collator *col3 = 0;
col3 = Collator::createInstance(Locale::ENGLISH, success);
col3 = Collator::createInstance(Locale::getEnglish(), success);
if (U_FAILURE(success))
{
errln("2nd default collation creation failed.");
@ -497,7 +497,7 @@ CollationAPITest::TestCollationKey(/* char* par */)
logln("testing CollationKey begins...");
Collator *col = 0;
UErrorCode success=U_ZERO_ERROR;
col = Collator::createInstance(Locale::ENGLISH, success);
col = Collator::createInstance(Locale::getEnglish(), success);
col->setStrength(Collator::TERTIARY);
if (U_FAILURE(success))
{
@ -619,7 +619,7 @@ CollationAPITest::TestElemIter(/* char* par */)
logln("testing sortkey begins...");
Collator *col = 0;
UErrorCode success = U_ZERO_ERROR;
col = Collator::createInstance(Locale::ENGLISH, success);
col = Collator::createInstance(Locale::getEnglish(), success);
if (U_FAILURE(success))
{
errln("Default collation creation failed.");
@ -776,7 +776,7 @@ CollationAPITest::TestElemIter(/* char* par */)
//test error values
success=U_UNSUPPORTED_ERROR;
Collator *colerror=NULL;
colerror=Collator::createInstance(Locale::ENGLISH, success);
colerror=Collator::createInstance(Locale::getEnglish(), success);
if (colerror != 0 || success == U_ZERO_ERROR){
errln("Error: createInstance(UErrorCode != U_ZERO_ERROR) should just return and not create an instance\n");
}
@ -831,7 +831,7 @@ CollationAPITest::TestOperators(/* char* par */)
doAssert((*col1 == *col2), "Collator objects not equal after assignment (operator=)");
success = U_ZERO_ERROR;
Collator *col3 = Collator::createInstance(Locale::ENGLISH, success);
Collator *col3 = Collator::createInstance(Locale::getEnglish(), success);
if (U_FAILURE(success)) {
errln("Default collation creation failed.");
return;
@ -893,7 +893,7 @@ void
CollationAPITest::TestDuplicate(/* char* par */)
{
UErrorCode status = U_ZERO_ERROR;
Collator *col1 = Collator::createInstance(Locale::ENGLISH, status);
Collator *col1 = Collator::createInstance(Locale::getEnglish(), status);
if (U_FAILURE(status)) {
logln("Default collator creation failed.");
return;
@ -916,7 +916,7 @@ CollationAPITest::TestCompare(/* char* par */)
logln("The compare tests begin : ");
Collator *col = 0;
UErrorCode success = U_ZERO_ERROR;
col = Collator::createInstance(Locale::ENGLISH, success);
col = Collator::createInstance(Locale::getEnglish(), success);
if (U_FAILURE(success)) {
errln("Default collation creation failed.");
return;
@ -968,7 +968,7 @@ void CollationAPITest::TestSortKey()
- very bad if you try to run the tests on machine where default
locale is NOT "en_US"
*/
Collator *col = Collator::createInstance(Locale::ENGLISH, status);
Collator *col = Collator::createInstance(Locale::getEnglish(), status);
if (U_FAILURE(status)) {
errln("ERROR: Default collation creation failed.: %s\n", u_errorName(status));
return;
@ -1271,8 +1271,8 @@ void CollationAPITest::TestDisplayName()
errln("Failure getting the correct name for locale en_US");
}
coll->getDisplayName(Locale::SIMPLIFIED_CHINESE, result);
Locale::SIMPLIFIED_CHINESE.getDisplayName(name);
coll->getDisplayName(Locale::getSimplifiedChinese(), result);
Locale::getSimplifiedChinese().getDisplayName(name);
if (result.compare(name)) {
errln("Failure getting the correct name for locale zh_SG");
}

File diff suppressed because it is too large Load Diff

View File

@ -326,11 +326,11 @@ CalendarTest::TestGenericAPI()
}
}
cal = Calendar::createInstance(TimeZone::createDefault(), Locale::ENGLISH, status);
cal = Calendar::createInstance(TimeZone::createDefault(), Locale::getEnglish(), status);
if (failure(status, "Calendar::createInstance")) return;
delete cal;
cal = Calendar::createInstance(*zone, Locale::ENGLISH, status);
cal = Calendar::createInstance(*zone, Locale::getEnglish(), status);
if (failure(status, "Calendar::createInstance")) return;
delete cal;
@ -338,14 +338,14 @@ CalendarTest::TestGenericAPI()
if (failure(status, "new GregorianCalendar")) return;
delete gc;
gc = new GregorianCalendar(Locale::ENGLISH, status);
gc = new GregorianCalendar(Locale::getEnglish(), status);
if (failure(status, "new GregorianCalendar")) return;
delete gc;
gc = new GregorianCalendar(Locale::ENGLISH, status);
gc = new GregorianCalendar(Locale::getEnglish(), status);
delete gc;
gc = new GregorianCalendar(*zone, Locale::ENGLISH, status);
gc = new GregorianCalendar(*zone, Locale::getEnglish(), status);
if (failure(status, "new GregorianCalendar")) return;
delete gc;
@ -362,7 +362,7 @@ CalendarTest::TestGenericAPI()
if (gc->getTime(status) != date(98, 10, 14, 21, 43, 55) || U_FAILURE(status))
errln("FAIL: new GregorianCalendar(ymdhms) failed");
GregorianCalendar gc2(Locale::ENGLISH, status);
GregorianCalendar gc2(Locale::getEnglish(), status);
if (failure(status, "new GregorianCalendar")) return;
gc2 = *gc;
if (gc2 != *gc || !(gc2 == *gc)) errln("FAIL: GregorianCalendar assignment/operator==/operator!= failed");

View File

@ -22,7 +22,7 @@ void IntlTestDecimalFormatAPI::runIndexedTest( int32_t index, UBool exec, const
if (exec) {
logln((UnicodeString)"DecimalFormat API test---"); logln((UnicodeString)"");
UErrorCode status = U_ZERO_ERROR;
Locale::setDefault(Locale::ENGLISH, status);
Locale::setDefault(Locale::getEnglish(), status);
if(U_FAILURE(status)) {
errln((UnicodeString)"ERROR: Could not set default locale, test may not give correct results");
}
@ -65,7 +65,7 @@ void IntlTestDecimalFormatAPI::testAPI(/*char *par*/)
}
status = U_ZERO_ERROR;
DecimalFormatSymbols *symbols = new DecimalFormatSymbols(Locale::FRENCH, status);
DecimalFormatSymbols *symbols = new DecimalFormatSymbols(Locale::getFrench(), status);
if(U_FAILURE(status)) {
errln((UnicodeString)"ERROR: Could not create DecimalFormatSymbols (French)");
}

View File

@ -27,7 +27,7 @@ void IntlTestDateFormatAPI::runIndexedTest( int32_t index, UBool exec, const cha
if (exec) {
logln("DateFormat API test---"); logln("");
UErrorCode status = U_ZERO_ERROR;
Locale::setDefault(Locale::ENGLISH, status);
Locale::setDefault(Locale::getEnglish(), status);
if(U_FAILURE(status)) {
errln("ERROR: Could not set default locale, test may not give correct results");
}
@ -94,8 +94,8 @@ void IntlTestDateFormatAPI::testAPI(/* char* par */)
logln("Testing DateFormat constructors");
DateFormat *def = DateFormat::createInstance();
DateFormat *fr = DateFormat::createTimeInstance(DateFormat::FULL, Locale::FRENCH);
DateFormat *it = DateFormat::createDateInstance(DateFormat::MEDIUM, Locale::ITALIAN);
DateFormat *fr = DateFormat::createTimeInstance(DateFormat::FULL, Locale::getFrench());
DateFormat *it = DateFormat::createDateInstance(DateFormat::MEDIUM, Locale::getItalian());
DateFormat *de = DateFormat::createDateTimeInstance(DateFormat::LONG, DateFormat::LONG, Locale::getGerman());
// ======= Test equality

View File

@ -15,7 +15,7 @@ CollationEnglishTest::CollationEnglishTest()
: myCollation(0)
{
UErrorCode status = U_ZERO_ERROR;
myCollation = Collator::createInstance(Locale::ENGLISH, status);
myCollation = Collator::createInstance(Locale::getEnglish(), status);
}
CollationEnglishTest::~CollationEnglishTest()

View File

@ -57,7 +57,7 @@ RbnfRoundTripTest::TestEnglishSpelloutRT()
{
UErrorCode status = U_ZERO_ERROR;
RuleBasedNumberFormat* formatter
= new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::US, status);
= new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::getUS(), status);
if (U_FAILURE(status)) {
errln("failed to construct formatter");
@ -75,7 +75,7 @@ RbnfRoundTripTest::TestDurationsRT()
{
UErrorCode status = U_ZERO_ERROR;
RuleBasedNumberFormat* formatter
= new RuleBasedNumberFormat(URBNF_DURATION, Locale::US, status);
= new RuleBasedNumberFormat(URBNF_DURATION, Locale::getUS(), status);
if (U_FAILURE(status)) {
errln("failed to construct formatter");
@ -147,7 +147,7 @@ RbnfRoundTripTest::TestItalianSpelloutRT()
{
UErrorCode status = U_ZERO_ERROR;
RuleBasedNumberFormat* formatter
= new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::ITALIAN, status);
= new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::getItalian(), status);
if (U_FAILURE(status)) {
errln("failed to construct formatter");
@ -219,7 +219,7 @@ RbnfRoundTripTest::TestJapaneseSpelloutRT()
{
UErrorCode status = U_ZERO_ERROR;
RuleBasedNumberFormat* formatter
= new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::JAPAN, status);
= new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::getJapan(), status);
if (U_FAILURE(status)) {
errln("failed to construct formatter");

View File

@ -672,7 +672,7 @@ void IntlTestTextBoundary::TestLineIteration()
void IntlTestTextBoundary::TestLineInvariants()
{
UErrorCode status = U_ZERO_ERROR;
BreakIterator *e = BreakIterator::createLineInstance(Locale::US, status);
BreakIterator *e = BreakIterator::createLineInstance(Locale::getUS(), status);
if (U_FAILURE(status))
{
errln("Failed to create the BreakIterator for default locale in TestLineInvariants.\n");
@ -1035,7 +1035,7 @@ void IntlTestTextBoundary::TestJapaneseLineBreak()
// ":;\\u309b\\u309c\\u3005\\u309d\\u309e\\u30fd\\u30fe\\u2019\\u201d\\u00b0\\u2032\\u2033\\u2034"
":;\\u309b\\u309c\\u3005\\u309d\\u309e\\u30fd\\u00b0\\u2032\\u2033\\u2034"
"\\u2030\\u2031\\u2103\\u2109\\u00a2\\u0300\\u0301\\u0302");
BreakIterator *iter = BreakIterator::createLineInstance(Locale::JAPAN, status);
BreakIterator *iter = BreakIterator::createLineInstance(Locale::getJapan(), status);
int32_t i;
if (U_FAILURE(status))

View File

@ -1051,7 +1051,7 @@ LocaleTest::TestSimpleDisplayNames()
for (int32_t i = 0; i < 6; i++) {
UnicodeString test;
Locale l(languageCodes[i], "", "");
l.getDisplayLanguage(Locale::US, test);
l.getDisplayLanguage(Locale::getUS(), test);
if (test != languageNames[i])
errln("Got wrong display name for " + UnicodeString(languageCodes[i]) + ": Expected \"" +
languageNames[i] + "\", got \"" + test + "\".");

View File

@ -23,7 +23,7 @@ void IntlTestNumberFormatAPI::runIndexedTest( int32_t index, UBool exec, const c
if (exec) {
logln("NumberFormat API test---"); logln("");
UErrorCode status = U_ZERO_ERROR;
Locale::setDefault(Locale::ENGLISH, status);
Locale::setDefault(Locale::getEnglish(), status);
if(U_FAILURE(status)) {
errln("ERROR: Could not set default locale, test may not give correct results");
}
@ -53,7 +53,7 @@ void IntlTestNumberFormatAPI::testAPI(/* char* par */)
}
status = U_ZERO_ERROR;
NumberFormat *fr = NumberFormat::createInstance(Locale::FRENCH, status);
NumberFormat *fr = NumberFormat::createInstance(Locale::getFrench(), status);
if(U_FAILURE(status)) {
errln("ERROR: Could not create NumberFormat (French)");
}
@ -64,7 +64,7 @@ void IntlTestNumberFormatAPI::testAPI(/* char* par */)
}
status = U_ZERO_ERROR;
NumberFormat *cur_fr = NumberFormat::createCurrencyInstance(Locale::FRENCH, status);
NumberFormat *cur_fr = NumberFormat::createCurrencyInstance(Locale::getFrench(), status);
if(U_FAILURE(status)) {
errln("ERROR: Could not create NumberFormat (currency, French)");
}
@ -75,7 +75,7 @@ void IntlTestNumberFormatAPI::testAPI(/* char* par */)
}
status = U_ZERO_ERROR;
NumberFormat *per_fr = NumberFormat::createPercentInstance(Locale::FRENCH, status);
NumberFormat *per_fr = NumberFormat::createPercentInstance(Locale::getFrench(), status);
if(U_FAILURE(status)) {
errln("ERROR: Could not create NumberFormat (percent, French)");
}

View File

@ -274,7 +274,7 @@ NumberFormatRegressionTest::assignFloatValue(float returnfloat)
{
logln(UnicodeString(" VALUE ") + returnfloat);
UErrorCode status = U_ZERO_ERROR;
NumberFormat *nfcommon = NumberFormat::createCurrencyInstance(Locale::US, status);
NumberFormat *nfcommon = NumberFormat::createCurrencyInstance(Locale::getUS(), status);
failure(status, "NumberFormat::createCurrencyInstance");
nfcommon->setGroupingUsed(FALSE);
@ -1178,7 +1178,7 @@ void NumberFormatRegressionTest::Test4062486(void)
void NumberFormatRegressionTest::Test4108738(void)
{
UErrorCode status = U_ZERO_ERROR;
DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::US, status);
DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::getUS(), status);
failure(status, "new DecimalFormatSymbols");
DecimalFormat *df = new DecimalFormat("#,##0.###", syms, status);
failure(status, "new DecimalFormat");
@ -1584,7 +1584,7 @@ void NumberFormatRegressionTest::Test4134300(void) {
void NumberFormatRegressionTest::Test4140009(void)
{
UErrorCode status = U_ZERO_ERROR;
DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::ENGLISH, status);
DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::getEnglish(), status);
failure(status, "new DecimalFormatSymbols");
DecimalFormat *f = new DecimalFormat(UnicodeString(""), syms, status);
failure(status, "new DecimalFormat");
@ -1728,7 +1728,7 @@ void NumberFormatRegressionTest::Test4147706(void)
UErrorCode status = U_ZERO_ERROR;
DecimalFormat *df = new DecimalFormat("#,##0.0##", status);
failure(status, "new DecimalFormat");
DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::ENGLISH, status);
DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::getEnglish(), status);
failure(status, "new DecimalFormatSymbols");
UnicodeString f1;
UnicodeString f2, temp;
@ -1855,7 +1855,7 @@ static double _u_abs(double a) { return a<0?-a:a; }
*/
void NumberFormatRegressionTest::Test4167494(void) {
UErrorCode status = U_ZERO_ERROR;
NumberFormat *fmt = NumberFormat::createInstance(Locale::US, status);
NumberFormat *fmt = NumberFormat::createInstance(Locale::getUS(), status);
failure(status, "NumberFormat::createInstance");
double a = DBL_MAX * 0.99; // DBL_MAX itself overflows to +Inf
@ -1888,7 +1888,7 @@ void NumberFormatRegressionTest::Test4167494(void) {
*/
void NumberFormatRegressionTest::Test4170798(void) {
UErrorCode status = U_ZERO_ERROR;
NumberFormat *nf = NumberFormat::createInstance(Locale::US, status);
NumberFormat *nf = NumberFormat::createInstance(Locale::getUS(), status);
failure(status, "NumberFormat::createInstance");
if(nf->getDynamicClassID() != DecimalFormat::getStaticClassID()) {
errln("DecimalFormat needed to continue");
@ -1956,7 +1956,7 @@ void NumberFormatRegressionTest::Test4179818(void) {
0.9999,
};
UErrorCode status = U_ZERO_ERROR;
DecimalFormatSymbols sym(Locale::US, status);
DecimalFormatSymbols sym(Locale::getUS(), status);
failure(status, "Construct DecimalFormatSymbols");
DecimalFormat fmt("#", sym, status);
failure(status, "Construct DecimalFormat");
@ -1987,7 +1987,7 @@ void NumberFormatRegressionTest::Test4179818(void) {
*/
void NumberFormatRegressionTest::Test4212072(void) {
UErrorCode status = U_ZERO_ERROR;
DecimalFormatSymbols sym(Locale::US, status);
DecimalFormatSymbols sym(Locale::getUS(), status);
/*
failure(status, "DecimalFormatSymbols ct");
DecimalFormat fmt(UnicodeString("#"), sym, status);
@ -2152,7 +2152,7 @@ void NumberFormatRegressionTest::Test4212072(void) {
*/
void NumberFormatRegressionTest::Test4216742(void) {
UErrorCode status = U_ZERO_ERROR;
DecimalFormat *fmt = (DecimalFormat*) NumberFormat::createInstance(Locale::US, status);
DecimalFormat *fmt = (DecimalFormat*) NumberFormat::createInstance(Locale::getUS(), status);
failure(status, "createInstance");
int32_t DATA[] = { INT32_MIN, INT32_MAX, -100000000, 100000000 };
int DATA_length = (int)(sizeof(DATA) / sizeof(DATA[0]));
@ -2191,7 +2191,7 @@ void NumberFormatRegressionTest::Test4217661(void) {
const char* S[] = { "0", "1", "0.01", "1.01" };
int D_length = (int)(sizeof(D) / sizeof(D[0]));
UErrorCode status = U_ZERO_ERROR;
NumberFormat *fmt = NumberFormat::createInstance(Locale::US, status);
NumberFormat *fmt = NumberFormat::createInstance(Locale::getUS(), status);
failure(status, "createInstance");
fmt->setMaximumFractionDigits(2);
for (int i=0; i<D_length; i++) {
@ -2209,7 +2209,7 @@ void NumberFormatRegressionTest::Test4217661(void) {
*/
void NumberFormatRegressionTest::Test4161100(void) {
UErrorCode status = U_ZERO_ERROR;
NumberFormat *nf = NumberFormat::createInstance(Locale::US, status);
NumberFormat *nf = NumberFormat::createInstance(Locale::getUS(), status);
failure(status, "createInstance");
nf->setMinimumFractionDigits(1);
nf->setMaximumFractionDigits(1);
@ -2231,7 +2231,7 @@ void NumberFormatRegressionTest::Test4161100(void) {
*/
void NumberFormatRegressionTest::Test4243011(void) {
UErrorCode status = U_ZERO_ERROR;
DecimalFormatSymbols sym(Locale::US, status);
DecimalFormatSymbols sym(Locale::getUS(), status);
failure(status, "DecimalFormatSymbols ct");
DecimalFormat fmt(UnicodeString("0."), sym, status);
failure(status, "DecimalFormat ct");
@ -2261,7 +2261,7 @@ void NumberFormatRegressionTest::Test4243011(void) {
*/
void NumberFormatRegressionTest::Test4243108(void) {
UErrorCode status = U_ZERO_ERROR;
DecimalFormatSymbols sym(Locale::US, status);
DecimalFormatSymbols sym(Locale::getUS(), status);
failure(status, "DecimalFormatSymbols ct");
DecimalFormat fmt(UnicodeString("#.#"), sym, status);
failure(status, "DecimalFormat ct");

View File

@ -67,7 +67,7 @@ void RBBIAPITest::TestCloneEquals()
// source and dest iterator produce the same next() after assignment.
// deleting one doesn't disable the other.
logln("Testing assignment");
RuleBasedBreakIterator *bix = (RuleBasedBreakIterator *)BreakIterator::createLineInstance(Locale::ENGLISH, status);
RuleBasedBreakIterator *bix = (RuleBasedBreakIterator *)BreakIterator::createLineInstance(Locale::getEnglish(), status);
if(U_FAILURE(status)){
errln((UnicodeString)"FAIL : in construction");
return;

View File

@ -17,7 +17,7 @@ CollationRegressionTest::CollationRegressionTest()
{
UErrorCode status = U_ZERO_ERROR;
en_us = (RuleBasedCollator *)Collator::createInstance(Locale::US, status);
en_us = (RuleBasedCollator *)Collator::createInstance(Locale::getUS(), status);
}
CollationRegressionTest::~CollationRegressionTest()
@ -790,7 +790,7 @@ void CollationRegressionTest::Test4124632(/* char* par */)
UErrorCode status = U_ZERO_ERROR;
Collator *coll = NULL;
coll = Collator::createInstance(Locale::JAPAN, status);
coll = Collator::createInstance(Locale::getJapan(), status);
if (coll == NULL || U_FAILURE(status))
{

View File

@ -23,7 +23,7 @@ void IntlTestSimpleDateFormatAPI::runIndexedTest( int32_t index, UBool exec, con
if (exec) {
logln("SimpleDateFormat API test---"); logln("");
UErrorCode status = U_ZERO_ERROR;
Locale::setDefault(Locale::ENGLISH, status);
Locale::setDefault(Locale::getEnglish(), status);
if(U_FAILURE(status)) {
errln("ERROR: Could not set default locale, test may not give correct results");
}
@ -59,13 +59,13 @@ void IntlTestSimpleDateFormatAPI::testAPI(/*char *par*/)
}
status = U_ZERO_ERROR;
SimpleDateFormat pat_fr(pattern, Locale::FRENCH, status);
SimpleDateFormat pat_fr(pattern, Locale::getFrench(), status);
if(U_FAILURE(status)) {
errln("ERROR: Could not create SimpleDateFormat (pattern French)");
}
status = U_ZERO_ERROR;
DateFormatSymbols *symbols = new DateFormatSymbols(Locale::FRENCH, status);
DateFormatSymbols *symbols = new DateFormatSymbols(Locale::getFrench(), status);
if(U_FAILURE(status)) {
errln("ERROR: Could not create DateFormatSymbols (French)");
}

View File

@ -51,9 +51,9 @@ StringSearchTest::StringSearchTest()
m_es_ = new RuleBasedCollator(rules, status);
m_en_wordbreaker_ = BreakIterator::createWordInstance(
Locale::ENGLISH, status);
Locale::getEnglish(), status);
m_en_characterbreaker_ = BreakIterator::createCharacterInstance(
Locale::ENGLISH, status);
Locale::getEnglish(), status);
}
StringSearchTest::~StringSearchTest()
@ -503,14 +503,14 @@ void StringSearchTest::TestOpenClose()
delete result;
status = U_ZERO_ERROR;
result = new StringSearch(pattern, text, Locale::ENGLISH, NULL, status);
result = new StringSearch(pattern, text, Locale::getEnglish(), NULL, status);
if (U_FAILURE(status) || result == NULL) {
errln("Error: NULL break iterator is valid for opening search");
}
delete result;
status = U_ZERO_ERROR;
result = new StringSearch(pattern, chariter, Locale::ENGLISH, NULL, status);
result = new StringSearch(pattern, chariter, Locale::getEnglish(), NULL, status);
if (U_FAILURE(status)) {
errln("Error: NULL break iterator is valid for opening search");
}

View File

@ -629,14 +629,14 @@ void TestMessageFormat::testSetLocale()
msg.setLocale(Locale::getEnglish());
UBool getLocale_ok = TRUE;
if (msg.getLocale() != Locale::ENGLISH) {
if (msg.getLocale() != Locale::getEnglish()) {
errln("*** MSG getLocal err.");
getLocale_ok = FALSE;
}
msg.setLocale(Locale::getGerman());
if (msg.getLocale() != Locale::GERMAN) {
if (msg.getLocale() != Locale::getGerman()) {
errln("*** MSG getLocal err.");
getLocale_ok = FALSE;
}

View File

@ -238,7 +238,7 @@ void TransliteratorAPITest::TestGetDisplayName() {
message="Display name for ID:" + t->getID();
// doTest(message, name, dispNames[i+1]); //!!! This will obviously fail for any locale other than english and its children!!!
name="";
t->getDisplayName(t->getID(), Locale::US, name);
t->getDisplayName(t->getID(), Locale::getUS(), name);
message.remove();
message.append("Display name for on english locale ID:");
message.append(t->getID());

View File

@ -3178,10 +3178,10 @@ void TransliteratorTest::TestSpecialCases(void) {
Normalizer::normalize(source, UNORM_NFKC, 0, target, ec);
} else if (0==id.caseCompare("Lower", U_FOLD_CASE_DEFAULT)) {
target = source;
target.toLower(Locale::US);
target.toLower(Locale::getUS());
} else if (0==id.caseCompare("Upper", U_FOLD_CASE_DEFAULT)) {
target = source;
target.toUpper(Locale::US);
target.toUpper(Locale::getUS());
}
if (U_FAILURE(ec)) {
errln((UnicodeString)"FAIL: Internal error normalizing " + source);

View File

@ -63,13 +63,13 @@ void IntlTestDateFormatSymbols::testSymbols(/* char *par */)
{
UErrorCode status = U_ZERO_ERROR;
DateFormatSymbols fr(Locale::FRENCH, status);
DateFormatSymbols fr(Locale::getFrench(), status);
if(U_FAILURE(status)) {
errln("ERROR: Couldn't create French DateFormatSymbols");
}
status = U_ZERO_ERROR;
DateFormatSymbols en(Locale::ENGLISH, status);
DateFormatSymbols en(Locale::getEnglish(), status);
if(U_FAILURE(status)) {
errln("ERROR: Couldn't create English DateFormatSymbols");
}

View File

@ -673,7 +673,7 @@ public:
int32_t iteration;
UErrorCode status = U_ZERO_ERROR;
NumberFormat *formatter = NumberFormat::createInstance(Locale::ENGLISH,status);
NumberFormat *formatter = NumberFormat::createInstance(Locale::getEnglish(),status);
if(U_FAILURE(status))
{
@ -681,7 +681,7 @@ public:
return;
}
NumberFormat *percentFormatter = NumberFormat::createPercentInstance(Locale::FRENCH,status);
NumberFormat *percentFormatter = NumberFormat::createPercentInstance(Locale::getFrench(),status);
if(U_FAILURE(status))
{

View File

@ -785,7 +785,7 @@ void
TimeZoneRegressionTest::Test4162593()
{
UErrorCode status = U_ZERO_ERROR;
SimpleDateFormat *fmt = new SimpleDateFormat("z", Locale::US, status);
SimpleDateFormat *fmt = new SimpleDateFormat("z", Locale::getUS(), status);
const int32_t ONE_HOUR = 60*60*1000;
SimpleTimeZone *asuncion = new SimpleTimeZone(-4*ONE_HOUR, "America/Asuncion" /*PY%sT*/,

View File

@ -733,7 +733,7 @@ TimeZoneTest::TestDisplayName()
int32_t i;
TimeZone *zone = TimeZone::createTimeZone("PST");
UnicodeString name;
zone->getDisplayName(Locale::ENGLISH, name);
zone->getDisplayName(Locale::getEnglish(), name);
logln("PST->" + name);
if (name.compare("Pacific Standard Time") != 0)
errln("Fail: Expected \"Pacific Standard Time\" but got " + name);
@ -762,7 +762,7 @@ TimeZoneTest::TestDisplayName()
name.remove();
name = zone->getDisplayName(kData[i].useDst,
kData[i].style,
Locale::ENGLISH, name);
Locale::getEnglish(), name);
if (name.compare(kData[i].expect) != 0)
errln("Fail: Expected " + UnicodeString(kData[i].expect) + "; got " + name);
logln("PST [with options]->" + name);
@ -782,14 +782,14 @@ TimeZoneTest::TestDisplayName()
errln("Some sort of error..." + UnicodeString(u_errorName(status))); // REVISIT
}
name.remove();
name = zone2->getDisplayName(Locale::ENGLISH,name);
name = zone2->getDisplayName(Locale::getEnglish(),name);
logln("Modified PST->" + name);
if (name.compare("Pacific Standard Time") != 0)
errln("Fail: Expected \"Pacific Standard Time\"");
// Make sure we get the default display format for Locales
// with no display name data.
Locale zh_CN = Locale::SIMPLIFIED_CHINESE;
Locale zh_CN = Locale::getSimplifiedChinese();
name.remove();
name = zone->getDisplayName(zh_CN,name);
//*****************************************************************
@ -803,7 +803,7 @@ TimeZoneTest::TestDisplayName()
// Now be smart -- check to see if zh resource is even present.
// If not, we expect the en fallback behavior.
ResourceBundle enRB(u_getDataDirectory(),
Locale::ENGLISH, status);
Locale::getEnglish(), status);
if(U_FAILURE(status))
errln("Couldn't get ResourceBundle for en");
@ -835,7 +835,7 @@ TimeZoneTest::TestDisplayName()
delete zone2;
zone2 = new SimpleTimeZone(90*60*1000, "xyzzy");
name.remove();
name = zone2->getDisplayName(Locale::ENGLISH,name);
name = zone2->getDisplayName(Locale::getEnglish(),name);
logln("GMT+90min->" + name);
if (name.compare("GMT+01:30") &&
name.compare("GMT+1:30") &&