ICU-2131 Stop using the LocaleProxy deprecated code hack
X-SVN-Rev: 9746
This commit is contained in:
parent
d55add77df
commit
d3c17fa8bc
@ -98,7 +98,7 @@ CollationAPITest::TestProperty(/* char* par */)
|
|||||||
|
|
||||||
logln("The property tests begin : ");
|
logln("The property tests begin : ");
|
||||||
logln("Test ctors : ");
|
logln("Test ctors : ");
|
||||||
col = Collator::createInstance(Locale::ENGLISH, success);
|
col = Collator::createInstance(Locale::getEnglish(), success);
|
||||||
|
|
||||||
if (U_FAILURE(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");
|
doAssert(rcol->getRules().length() != 0, "da_DK rules does not have length 0");
|
||||||
delete rcol;
|
delete rcol;
|
||||||
|
|
||||||
col = Collator::createInstance(Locale::FRENCH, success);
|
col = Collator::createInstance(Locale::getFrench(), success);
|
||||||
if (U_FAILURE(success))
|
if (U_FAILURE(success))
|
||||||
{
|
{
|
||||||
errln("Creating French collation failed.");
|
errln("Creating French collation failed.");
|
||||||
@ -438,7 +438,7 @@ CollationAPITest::TestHashCode(/* char* par */)
|
|||||||
logln("hashCode tests begin.");
|
logln("hashCode tests begin.");
|
||||||
UErrorCode success = U_ZERO_ERROR;
|
UErrorCode success = U_ZERO_ERROR;
|
||||||
Collator *col1 = 0;
|
Collator *col1 = 0;
|
||||||
col1 = Collator::createInstance(Locale::ENGLISH, success);
|
col1 = Collator::createInstance(Locale::getEnglish(), success);
|
||||||
if (U_FAILURE(success))
|
if (U_FAILURE(success))
|
||||||
{
|
{
|
||||||
errln("Default collation creation failed.");
|
errln("Default collation creation failed.");
|
||||||
@ -455,7 +455,7 @@ CollationAPITest::TestHashCode(/* char* par */)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Collator *col3 = 0;
|
Collator *col3 = 0;
|
||||||
col3 = Collator::createInstance(Locale::ENGLISH, success);
|
col3 = Collator::createInstance(Locale::getEnglish(), success);
|
||||||
if (U_FAILURE(success))
|
if (U_FAILURE(success))
|
||||||
{
|
{
|
||||||
errln("2nd default collation creation failed.");
|
errln("2nd default collation creation failed.");
|
||||||
@ -497,7 +497,7 @@ CollationAPITest::TestCollationKey(/* char* par */)
|
|||||||
logln("testing CollationKey begins...");
|
logln("testing CollationKey begins...");
|
||||||
Collator *col = 0;
|
Collator *col = 0;
|
||||||
UErrorCode success=U_ZERO_ERROR;
|
UErrorCode success=U_ZERO_ERROR;
|
||||||
col = Collator::createInstance(Locale::ENGLISH, success);
|
col = Collator::createInstance(Locale::getEnglish(), success);
|
||||||
col->setStrength(Collator::TERTIARY);
|
col->setStrength(Collator::TERTIARY);
|
||||||
if (U_FAILURE(success))
|
if (U_FAILURE(success))
|
||||||
{
|
{
|
||||||
@ -619,7 +619,7 @@ CollationAPITest::TestElemIter(/* char* par */)
|
|||||||
logln("testing sortkey begins...");
|
logln("testing sortkey begins...");
|
||||||
Collator *col = 0;
|
Collator *col = 0;
|
||||||
UErrorCode success = U_ZERO_ERROR;
|
UErrorCode success = U_ZERO_ERROR;
|
||||||
col = Collator::createInstance(Locale::ENGLISH, success);
|
col = Collator::createInstance(Locale::getEnglish(), success);
|
||||||
if (U_FAILURE(success))
|
if (U_FAILURE(success))
|
||||||
{
|
{
|
||||||
errln("Default collation creation failed.");
|
errln("Default collation creation failed.");
|
||||||
@ -776,7 +776,7 @@ CollationAPITest::TestElemIter(/* char* par */)
|
|||||||
//test error values
|
//test error values
|
||||||
success=U_UNSUPPORTED_ERROR;
|
success=U_UNSUPPORTED_ERROR;
|
||||||
Collator *colerror=NULL;
|
Collator *colerror=NULL;
|
||||||
colerror=Collator::createInstance(Locale::ENGLISH, success);
|
colerror=Collator::createInstance(Locale::getEnglish(), success);
|
||||||
if (colerror != 0 || success == U_ZERO_ERROR){
|
if (colerror != 0 || success == U_ZERO_ERROR){
|
||||||
errln("Error: createInstance(UErrorCode != U_ZERO_ERROR) should just return and not create an instance\n");
|
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=)");
|
doAssert((*col1 == *col2), "Collator objects not equal after assignment (operator=)");
|
||||||
|
|
||||||
success = U_ZERO_ERROR;
|
success = U_ZERO_ERROR;
|
||||||
Collator *col3 = Collator::createInstance(Locale::ENGLISH, success);
|
Collator *col3 = Collator::createInstance(Locale::getEnglish(), success);
|
||||||
if (U_FAILURE(success)) {
|
if (U_FAILURE(success)) {
|
||||||
errln("Default collation creation failed.");
|
errln("Default collation creation failed.");
|
||||||
return;
|
return;
|
||||||
@ -893,7 +893,7 @@ void
|
|||||||
CollationAPITest::TestDuplicate(/* char* par */)
|
CollationAPITest::TestDuplicate(/* char* par */)
|
||||||
{
|
{
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
Collator *col1 = Collator::createInstance(Locale::ENGLISH, status);
|
Collator *col1 = Collator::createInstance(Locale::getEnglish(), status);
|
||||||
if (U_FAILURE(status)) {
|
if (U_FAILURE(status)) {
|
||||||
logln("Default collator creation failed.");
|
logln("Default collator creation failed.");
|
||||||
return;
|
return;
|
||||||
@ -916,7 +916,7 @@ CollationAPITest::TestCompare(/* char* par */)
|
|||||||
logln("The compare tests begin : ");
|
logln("The compare tests begin : ");
|
||||||
Collator *col = 0;
|
Collator *col = 0;
|
||||||
UErrorCode success = U_ZERO_ERROR;
|
UErrorCode success = U_ZERO_ERROR;
|
||||||
col = Collator::createInstance(Locale::ENGLISH, success);
|
col = Collator::createInstance(Locale::getEnglish(), success);
|
||||||
if (U_FAILURE(success)) {
|
if (U_FAILURE(success)) {
|
||||||
errln("Default collation creation failed.");
|
errln("Default collation creation failed.");
|
||||||
return;
|
return;
|
||||||
@ -968,7 +968,7 @@ void CollationAPITest::TestSortKey()
|
|||||||
- very bad if you try to run the tests on machine where default
|
- very bad if you try to run the tests on machine where default
|
||||||
locale is NOT "en_US"
|
locale is NOT "en_US"
|
||||||
*/
|
*/
|
||||||
Collator *col = Collator::createInstance(Locale::ENGLISH, status);
|
Collator *col = Collator::createInstance(Locale::getEnglish(), status);
|
||||||
if (U_FAILURE(status)) {
|
if (U_FAILURE(status)) {
|
||||||
errln("ERROR: Default collation creation failed.: %s\n", u_errorName(status));
|
errln("ERROR: Default collation creation failed.: %s\n", u_errorName(status));
|
||||||
return;
|
return;
|
||||||
@ -1271,8 +1271,8 @@ void CollationAPITest::TestDisplayName()
|
|||||||
errln("Failure getting the correct name for locale en_US");
|
errln("Failure getting the correct name for locale en_US");
|
||||||
}
|
}
|
||||||
|
|
||||||
coll->getDisplayName(Locale::SIMPLIFIED_CHINESE, result);
|
coll->getDisplayName(Locale::getSimplifiedChinese(), result);
|
||||||
Locale::SIMPLIFIED_CHINESE.getDisplayName(name);
|
Locale::getSimplifiedChinese().getDisplayName(name);
|
||||||
if (result.compare(name)) {
|
if (result.compare(name)) {
|
||||||
errln("Failure getting the correct name for locale zh_SG");
|
errln("Failure getting the correct name for locale zh_SG");
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -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;
|
if (failure(status, "Calendar::createInstance")) return;
|
||||||
delete cal;
|
delete cal;
|
||||||
|
|
||||||
cal = Calendar::createInstance(*zone, Locale::ENGLISH, status);
|
cal = Calendar::createInstance(*zone, Locale::getEnglish(), status);
|
||||||
if (failure(status, "Calendar::createInstance")) return;
|
if (failure(status, "Calendar::createInstance")) return;
|
||||||
delete cal;
|
delete cal;
|
||||||
|
|
||||||
@ -338,14 +338,14 @@ CalendarTest::TestGenericAPI()
|
|||||||
if (failure(status, "new GregorianCalendar")) return;
|
if (failure(status, "new GregorianCalendar")) return;
|
||||||
delete gc;
|
delete gc;
|
||||||
|
|
||||||
gc = new GregorianCalendar(Locale::ENGLISH, status);
|
gc = new GregorianCalendar(Locale::getEnglish(), status);
|
||||||
if (failure(status, "new GregorianCalendar")) return;
|
if (failure(status, "new GregorianCalendar")) return;
|
||||||
delete gc;
|
delete gc;
|
||||||
|
|
||||||
gc = new GregorianCalendar(Locale::ENGLISH, status);
|
gc = new GregorianCalendar(Locale::getEnglish(), status);
|
||||||
delete gc;
|
delete gc;
|
||||||
|
|
||||||
gc = new GregorianCalendar(*zone, Locale::ENGLISH, status);
|
gc = new GregorianCalendar(*zone, Locale::getEnglish(), status);
|
||||||
if (failure(status, "new GregorianCalendar")) return;
|
if (failure(status, "new GregorianCalendar")) return;
|
||||||
delete gc;
|
delete gc;
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ CalendarTest::TestGenericAPI()
|
|||||||
if (gc->getTime(status) != date(98, 10, 14, 21, 43, 55) || U_FAILURE(status))
|
if (gc->getTime(status) != date(98, 10, 14, 21, 43, 55) || U_FAILURE(status))
|
||||||
errln("FAIL: new GregorianCalendar(ymdhms) failed");
|
errln("FAIL: new GregorianCalendar(ymdhms) failed");
|
||||||
|
|
||||||
GregorianCalendar gc2(Locale::ENGLISH, status);
|
GregorianCalendar gc2(Locale::getEnglish(), status);
|
||||||
if (failure(status, "new GregorianCalendar")) return;
|
if (failure(status, "new GregorianCalendar")) return;
|
||||||
gc2 = *gc;
|
gc2 = *gc;
|
||||||
if (gc2 != *gc || !(gc2 == *gc)) errln("FAIL: GregorianCalendar assignment/operator==/operator!= failed");
|
if (gc2 != *gc || !(gc2 == *gc)) errln("FAIL: GregorianCalendar assignment/operator==/operator!= failed");
|
||||||
|
@ -22,7 +22,7 @@ void IntlTestDecimalFormatAPI::runIndexedTest( int32_t index, UBool exec, const
|
|||||||
if (exec) {
|
if (exec) {
|
||||||
logln((UnicodeString)"DecimalFormat API test---"); logln((UnicodeString)"");
|
logln((UnicodeString)"DecimalFormat API test---"); logln((UnicodeString)"");
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
Locale::setDefault(Locale::ENGLISH, status);
|
Locale::setDefault(Locale::getEnglish(), status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln((UnicodeString)"ERROR: Could not set default locale, test may not give correct results");
|
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;
|
status = U_ZERO_ERROR;
|
||||||
DecimalFormatSymbols *symbols = new DecimalFormatSymbols(Locale::FRENCH, status);
|
DecimalFormatSymbols *symbols = new DecimalFormatSymbols(Locale::getFrench(), status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln((UnicodeString)"ERROR: Could not create DecimalFormatSymbols (French)");
|
errln((UnicodeString)"ERROR: Could not create DecimalFormatSymbols (French)");
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ void IntlTestDateFormatAPI::runIndexedTest( int32_t index, UBool exec, const cha
|
|||||||
if (exec) {
|
if (exec) {
|
||||||
logln("DateFormat API test---"); logln("");
|
logln("DateFormat API test---"); logln("");
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
Locale::setDefault(Locale::ENGLISH, status);
|
Locale::setDefault(Locale::getEnglish(), status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln("ERROR: Could not set default locale, test may not give correct results");
|
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");
|
logln("Testing DateFormat constructors");
|
||||||
|
|
||||||
DateFormat *def = DateFormat::createInstance();
|
DateFormat *def = DateFormat::createInstance();
|
||||||
DateFormat *fr = DateFormat::createTimeInstance(DateFormat::FULL, Locale::FRENCH);
|
DateFormat *fr = DateFormat::createTimeInstance(DateFormat::FULL, Locale::getFrench());
|
||||||
DateFormat *it = DateFormat::createDateInstance(DateFormat::MEDIUM, Locale::ITALIAN);
|
DateFormat *it = DateFormat::createDateInstance(DateFormat::MEDIUM, Locale::getItalian());
|
||||||
DateFormat *de = DateFormat::createDateTimeInstance(DateFormat::LONG, DateFormat::LONG, Locale::getGerman());
|
DateFormat *de = DateFormat::createDateTimeInstance(DateFormat::LONG, DateFormat::LONG, Locale::getGerman());
|
||||||
|
|
||||||
// ======= Test equality
|
// ======= Test equality
|
||||||
|
@ -15,7 +15,7 @@ CollationEnglishTest::CollationEnglishTest()
|
|||||||
: myCollation(0)
|
: myCollation(0)
|
||||||
{
|
{
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
myCollation = Collator::createInstance(Locale::ENGLISH, status);
|
myCollation = Collator::createInstance(Locale::getEnglish(), status);
|
||||||
}
|
}
|
||||||
|
|
||||||
CollationEnglishTest::~CollationEnglishTest()
|
CollationEnglishTest::~CollationEnglishTest()
|
||||||
|
@ -57,7 +57,7 @@ RbnfRoundTripTest::TestEnglishSpelloutRT()
|
|||||||
{
|
{
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
RuleBasedNumberFormat* formatter
|
RuleBasedNumberFormat* formatter
|
||||||
= new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::US, status);
|
= new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::getUS(), status);
|
||||||
|
|
||||||
if (U_FAILURE(status)) {
|
if (U_FAILURE(status)) {
|
||||||
errln("failed to construct formatter");
|
errln("failed to construct formatter");
|
||||||
@ -75,7 +75,7 @@ RbnfRoundTripTest::TestDurationsRT()
|
|||||||
{
|
{
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
RuleBasedNumberFormat* formatter
|
RuleBasedNumberFormat* formatter
|
||||||
= new RuleBasedNumberFormat(URBNF_DURATION, Locale::US, status);
|
= new RuleBasedNumberFormat(URBNF_DURATION, Locale::getUS(), status);
|
||||||
|
|
||||||
if (U_FAILURE(status)) {
|
if (U_FAILURE(status)) {
|
||||||
errln("failed to construct formatter");
|
errln("failed to construct formatter");
|
||||||
@ -147,7 +147,7 @@ RbnfRoundTripTest::TestItalianSpelloutRT()
|
|||||||
{
|
{
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
RuleBasedNumberFormat* formatter
|
RuleBasedNumberFormat* formatter
|
||||||
= new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::ITALIAN, status);
|
= new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::getItalian(), status);
|
||||||
|
|
||||||
if (U_FAILURE(status)) {
|
if (U_FAILURE(status)) {
|
||||||
errln("failed to construct formatter");
|
errln("failed to construct formatter");
|
||||||
@ -219,7 +219,7 @@ RbnfRoundTripTest::TestJapaneseSpelloutRT()
|
|||||||
{
|
{
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
RuleBasedNumberFormat* formatter
|
RuleBasedNumberFormat* formatter
|
||||||
= new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::JAPAN, status);
|
= new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::getJapan(), status);
|
||||||
|
|
||||||
if (U_FAILURE(status)) {
|
if (U_FAILURE(status)) {
|
||||||
errln("failed to construct formatter");
|
errln("failed to construct formatter");
|
||||||
|
@ -672,7 +672,7 @@ void IntlTestTextBoundary::TestLineIteration()
|
|||||||
void IntlTestTextBoundary::TestLineInvariants()
|
void IntlTestTextBoundary::TestLineInvariants()
|
||||||
{
|
{
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
BreakIterator *e = BreakIterator::createLineInstance(Locale::US, status);
|
BreakIterator *e = BreakIterator::createLineInstance(Locale::getUS(), status);
|
||||||
if (U_FAILURE(status))
|
if (U_FAILURE(status))
|
||||||
{
|
{
|
||||||
errln("Failed to create the BreakIterator for default locale in TestLineInvariants.\n");
|
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\\u30fe\\u2019\\u201d\\u00b0\\u2032\\u2033\\u2034"
|
||||||
":;\\u309b\\u309c\\u3005\\u309d\\u309e\\u30fd\\u00b0\\u2032\\u2033\\u2034"
|
":;\\u309b\\u309c\\u3005\\u309d\\u309e\\u30fd\\u00b0\\u2032\\u2033\\u2034"
|
||||||
"\\u2030\\u2031\\u2103\\u2109\\u00a2\\u0300\\u0301\\u0302");
|
"\\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;
|
int32_t i;
|
||||||
if (U_FAILURE(status))
|
if (U_FAILURE(status))
|
||||||
|
@ -1051,7 +1051,7 @@ LocaleTest::TestSimpleDisplayNames()
|
|||||||
for (int32_t i = 0; i < 6; i++) {
|
for (int32_t i = 0; i < 6; i++) {
|
||||||
UnicodeString test;
|
UnicodeString test;
|
||||||
Locale l(languageCodes[i], "", "");
|
Locale l(languageCodes[i], "", "");
|
||||||
l.getDisplayLanguage(Locale::US, test);
|
l.getDisplayLanguage(Locale::getUS(), test);
|
||||||
if (test != languageNames[i])
|
if (test != languageNames[i])
|
||||||
errln("Got wrong display name for " + UnicodeString(languageCodes[i]) + ": Expected \"" +
|
errln("Got wrong display name for " + UnicodeString(languageCodes[i]) + ": Expected \"" +
|
||||||
languageNames[i] + "\", got \"" + test + "\".");
|
languageNames[i] + "\", got \"" + test + "\".");
|
||||||
|
@ -23,7 +23,7 @@ void IntlTestNumberFormatAPI::runIndexedTest( int32_t index, UBool exec, const c
|
|||||||
if (exec) {
|
if (exec) {
|
||||||
logln("NumberFormat API test---"); logln("");
|
logln("NumberFormat API test---"); logln("");
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
Locale::setDefault(Locale::ENGLISH, status);
|
Locale::setDefault(Locale::getEnglish(), status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln("ERROR: Could not set default locale, test may not give correct results");
|
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;
|
status = U_ZERO_ERROR;
|
||||||
NumberFormat *fr = NumberFormat::createInstance(Locale::FRENCH, status);
|
NumberFormat *fr = NumberFormat::createInstance(Locale::getFrench(), status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln("ERROR: Could not create NumberFormat (French)");
|
errln("ERROR: Could not create NumberFormat (French)");
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ void IntlTestNumberFormatAPI::testAPI(/* char* par */)
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = U_ZERO_ERROR;
|
status = U_ZERO_ERROR;
|
||||||
NumberFormat *cur_fr = NumberFormat::createCurrencyInstance(Locale::FRENCH, status);
|
NumberFormat *cur_fr = NumberFormat::createCurrencyInstance(Locale::getFrench(), status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln("ERROR: Could not create NumberFormat (currency, French)");
|
errln("ERROR: Could not create NumberFormat (currency, French)");
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ void IntlTestNumberFormatAPI::testAPI(/* char* par */)
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = U_ZERO_ERROR;
|
status = U_ZERO_ERROR;
|
||||||
NumberFormat *per_fr = NumberFormat::createPercentInstance(Locale::FRENCH, status);
|
NumberFormat *per_fr = NumberFormat::createPercentInstance(Locale::getFrench(), status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln("ERROR: Could not create NumberFormat (percent, French)");
|
errln("ERROR: Could not create NumberFormat (percent, French)");
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,7 @@ NumberFormatRegressionTest::assignFloatValue(float returnfloat)
|
|||||||
{
|
{
|
||||||
logln(UnicodeString(" VALUE ") + returnfloat);
|
logln(UnicodeString(" VALUE ") + returnfloat);
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
NumberFormat *nfcommon = NumberFormat::createCurrencyInstance(Locale::US, status);
|
NumberFormat *nfcommon = NumberFormat::createCurrencyInstance(Locale::getUS(), status);
|
||||||
failure(status, "NumberFormat::createCurrencyInstance");
|
failure(status, "NumberFormat::createCurrencyInstance");
|
||||||
nfcommon->setGroupingUsed(FALSE);
|
nfcommon->setGroupingUsed(FALSE);
|
||||||
|
|
||||||
@ -1178,7 +1178,7 @@ void NumberFormatRegressionTest::Test4062486(void)
|
|||||||
void NumberFormatRegressionTest::Test4108738(void)
|
void NumberFormatRegressionTest::Test4108738(void)
|
||||||
{
|
{
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::US, status);
|
DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::getUS(), status);
|
||||||
failure(status, "new DecimalFormatSymbols");
|
failure(status, "new DecimalFormatSymbols");
|
||||||
DecimalFormat *df = new DecimalFormat("#,##0.###", syms, status);
|
DecimalFormat *df = new DecimalFormat("#,##0.###", syms, status);
|
||||||
failure(status, "new DecimalFormat");
|
failure(status, "new DecimalFormat");
|
||||||
@ -1584,7 +1584,7 @@ void NumberFormatRegressionTest::Test4134300(void) {
|
|||||||
void NumberFormatRegressionTest::Test4140009(void)
|
void NumberFormatRegressionTest::Test4140009(void)
|
||||||
{
|
{
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::ENGLISH, status);
|
DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::getEnglish(), status);
|
||||||
failure(status, "new DecimalFormatSymbols");
|
failure(status, "new DecimalFormatSymbols");
|
||||||
DecimalFormat *f = new DecimalFormat(UnicodeString(""), syms, status);
|
DecimalFormat *f = new DecimalFormat(UnicodeString(""), syms, status);
|
||||||
failure(status, "new DecimalFormat");
|
failure(status, "new DecimalFormat");
|
||||||
@ -1728,7 +1728,7 @@ void NumberFormatRegressionTest::Test4147706(void)
|
|||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
DecimalFormat *df = new DecimalFormat("#,##0.0##", status);
|
DecimalFormat *df = new DecimalFormat("#,##0.0##", status);
|
||||||
failure(status, "new DecimalFormat");
|
failure(status, "new DecimalFormat");
|
||||||
DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::ENGLISH, status);
|
DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::getEnglish(), status);
|
||||||
failure(status, "new DecimalFormatSymbols");
|
failure(status, "new DecimalFormatSymbols");
|
||||||
UnicodeString f1;
|
UnicodeString f1;
|
||||||
UnicodeString f2, temp;
|
UnicodeString f2, temp;
|
||||||
@ -1855,7 +1855,7 @@ static double _u_abs(double a) { return a<0?-a:a; }
|
|||||||
*/
|
*/
|
||||||
void NumberFormatRegressionTest::Test4167494(void) {
|
void NumberFormatRegressionTest::Test4167494(void) {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
NumberFormat *fmt = NumberFormat::createInstance(Locale::US, status);
|
NumberFormat *fmt = NumberFormat::createInstance(Locale::getUS(), status);
|
||||||
failure(status, "NumberFormat::createInstance");
|
failure(status, "NumberFormat::createInstance");
|
||||||
|
|
||||||
double a = DBL_MAX * 0.99; // DBL_MAX itself overflows to +Inf
|
double a = DBL_MAX * 0.99; // DBL_MAX itself overflows to +Inf
|
||||||
@ -1888,7 +1888,7 @@ void NumberFormatRegressionTest::Test4167494(void) {
|
|||||||
*/
|
*/
|
||||||
void NumberFormatRegressionTest::Test4170798(void) {
|
void NumberFormatRegressionTest::Test4170798(void) {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
NumberFormat *nf = NumberFormat::createInstance(Locale::US, status);
|
NumberFormat *nf = NumberFormat::createInstance(Locale::getUS(), status);
|
||||||
failure(status, "NumberFormat::createInstance");
|
failure(status, "NumberFormat::createInstance");
|
||||||
if(nf->getDynamicClassID() != DecimalFormat::getStaticClassID()) {
|
if(nf->getDynamicClassID() != DecimalFormat::getStaticClassID()) {
|
||||||
errln("DecimalFormat needed to continue");
|
errln("DecimalFormat needed to continue");
|
||||||
@ -1956,7 +1956,7 @@ void NumberFormatRegressionTest::Test4179818(void) {
|
|||||||
0.9999,
|
0.9999,
|
||||||
};
|
};
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
DecimalFormatSymbols sym(Locale::US, status);
|
DecimalFormatSymbols sym(Locale::getUS(), status);
|
||||||
failure(status, "Construct DecimalFormatSymbols");
|
failure(status, "Construct DecimalFormatSymbols");
|
||||||
DecimalFormat fmt("#", sym, status);
|
DecimalFormat fmt("#", sym, status);
|
||||||
failure(status, "Construct DecimalFormat");
|
failure(status, "Construct DecimalFormat");
|
||||||
@ -1987,7 +1987,7 @@ void NumberFormatRegressionTest::Test4179818(void) {
|
|||||||
*/
|
*/
|
||||||
void NumberFormatRegressionTest::Test4212072(void) {
|
void NumberFormatRegressionTest::Test4212072(void) {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
DecimalFormatSymbols sym(Locale::US, status);
|
DecimalFormatSymbols sym(Locale::getUS(), status);
|
||||||
/*
|
/*
|
||||||
failure(status, "DecimalFormatSymbols ct");
|
failure(status, "DecimalFormatSymbols ct");
|
||||||
DecimalFormat fmt(UnicodeString("#"), sym, status);
|
DecimalFormat fmt(UnicodeString("#"), sym, status);
|
||||||
@ -2152,7 +2152,7 @@ void NumberFormatRegressionTest::Test4212072(void) {
|
|||||||
*/
|
*/
|
||||||
void NumberFormatRegressionTest::Test4216742(void) {
|
void NumberFormatRegressionTest::Test4216742(void) {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
DecimalFormat *fmt = (DecimalFormat*) NumberFormat::createInstance(Locale::US, status);
|
DecimalFormat *fmt = (DecimalFormat*) NumberFormat::createInstance(Locale::getUS(), status);
|
||||||
failure(status, "createInstance");
|
failure(status, "createInstance");
|
||||||
int32_t DATA[] = { INT32_MIN, INT32_MAX, -100000000, 100000000 };
|
int32_t DATA[] = { INT32_MIN, INT32_MAX, -100000000, 100000000 };
|
||||||
int DATA_length = (int)(sizeof(DATA) / sizeof(DATA[0]));
|
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" };
|
const char* S[] = { "0", "1", "0.01", "1.01" };
|
||||||
int D_length = (int)(sizeof(D) / sizeof(D[0]));
|
int D_length = (int)(sizeof(D) / sizeof(D[0]));
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
NumberFormat *fmt = NumberFormat::createInstance(Locale::US, status);
|
NumberFormat *fmt = NumberFormat::createInstance(Locale::getUS(), status);
|
||||||
failure(status, "createInstance");
|
failure(status, "createInstance");
|
||||||
fmt->setMaximumFractionDigits(2);
|
fmt->setMaximumFractionDigits(2);
|
||||||
for (int i=0; i<D_length; i++) {
|
for (int i=0; i<D_length; i++) {
|
||||||
@ -2209,7 +2209,7 @@ void NumberFormatRegressionTest::Test4217661(void) {
|
|||||||
*/
|
*/
|
||||||
void NumberFormatRegressionTest::Test4161100(void) {
|
void NumberFormatRegressionTest::Test4161100(void) {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
NumberFormat *nf = NumberFormat::createInstance(Locale::US, status);
|
NumberFormat *nf = NumberFormat::createInstance(Locale::getUS(), status);
|
||||||
failure(status, "createInstance");
|
failure(status, "createInstance");
|
||||||
nf->setMinimumFractionDigits(1);
|
nf->setMinimumFractionDigits(1);
|
||||||
nf->setMaximumFractionDigits(1);
|
nf->setMaximumFractionDigits(1);
|
||||||
@ -2231,7 +2231,7 @@ void NumberFormatRegressionTest::Test4161100(void) {
|
|||||||
*/
|
*/
|
||||||
void NumberFormatRegressionTest::Test4243011(void) {
|
void NumberFormatRegressionTest::Test4243011(void) {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
DecimalFormatSymbols sym(Locale::US, status);
|
DecimalFormatSymbols sym(Locale::getUS(), status);
|
||||||
failure(status, "DecimalFormatSymbols ct");
|
failure(status, "DecimalFormatSymbols ct");
|
||||||
DecimalFormat fmt(UnicodeString("0."), sym, status);
|
DecimalFormat fmt(UnicodeString("0."), sym, status);
|
||||||
failure(status, "DecimalFormat ct");
|
failure(status, "DecimalFormat ct");
|
||||||
@ -2261,7 +2261,7 @@ void NumberFormatRegressionTest::Test4243011(void) {
|
|||||||
*/
|
*/
|
||||||
void NumberFormatRegressionTest::Test4243108(void) {
|
void NumberFormatRegressionTest::Test4243108(void) {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
DecimalFormatSymbols sym(Locale::US, status);
|
DecimalFormatSymbols sym(Locale::getUS(), status);
|
||||||
failure(status, "DecimalFormatSymbols ct");
|
failure(status, "DecimalFormatSymbols ct");
|
||||||
DecimalFormat fmt(UnicodeString("#.#"), sym, status);
|
DecimalFormat fmt(UnicodeString("#.#"), sym, status);
|
||||||
failure(status, "DecimalFormat ct");
|
failure(status, "DecimalFormat ct");
|
||||||
|
@ -67,7 +67,7 @@ void RBBIAPITest::TestCloneEquals()
|
|||||||
// source and dest iterator produce the same next() after assignment.
|
// source and dest iterator produce the same next() after assignment.
|
||||||
// deleting one doesn't disable the other.
|
// deleting one doesn't disable the other.
|
||||||
logln("Testing assignment");
|
logln("Testing assignment");
|
||||||
RuleBasedBreakIterator *bix = (RuleBasedBreakIterator *)BreakIterator::createLineInstance(Locale::ENGLISH, status);
|
RuleBasedBreakIterator *bix = (RuleBasedBreakIterator *)BreakIterator::createLineInstance(Locale::getEnglish(), status);
|
||||||
if(U_FAILURE(status)){
|
if(U_FAILURE(status)){
|
||||||
errln((UnicodeString)"FAIL : in construction");
|
errln((UnicodeString)"FAIL : in construction");
|
||||||
return;
|
return;
|
||||||
|
@ -17,7 +17,7 @@ CollationRegressionTest::CollationRegressionTest()
|
|||||||
{
|
{
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
|
|
||||||
en_us = (RuleBasedCollator *)Collator::createInstance(Locale::US, status);
|
en_us = (RuleBasedCollator *)Collator::createInstance(Locale::getUS(), status);
|
||||||
}
|
}
|
||||||
|
|
||||||
CollationRegressionTest::~CollationRegressionTest()
|
CollationRegressionTest::~CollationRegressionTest()
|
||||||
@ -790,7 +790,7 @@ void CollationRegressionTest::Test4124632(/* char* par */)
|
|||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
Collator *coll = NULL;
|
Collator *coll = NULL;
|
||||||
|
|
||||||
coll = Collator::createInstance(Locale::JAPAN, status);
|
coll = Collator::createInstance(Locale::getJapan(), status);
|
||||||
|
|
||||||
if (coll == NULL || U_FAILURE(status))
|
if (coll == NULL || U_FAILURE(status))
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@ void IntlTestSimpleDateFormatAPI::runIndexedTest( int32_t index, UBool exec, con
|
|||||||
if (exec) {
|
if (exec) {
|
||||||
logln("SimpleDateFormat API test---"); logln("");
|
logln("SimpleDateFormat API test---"); logln("");
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
Locale::setDefault(Locale::ENGLISH, status);
|
Locale::setDefault(Locale::getEnglish(), status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln("ERROR: Could not set default locale, test may not give correct results");
|
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;
|
status = U_ZERO_ERROR;
|
||||||
SimpleDateFormat pat_fr(pattern, Locale::FRENCH, status);
|
SimpleDateFormat pat_fr(pattern, Locale::getFrench(), status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln("ERROR: Could not create SimpleDateFormat (pattern French)");
|
errln("ERROR: Could not create SimpleDateFormat (pattern French)");
|
||||||
}
|
}
|
||||||
|
|
||||||
status = U_ZERO_ERROR;
|
status = U_ZERO_ERROR;
|
||||||
DateFormatSymbols *symbols = new DateFormatSymbols(Locale::FRENCH, status);
|
DateFormatSymbols *symbols = new DateFormatSymbols(Locale::getFrench(), status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln("ERROR: Could not create DateFormatSymbols (French)");
|
errln("ERROR: Could not create DateFormatSymbols (French)");
|
||||||
}
|
}
|
||||||
|
@ -51,9 +51,9 @@ StringSearchTest::StringSearchTest()
|
|||||||
m_es_ = new RuleBasedCollator(rules, status);
|
m_es_ = new RuleBasedCollator(rules, status);
|
||||||
|
|
||||||
m_en_wordbreaker_ = BreakIterator::createWordInstance(
|
m_en_wordbreaker_ = BreakIterator::createWordInstance(
|
||||||
Locale::ENGLISH, status);
|
Locale::getEnglish(), status);
|
||||||
m_en_characterbreaker_ = BreakIterator::createCharacterInstance(
|
m_en_characterbreaker_ = BreakIterator::createCharacterInstance(
|
||||||
Locale::ENGLISH, status);
|
Locale::getEnglish(), status);
|
||||||
}
|
}
|
||||||
|
|
||||||
StringSearchTest::~StringSearchTest()
|
StringSearchTest::~StringSearchTest()
|
||||||
@ -503,14 +503,14 @@ void StringSearchTest::TestOpenClose()
|
|||||||
delete result;
|
delete result;
|
||||||
|
|
||||||
status = U_ZERO_ERROR;
|
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) {
|
if (U_FAILURE(status) || result == NULL) {
|
||||||
errln("Error: NULL break iterator is valid for opening search");
|
errln("Error: NULL break iterator is valid for opening search");
|
||||||
}
|
}
|
||||||
delete result;
|
delete result;
|
||||||
|
|
||||||
status = U_ZERO_ERROR;
|
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)) {
|
if (U_FAILURE(status)) {
|
||||||
errln("Error: NULL break iterator is valid for opening search");
|
errln("Error: NULL break iterator is valid for opening search");
|
||||||
}
|
}
|
||||||
|
@ -629,14 +629,14 @@ void TestMessageFormat::testSetLocale()
|
|||||||
|
|
||||||
msg.setLocale(Locale::getEnglish());
|
msg.setLocale(Locale::getEnglish());
|
||||||
UBool getLocale_ok = TRUE;
|
UBool getLocale_ok = TRUE;
|
||||||
if (msg.getLocale() != Locale::ENGLISH) {
|
if (msg.getLocale() != Locale::getEnglish()) {
|
||||||
errln("*** MSG getLocal err.");
|
errln("*** MSG getLocal err.");
|
||||||
getLocale_ok = FALSE;
|
getLocale_ok = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.setLocale(Locale::getGerman());
|
msg.setLocale(Locale::getGerman());
|
||||||
|
|
||||||
if (msg.getLocale() != Locale::GERMAN) {
|
if (msg.getLocale() != Locale::getGerman()) {
|
||||||
errln("*** MSG getLocal err.");
|
errln("*** MSG getLocal err.");
|
||||||
getLocale_ok = FALSE;
|
getLocale_ok = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,7 @@ void TransliteratorAPITest::TestGetDisplayName() {
|
|||||||
message="Display name for ID:" + t->getID();
|
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!!!
|
// doTest(message, name, dispNames[i+1]); //!!! This will obviously fail for any locale other than english and its children!!!
|
||||||
name="";
|
name="";
|
||||||
t->getDisplayName(t->getID(), Locale::US, name);
|
t->getDisplayName(t->getID(), Locale::getUS(), name);
|
||||||
message.remove();
|
message.remove();
|
||||||
message.append("Display name for on english locale ID:");
|
message.append("Display name for on english locale ID:");
|
||||||
message.append(t->getID());
|
message.append(t->getID());
|
||||||
|
@ -3178,10 +3178,10 @@ void TransliteratorTest::TestSpecialCases(void) {
|
|||||||
Normalizer::normalize(source, UNORM_NFKC, 0, target, ec);
|
Normalizer::normalize(source, UNORM_NFKC, 0, target, ec);
|
||||||
} else if (0==id.caseCompare("Lower", U_FOLD_CASE_DEFAULT)) {
|
} else if (0==id.caseCompare("Lower", U_FOLD_CASE_DEFAULT)) {
|
||||||
target = source;
|
target = source;
|
||||||
target.toLower(Locale::US);
|
target.toLower(Locale::getUS());
|
||||||
} else if (0==id.caseCompare("Upper", U_FOLD_CASE_DEFAULT)) {
|
} else if (0==id.caseCompare("Upper", U_FOLD_CASE_DEFAULT)) {
|
||||||
target = source;
|
target = source;
|
||||||
target.toUpper(Locale::US);
|
target.toUpper(Locale::getUS());
|
||||||
}
|
}
|
||||||
if (U_FAILURE(ec)) {
|
if (U_FAILURE(ec)) {
|
||||||
errln((UnicodeString)"FAIL: Internal error normalizing " + source);
|
errln((UnicodeString)"FAIL: Internal error normalizing " + source);
|
||||||
|
@ -63,13 +63,13 @@ void IntlTestDateFormatSymbols::testSymbols(/* char *par */)
|
|||||||
{
|
{
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
|
|
||||||
DateFormatSymbols fr(Locale::FRENCH, status);
|
DateFormatSymbols fr(Locale::getFrench(), status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln("ERROR: Couldn't create French DateFormatSymbols");
|
errln("ERROR: Couldn't create French DateFormatSymbols");
|
||||||
}
|
}
|
||||||
|
|
||||||
status = U_ZERO_ERROR;
|
status = U_ZERO_ERROR;
|
||||||
DateFormatSymbols en(Locale::ENGLISH, status);
|
DateFormatSymbols en(Locale::getEnglish(), status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln("ERROR: Couldn't create English DateFormatSymbols");
|
errln("ERROR: Couldn't create English DateFormatSymbols");
|
||||||
}
|
}
|
||||||
|
@ -673,7 +673,7 @@ public:
|
|||||||
int32_t iteration;
|
int32_t iteration;
|
||||||
|
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
NumberFormat *formatter = NumberFormat::createInstance(Locale::ENGLISH,status);
|
NumberFormat *formatter = NumberFormat::createInstance(Locale::getEnglish(),status);
|
||||||
|
|
||||||
if(U_FAILURE(status))
|
if(U_FAILURE(status))
|
||||||
{
|
{
|
||||||
@ -681,7 +681,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NumberFormat *percentFormatter = NumberFormat::createPercentInstance(Locale::FRENCH,status);
|
NumberFormat *percentFormatter = NumberFormat::createPercentInstance(Locale::getFrench(),status);
|
||||||
|
|
||||||
if(U_FAILURE(status))
|
if(U_FAILURE(status))
|
||||||
{
|
{
|
||||||
|
@ -785,7 +785,7 @@ void
|
|||||||
TimeZoneRegressionTest::Test4162593()
|
TimeZoneRegressionTest::Test4162593()
|
||||||
{
|
{
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
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;
|
const int32_t ONE_HOUR = 60*60*1000;
|
||||||
|
|
||||||
SimpleTimeZone *asuncion = new SimpleTimeZone(-4*ONE_HOUR, "America/Asuncion" /*PY%sT*/,
|
SimpleTimeZone *asuncion = new SimpleTimeZone(-4*ONE_HOUR, "America/Asuncion" /*PY%sT*/,
|
||||||
|
@ -733,7 +733,7 @@ TimeZoneTest::TestDisplayName()
|
|||||||
int32_t i;
|
int32_t i;
|
||||||
TimeZone *zone = TimeZone::createTimeZone("PST");
|
TimeZone *zone = TimeZone::createTimeZone("PST");
|
||||||
UnicodeString name;
|
UnicodeString name;
|
||||||
zone->getDisplayName(Locale::ENGLISH, name);
|
zone->getDisplayName(Locale::getEnglish(), name);
|
||||||
logln("PST->" + name);
|
logln("PST->" + name);
|
||||||
if (name.compare("Pacific Standard Time") != 0)
|
if (name.compare("Pacific Standard Time") != 0)
|
||||||
errln("Fail: Expected \"Pacific Standard Time\" but got " + name);
|
errln("Fail: Expected \"Pacific Standard Time\" but got " + name);
|
||||||
@ -762,7 +762,7 @@ TimeZoneTest::TestDisplayName()
|
|||||||
name.remove();
|
name.remove();
|
||||||
name = zone->getDisplayName(kData[i].useDst,
|
name = zone->getDisplayName(kData[i].useDst,
|
||||||
kData[i].style,
|
kData[i].style,
|
||||||
Locale::ENGLISH, name);
|
Locale::getEnglish(), name);
|
||||||
if (name.compare(kData[i].expect) != 0)
|
if (name.compare(kData[i].expect) != 0)
|
||||||
errln("Fail: Expected " + UnicodeString(kData[i].expect) + "; got " + name);
|
errln("Fail: Expected " + UnicodeString(kData[i].expect) + "; got " + name);
|
||||||
logln("PST [with options]->" + name);
|
logln("PST [with options]->" + name);
|
||||||
@ -782,14 +782,14 @@ TimeZoneTest::TestDisplayName()
|
|||||||
errln("Some sort of error..." + UnicodeString(u_errorName(status))); // REVISIT
|
errln("Some sort of error..." + UnicodeString(u_errorName(status))); // REVISIT
|
||||||
}
|
}
|
||||||
name.remove();
|
name.remove();
|
||||||
name = zone2->getDisplayName(Locale::ENGLISH,name);
|
name = zone2->getDisplayName(Locale::getEnglish(),name);
|
||||||
logln("Modified PST->" + name);
|
logln("Modified PST->" + name);
|
||||||
if (name.compare("Pacific Standard Time") != 0)
|
if (name.compare("Pacific Standard Time") != 0)
|
||||||
errln("Fail: Expected \"Pacific Standard Time\"");
|
errln("Fail: Expected \"Pacific Standard Time\"");
|
||||||
|
|
||||||
// Make sure we get the default display format for Locales
|
// Make sure we get the default display format for Locales
|
||||||
// with no display name data.
|
// with no display name data.
|
||||||
Locale zh_CN = Locale::SIMPLIFIED_CHINESE;
|
Locale zh_CN = Locale::getSimplifiedChinese();
|
||||||
name.remove();
|
name.remove();
|
||||||
name = zone->getDisplayName(zh_CN,name);
|
name = zone->getDisplayName(zh_CN,name);
|
||||||
//*****************************************************************
|
//*****************************************************************
|
||||||
@ -803,7 +803,7 @@ TimeZoneTest::TestDisplayName()
|
|||||||
// Now be smart -- check to see if zh resource is even present.
|
// Now be smart -- check to see if zh resource is even present.
|
||||||
// If not, we expect the en fallback behavior.
|
// If not, we expect the en fallback behavior.
|
||||||
ResourceBundle enRB(u_getDataDirectory(),
|
ResourceBundle enRB(u_getDataDirectory(),
|
||||||
Locale::ENGLISH, status);
|
Locale::getEnglish(), status);
|
||||||
if(U_FAILURE(status))
|
if(U_FAILURE(status))
|
||||||
errln("Couldn't get ResourceBundle for en");
|
errln("Couldn't get ResourceBundle for en");
|
||||||
|
|
||||||
@ -835,7 +835,7 @@ TimeZoneTest::TestDisplayName()
|
|||||||
delete zone2;
|
delete zone2;
|
||||||
zone2 = new SimpleTimeZone(90*60*1000, "xyzzy");
|
zone2 = new SimpleTimeZone(90*60*1000, "xyzzy");
|
||||||
name.remove();
|
name.remove();
|
||||||
name = zone2->getDisplayName(Locale::ENGLISH,name);
|
name = zone2->getDisplayName(Locale::getEnglish(),name);
|
||||||
logln("GMT+90min->" + name);
|
logln("GMT+90min->" + name);
|
||||||
if (name.compare("GMT+01:30") &&
|
if (name.compare("GMT+01:30") &&
|
||||||
name.compare("GMT+1:30") &&
|
name.compare("GMT+1:30") &&
|
||||||
|
Loading…
Reference in New Issue
Block a user