ICU-899 Fix tests after changes to API.
X-SVN-Rev: 5733
This commit is contained in:
parent
959f6956c7
commit
fc6c9d778f
@ -615,7 +615,7 @@ static void TestUnicodeData()
|
||||
}
|
||||
#endif
|
||||
|
||||
if (u_charScript((UChar)0x0041 != U_BASIC_LATIN_BLOCK)) {
|
||||
if (ublock_getCode((UChar)0x0041 != UBLOCK_BASIC_LATIN)) {
|
||||
log_err("Unicode character script property failed !\n");
|
||||
}
|
||||
|
||||
@ -1807,33 +1807,33 @@ static void TestUScriptCodeAPI(){
|
||||
};
|
||||
UScriptCode expected[] ={
|
||||
/* locales should return */
|
||||
U_LATIN, U_LATIN, U_CYRILLIC, U_TAMIL, U_TELUGU,
|
||||
U_DEVANAGARI, U_HEBREW, U_ARABIC,
|
||||
USCRIPT_LATIN, USCRIPT_LATIN, USCRIPT_CYRILLIC, USCRIPT_TAMIL, USCRIPT_TELUGU,
|
||||
USCRIPT_DEVANAGARI, USCRIPT_HEBREW, USCRIPT_ARABIC,
|
||||
/* abbr should return */
|
||||
U_HAN, U_HANGUL, U_HEBREW, U_HIRAGANA,
|
||||
U_KANNADA, U_KATAKANA, U_KHMER, U_LAO,
|
||||
U_LATIN,/* U_LATIN, U_LATIN,*/
|
||||
U_MALAYALAM, U_MONGOLIAN,
|
||||
USCRIPT_HAN, USCRIPT_HANGUL, USCRIPT_HEBREW, USCRIPT_HIRAGANA,
|
||||
USCRIPT_KANNADA, USCRIPT_KATAKANA, USCRIPT_KHMER, USCRIPT_LAO,
|
||||
USCRIPT_LATIN,/* USCRIPT_LATIN, USCRIPT_LATIN,*/
|
||||
USCRIPT_MALAYALAM, USCRIPT_MONGOLIAN,
|
||||
/* names should return */
|
||||
U_CYRILLIC, U_DESERET, U_DEVANAGARI, U_ETHIOPIC, U_GEORGIAN,
|
||||
U_GOTHIC, U_GREEK, U_GUJARATI,
|
||||
USCRIPT_CYRILLIC, USCRIPT_DESERET, USCRIPT_DEVANAGARI, USCRIPT_ETHIOPIC, USCRIPT_GEORGIAN,
|
||||
USCRIPT_GOTHIC, USCRIPT_GREEK, USCRIPT_GUJARATI,
|
||||
/* lower case names should return */
|
||||
U_MALAYALAM, U_MONGOLIAN, U_MYANMAR, U_OGHAM, U_OLD_ITALIC,
|
||||
U_ORIYA, U_RUNIC, U_SINHALA, U_SYRIAC, U_TAMIL,
|
||||
U_TELUGU, U_THAANA, U_THAI, U_TIBETAN,
|
||||
USCRIPT_MALAYALAM, USCRIPT_MONGOLIAN, USCRIPT_MYANMAR, USCRIPT_OGHAM, USCRIPT_OLD_ITALIC,
|
||||
USCRIPT_ORIYA, USCRIPT_RUNIC, USCRIPT_SINHALA, USCRIPT_SYRIAC, USCRIPT_TAMIL,
|
||||
USCRIPT_TELUGU, USCRIPT_THAANA, USCRIPT_THAI, USCRIPT_TIBETAN,
|
||||
/* bounds */
|
||||
U_UCAS, U_ARABIC,
|
||||
USCRIPT_UCAS, USCRIPT_ARABIC,
|
||||
/* bogus names should return invalid code */
|
||||
U_INVALID_SCRIPT_CODE, U_INVALID_SCRIPT_CODE, U_INVALID_SCRIPT_CODE,
|
||||
USCRIPT_INVALID_CODE, USCRIPT_INVALID_CODE, USCRIPT_INVALID_CODE,
|
||||
};
|
||||
int i =0;
|
||||
int numErrors =0;
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
for( ; testNames[i]!='\0'; i++){
|
||||
UScriptCode code = uchar_getScriptCode(testNames[i],&err);
|
||||
UScriptCode code = uscript_getCode(testNames[i],&err);
|
||||
if( code != expected[i]){
|
||||
log_verbose("Error getting script code Got: %s Expected: %s for name %s\n",
|
||||
uchar_scriptCodeName(code),uchar_scriptCodeName(expected[i]),testNames[i]);
|
||||
log_verbose("Error getting script code Got: %i Expected: %i for name %s\n",
|
||||
code,expected[i],testNames[i]);
|
||||
numErrors++;
|
||||
}
|
||||
}
|
||||
@ -1843,8 +1843,8 @@ static void TestUScriptCodeAPI(){
|
||||
{
|
||||
UScriptCode testAbbr[]={
|
||||
/* names should return */
|
||||
U_CYRILLIC, U_DESERET, U_DEVANAGARI, U_ETHIOPIC, U_GEORGIAN,
|
||||
U_GOTHIC, U_GREEK, U_GUJARATI,
|
||||
USCRIPT_CYRILLIC, USCRIPT_DESERET, USCRIPT_DEVANAGARI, USCRIPT_ETHIOPIC, USCRIPT_GEORGIAN,
|
||||
USCRIPT_GOTHIC, USCRIPT_GREEK, USCRIPT_GUJARATI,
|
||||
};
|
||||
|
||||
const char* expectedNames[]={
|
||||
@ -1856,7 +1856,7 @@ static void TestUScriptCodeAPI(){
|
||||
};
|
||||
i=0;
|
||||
while(i<sizeof(testAbbr)/sizeof(UScriptCode)){
|
||||
const char* name = uchar_getScriptName(testAbbr[i]);
|
||||
const char* name = uscript_getName(testAbbr[i]);
|
||||
numErrors=0;
|
||||
if(strcmp(expectedNames[i],name)!=0){
|
||||
log_verbose("Error getting abbreviations Got: %s Expected: %s\n",name,expectedNames[i]);
|
||||
@ -1874,10 +1874,10 @@ static void TestUScriptCodeAPI(){
|
||||
{
|
||||
UScriptCode testAbbr[]={
|
||||
/* abbr should return */
|
||||
U_HAN, U_HANGUL, U_HEBREW, U_HIRAGANA,
|
||||
U_KANNADA, U_KATAKANA, U_KHMER, U_LAO,
|
||||
U_LATIN,
|
||||
U_MALAYALAM, U_MONGOLIAN,
|
||||
USCRIPT_HAN, USCRIPT_HANGUL, USCRIPT_HEBREW, USCRIPT_HIRAGANA,
|
||||
USCRIPT_KANNADA, USCRIPT_KATAKANA, USCRIPT_KHMER, USCRIPT_LAO,
|
||||
USCRIPT_LATIN,
|
||||
USCRIPT_MALAYALAM, USCRIPT_MONGOLIAN,
|
||||
};
|
||||
|
||||
const char* expectedAbbr[]={
|
||||
@ -1890,7 +1890,7 @@ static void TestUScriptCodeAPI(){
|
||||
};
|
||||
i=0;
|
||||
while(i<sizeof(testAbbr)/sizeof(UScriptCode)){
|
||||
const char* name = uchar_getScriptAbbr(testAbbr[i]);
|
||||
const char* name = uscript_getShortName(testAbbr[i]);
|
||||
numErrors=0;
|
||||
if(strcmp(expectedAbbr[i],name)!=0){
|
||||
log_verbose("Error getting abbreviations Got: %s Expected: %s\n",name,expectedAbbr[i]);
|
||||
@ -1907,6 +1907,3 @@ static void TestUScriptCodeAPI(){
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user