ICU-7649 Rearrange util tests in intltest and add check for 'th' in locale test to resolve environment test errors.

X-SVN-Rev: 28340
This commit is contained in:
Michael Ow 2010-07-21 17:41:28 +00:00
parent 5aaa8be80e
commit e5863f33c9
2 changed files with 24 additions and 19 deletions

View File

@ -44,9 +44,23 @@ void IntlTestUtilities::runIndexedTest( int32_t index, UBool exec, const char* &
{ {
if (exec) logln("TestSuite Utilities: "); if (exec) logln("TestSuite Utilities: ");
switch (index) { switch (index) {
CASE(0, UObjectTest); CASE(0, MultithreadTest);
CASE(1, ErrorCodeTest); CASE(1, StringTest);
case 2: CASE(2, UnicodeStringTest);
CASE(3, LocaleTest);
CASE(4, CharIterTest);
CASE(5, UObjectTest);
CASE(6, UnicodeTest);
CASE(7, ResourceBundleTest);
CASE(8, NewResourceBundleTest);
CASE(9, PUtilTest);
CASE(10, UVector32Test);
CASE(11, UVectorTest);
CASE(12, UTextTest);
CASE(13, LocaleAliasTest);
CASE(14, UnicodeSetTest);
CASE(15, ErrorCodeTest);
case 16:
name = "LocalPointerTest"; name = "LocalPointerTest";
if (exec) { if (exec) {
logln("TestSuite LocalPointerTest---"); logln(); logln("TestSuite LocalPointerTest---"); logln();
@ -54,20 +68,6 @@ void IntlTestUtilities::runIndexedTest( int32_t index, UBool exec, const char* &
callTest(*test, par); callTest(*test, par);
} }
break; break;
CASE(3, StringTest);
CASE(4, UnicodeStringTest);
CASE(5, CharIterTest);
CASE(6, UTextTest);
CASE(7, UnicodeSetTest);
CASE(8, UnicodeTest);
CASE(9, UVector32Test);
CASE(10, UVectorTest);
CASE(11, PUtilTest);
CASE(12, LocaleTest);
CASE(13, ResourceBundleTest);
CASE(14, NewResourceBundleTest);
CASE(15, LocaleAliasTest);
CASE(16, MultithreadTest);
default: name = ""; break; //needed to end loop default: name = ""; break; //needed to end loop
} }
} }

View File

@ -1320,8 +1320,13 @@ LocaleTest::Test4139940()
UChar ocf = 0x00f4; UChar ocf = 0x00f4;
UChar oda = 0x0151; UChar oda = 0x0151;
if (str.indexOf(oda) < 0 || str.indexOf(ocf) >= 0) { if (str.indexOf(oda) < 0 || str.indexOf(ocf) >= 0) {
/* If the default locale is "th" this test will fail because of the buddhist calendar. */
if (strcmp(Locale::getDefault().getLanguage(), "th") != 0) {
errln("Fail: Monday in Hungarian is wrong - oda's index is %d and ocf's is %d", errln("Fail: Monday in Hungarian is wrong - oda's index is %d and ocf's is %d",
str.indexOf(oda), str.indexOf(ocf)); str.indexOf(oda), str.indexOf(ocf));
} else {
logln(UnicodeString("An error is produce in buddhist calendar."));
}
logln(UnicodeString("String is: ") + str ); logln(UnicodeString("String is: ") + str );
} }
} }