ICU-1259 update tests for new 2.0 rules
X-SVN-Rev: 6454
This commit is contained in:
parent
3f29a7e290
commit
af1d778ab5
@ -27,20 +27,19 @@
|
||||
// runIndexedTest
|
||||
//---------------------------------------------
|
||||
|
||||
void CompoundTransliteratorTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par*/ )
|
||||
{
|
||||
if (exec) logln((UnicodeString)"TestSuite CompoundTransliterator API ");
|
||||
void
|
||||
CompoundTransliteratorTest::runIndexedTest(int32_t index, UBool exec,
|
||||
const char* &name, char* /*par*/) {
|
||||
switch (index) {
|
||||
|
||||
case 0: name = "TestConstruction"; if (exec) TestConstruction(); break;
|
||||
case 1: name = "TestCloneEqual"; if (exec) TestCloneEqual(); break;
|
||||
case 2: name = "TestGetCount"; if (exec) TestGetCount(); break;
|
||||
case 3: name = "TestGetSetAdoptTransliterator"; if (exec) TestGetSetAdoptTransliterator(); break;
|
||||
case 4: name = "TestTransliterate"; if (exec) TestTransliterate(); break;
|
||||
|
||||
default: name = ""; break; /*needed to end loop*/
|
||||
TESTCASE(0,TestConstruction);
|
||||
TESTCASE(1,TestCloneEqual);
|
||||
TESTCASE(2,TestGetCount);
|
||||
TESTCASE(3,TestGetSetAdoptTransliterator);
|
||||
TESTCASE(4,TestTransliterate);
|
||||
default: name = ""; break;
|
||||
}
|
||||
}
|
||||
|
||||
void CompoundTransliteratorTest::TestConstruction(){
|
||||
logln("Testing the construction of the compound Transliterator");
|
||||
UnicodeString names[]={"Greek-Latin", "Latin-Devanagari", "Devanagari-Latin", "Latin-Greek"};
|
||||
@ -258,7 +257,7 @@ void CompoundTransliteratorTest::TestGetSetAdoptTransliterator(){
|
||||
|
||||
ct1->setTransliterators(transarray, count);
|
||||
if(ct1->getCount() != count || ct1->getID() != ID2){
|
||||
errln((UnicodeString)"Error: setTransliterators) failed.\n\t Count:- expected->" + count + (UnicodeString)". got->" + ct1->getCount() +
|
||||
errln((UnicodeString)"Error: setTransliterators() failed.\n\t Count:- expected->" + count + (UnicodeString)". got->" + ct1->getCount() +
|
||||
(UnicodeString)"\n\tID :- expected->" + ID2 + (UnicodeString)". got->" + ct1->getID());
|
||||
}
|
||||
else{
|
||||
@ -277,14 +276,14 @@ void CompoundTransliteratorTest::TestGetSetAdoptTransliterator(){
|
||||
logln("OK: setTransliterator() passed");
|
||||
}*/
|
||||
logln("Testing adoptTransliterator() API of CompoundTransliterator");
|
||||
UnicodeString ID3("Latin-Kana");
|
||||
UnicodeString ID3("Latin-Katakana");
|
||||
Transliterator **transarray2=new Transliterator*[1];
|
||||
transarray2[0] = Transliterator::createInstance(ID3,UTRANS_FORWARD,parseError,status);
|
||||
if (transarray2[0] != 0) {
|
||||
ct1->adoptTransliterators(transarray2, 1);
|
||||
}
|
||||
if(ct1->getCount() != 1 || ct1->getID() != ID3){
|
||||
errln((UnicodeString)"Error: adoptTransliterators) failed.\n\t Count:- expected->1" + (UnicodeString)". got->" + ct1->getCount() +
|
||||
errln((UnicodeString)"Error: adoptTransliterators() failed.\n\t Count:- expected->1" + (UnicodeString)". got->" + ct1->getCount() +
|
||||
(UnicodeString)"\n\tID :- expected->" + ID3 + (UnicodeString)". got->" + ct1->getID());
|
||||
}
|
||||
else{
|
||||
@ -352,17 +351,17 @@ void CompoundTransliteratorTest::TestTransliterate(){
|
||||
"Any-Hex;Hex-Any;Any-Hex", "hello", UnicodeString("\\u0068\\u0065\\u006C\\u006C\\u006F", ""),
|
||||
"Any-Hex;Hex-Any", "hello! How are you?", "hello! How are you?",
|
||||
//"Devanagari-Latin;Latin-Devanagari", CharsToUnicodeString("\\u092D\\u0948'\\u0930'\\u0935"), CharsToUnicodeString("\\u092D\\u0948\\u0930\\u0935"), // quotes lost
|
||||
"Latin-Cyrillic;Cyrillic-Latin", "a'b'k'd'e'f'g'h'i'j'Shch'shch'zh'h", "abkdefghijShchshchzhh",
|
||||
"Latin-Cyrillic;Cyrillic-Latin", "a'b'k'd'e'f'g'h'i'j'Shch'shch'zh'h", "a'b'k'd'e'f'g'h'i'j'Shch'shch'zh'h", //"abkdefghijShchshchzhh",
|
||||
"Latin-Greek;Greek-Latin", "ABGabgAKLMN", "ABGabgAKLMN",
|
||||
"Latin-Arabic;Arabic-Latin", "Ad'r'a'b'i'k'dh'dd'gh", "Adrabikdhddgh",
|
||||
//"Latin-Arabic;Arabic-Latin", "Ad'r'a'b'i'k'dh'dd'gh", "Adrabikdhddgh",
|
||||
"Hiragana-Katakana", CharsToUnicodeString("\\u3041\\u308f\\u3099\\u306e\\u304b\\u3092\\u3099"),
|
||||
CharsToUnicodeString("\\u30A1\\u30f7\\u30ce\\u30ab\\u30fa"),
|
||||
"Hiragana-Katakana;Katakana-Hiragana", CharsToUnicodeString("\\u3041\\u308f\\u3099\\u306e\\u304b\\u3051"),
|
||||
CharsToUnicodeString("\\u3041\\u308f\\u3099\\u306e\\u304b\\u3051"),
|
||||
"Katakana-Hiragana;Hiragana-Katakana", CharsToUnicodeString("\\u30A1\\u30f7\\u30ce\\u30f5\\u30f6"),
|
||||
CharsToUnicodeString("\\u30A1\\u30f7\\u30ce\\u30ab\\u30b1"),
|
||||
"Latin-Kana;Kana-Latin", CharsToUnicodeString("VAVIVUVEVOhuZIZUZONYINYUNYAsesuzezu"),
|
||||
CharsToUnicodeString("VAVIVUVEVOhuZIZUZONYINYUNYAsesuzezu"),
|
||||
"Latin-Katakana;Katakana-Latin", CharsToUnicodeString("vavivuvevohuzizuzonyinyunyasesuzezu"),
|
||||
CharsToUnicodeString("vavivuvevohuzizuzonyinyunyasesuzezu"),
|
||||
};
|
||||
uint32_t i;
|
||||
for(i=0; i<sizeof(Data)/sizeof(Data[0]); i=i+3){
|
||||
|
@ -284,7 +284,7 @@ JamoTest::TestRealText() {
|
||||
// "XML, Java, ECMAScript(JavaScript), LDAP, CORBA 3.0, WML "
|
||||
"\\ub4f1\\uacfc",
|
||||
"\\uac19\\uc774", "\\ud604\\uc7ac", "\\ub110\\ub9ac", "\\uc0ac\\uc6a9\\ub418\\ub294",
|
||||
"\\ud45c\\uc900\\uc5d0\\uc11c", "\\ud544\\uc694\\ud558\\uba70", "\\uc774\\ub294", "ISO/IEC",
|
||||
"\\ud45c\\uc900\\uc5d0\\uc11c", "\\ud544\\uc694\\ud558\\uba70", "\\uc774\\ub294", // "ISO/IEC",
|
||||
"10646\\uc744", "\\uad6c\\ud604\\ud558\\ub294", "\\uacf5\\uc2dd\\uc801\\uc778",
|
||||
"\\ubc29\\ubc95\\uc785\\ub2c8\\ub2e4.", "\\uc774\\ub294", "\\ub9ce\\uc740", "\\uc6b4\\uc601",
|
||||
"\\uccb4\\uc81c,", "\\uc694\\uc998", "\\uc0ac\\uc6a9\\ub418\\ub294", "\\ubaa8\\ub4e0",
|
||||
|
@ -38,26 +38,25 @@ int32_t getInt(UnicodeString str)
|
||||
// runIndexedTest
|
||||
//---------------------------------------------
|
||||
|
||||
void TransliteratorAPITest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par*/ )
|
||||
{
|
||||
if (exec) logln((UnicodeString)"TestSuite Transliterator API ");
|
||||
void
|
||||
TransliteratorAPITest::runIndexedTest(int32_t index, UBool exec,
|
||||
const char* &name, char* /*par*/) {
|
||||
switch (index) {
|
||||
|
||||
case 0: name = "TestgetInverse"; if (exec) TestgetInverse(); break;
|
||||
case 1: name = "TestgetID"; if (exec) TestgetID(); break;
|
||||
case 2: name = "TestGetDisplayName"; if (exec) TestGetDisplayName(); break;
|
||||
case 3: name = "TestTransliterate1"; if (exec) TestTransliterate1(); break;
|
||||
case 4: name = "TestTransliterate2"; if (exec) TestTransliterate2(); break;
|
||||
case 5: name = "TestTransliterate3"; if (exec) TestTransliterate3(); break;
|
||||
case 6: name = "TestSimpleKeyboardTransliterator"; if (exec) TestSimpleKeyboardTransliterator(); break;
|
||||
case 7: name = "TestKeyboardTransliterator1"; if (exec) TestKeyboardTransliterator1(); break;
|
||||
case 8: name = "TestKeyboardTransliterator2"; if (exec) TestKeyboardTransliterator2(); break;
|
||||
case 9: name = "TestKeyboardTransliterator3"; if (exec) TestKeyboardTransliterator3(); break;
|
||||
case 10: name = "TestGetAdoptFilter"; if (exec) TestGetAdoptFilter(); break;
|
||||
case 11: name = "TestClone"; if (exec) TestClone(); break;
|
||||
case 12: name = "TestNullTransliterator"; if (exec) TestNullTransliterator(); break;
|
||||
case 13: name = "TestRegisterUnregister"; if(exec) TestRegisterUnregister(); break;
|
||||
default: name = ""; break; /*needed to end loop*/
|
||||
TESTCASE(0,TestgetInverse);
|
||||
TESTCASE(1,TestgetID);
|
||||
TESTCASE(2,TestGetDisplayName);
|
||||
TESTCASE(3,TestTransliterate1);
|
||||
TESTCASE(4,TestTransliterate2);
|
||||
TESTCASE(5,TestTransliterate3);
|
||||
TESTCASE(6,TestSimpleKeyboardTransliterator);
|
||||
TESTCASE(7,TestKeyboardTransliterator1);
|
||||
TESTCASE(8,TestKeyboardTransliterator2);
|
||||
TESTCASE(9,TestKeyboardTransliterator3);
|
||||
TESTCASE(10,TestGetAdoptFilter);
|
||||
TESTCASE(11,TestClone);
|
||||
TESTCASE(12,TestNullTransliterator);
|
||||
TESTCASE(13,TestRegisterUnregister);
|
||||
default: name = ""; break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +68,7 @@ void TransliteratorAPITest::TestgetID() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
Transliterator* t= Transliterator::createInstance(trans, UTRANS_FORWARD, parseError, status);
|
||||
if(t==0 || U_FAILURE(status)){
|
||||
errln("FAIL: construction");
|
||||
errln("FAIL: construction of Latin-Greek");
|
||||
return;
|
||||
}else{
|
||||
ID= t->getID();
|
||||
@ -95,7 +94,7 @@ void TransliteratorAPITest::TestgetID() {
|
||||
}
|
||||
|
||||
Transliterator* t1=Transliterator::createInstance("Latin-Devanagari", UTRANS_FORWARD, parseError, status);
|
||||
Transliterator* t2=Transliterator::createInstance("Latin-Hebrew", UTRANS_FORWARD, parseError, status);
|
||||
Transliterator* t2=Transliterator::createInstance("Latin-Greek", UTRANS_FORWARD, parseError, status);
|
||||
if(t1 ==0 || t2 == 0){
|
||||
errln("FAIL: construction");
|
||||
return;
|
||||
@ -126,8 +125,8 @@ void TransliteratorAPITest::TestgetID() {
|
||||
void TransliteratorAPITest::TestgetInverse() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UParseError parseError;
|
||||
Transliterator* t1 = Transliterator::createInstance("Kana-Latin", UTRANS_FORWARD, parseError, status);
|
||||
Transliterator* invt1 = Transliterator::createInstance("Latin-Kana", UTRANS_FORWARD, parseError, status);
|
||||
Transliterator* t1 = Transliterator::createInstance("Katakana-Latin", UTRANS_FORWARD, parseError, status);
|
||||
Transliterator* invt1 = Transliterator::createInstance("Latin-Katakana", UTRANS_FORWARD, parseError, status);
|
||||
Transliterator* t2 = Transliterator::createInstance("Latin-Devanagari", UTRANS_FORWARD, parseError, status);
|
||||
Transliterator* invt2 = Transliterator::createInstance("Devanagari-Latin", UTRANS_FORWARD, parseError, status);
|
||||
if(t1 == 0 || invt1 == 0 || t2 == 0 || invt2 == 0) {
|
||||
@ -146,12 +145,12 @@ void TransliteratorAPITest::TestgetInverse() {
|
||||
"Fullwidth-Halfwidth",
|
||||
"Greek-Latin" ,
|
||||
"Latin-Greek",
|
||||
"Arabic-Latin",
|
||||
"Latin-Arabic",
|
||||
"Kana-Latin",
|
||||
"Latin-Kana",
|
||||
"Hebrew-Latin",
|
||||
"Latin-Hebrew",
|
||||
//"Arabic-Latin", // removed in 2.0
|
||||
//"Latin-Arabic",
|
||||
"Katakana-Latin",
|
||||
"Latin-Katakana",
|
||||
//"Hebrew-Latin", // removed in 2.0
|
||||
//"Latin-Hebrew",
|
||||
"Cyrillic-Latin",
|
||||
"Latin-Cyrillic",
|
||||
"Devanagari-Latin",
|
||||
@ -185,7 +184,7 @@ void TransliteratorAPITest::TestClone(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UParseError parseError;
|
||||
t1=Transliterator::createInstance("Latin-Devanagari", UTRANS_FORWARD, parseError, status);
|
||||
t2=Transliterator::createInstance("Latin-Hebrew", UTRANS_FORWARD, parseError, status);
|
||||
t2=Transliterator::createInstance("Latin-Greek", UTRANS_FORWARD, parseError, status);
|
||||
if(t1 == 0 || t2 == 0){
|
||||
errln("FAIL: construction");
|
||||
return;
|
||||
@ -208,19 +207,19 @@ void TransliteratorAPITest::TestClone(){
|
||||
void TransliteratorAPITest::TestGetDisplayName() {
|
||||
UnicodeString dispNames[]= {
|
||||
//ID, displayName
|
||||
"CurlyQuotes-StraightQuotes" ,"CurlyQuotes to StraightQuotes",
|
||||
//"CurlyQuotes-StraightQuotes" ,"CurlyQuotes to StraightQuotes",
|
||||
"Any-Hex" ,"Any to Hex Escape",
|
||||
"Halfwidth-Fullwidth" ,"Halfwidth to Fullwidth" ,
|
||||
"Latin-Arabic" ,"Latin to Arabic" ,
|
||||
//"Latin-Arabic" ,"Latin to Arabic" ,
|
||||
"Latin-Devanagari" ,"Latin to Devanagari" ,
|
||||
"Greek-Latin" ,"Greek to Latin" ,
|
||||
"Arabic-Latin" ,"Arabic to Latin" ,
|
||||
//"Arabic-Latin" ,"Arabic to Latin" ,
|
||||
"Hex-Any" ,"Hex Escape to Any",
|
||||
"Cyrillic-Latin" ,"Cyrillic to Latin" ,
|
||||
"Latin-Greek" ,"Latin to Greek" ,
|
||||
"Latin-Kana" ,"Latin to Kana" ,
|
||||
"Latin-Hebrew" ,"Latin to Hebrew" ,
|
||||
"Kana-Latin" ,"Kana to Latin"
|
||||
"Latin-Katakana" ,"Latin to Katakana" ,
|
||||
//"Latin-Hebrew" ,"Latin to Hebrew" ,
|
||||
"Katakana-Latin" ,"Katakana to Latin"
|
||||
};
|
||||
UnicodeString name="";
|
||||
Transliterator* t;
|
||||
@ -264,8 +263,8 @@ void TransliteratorAPITest::TestTransliterate1(){
|
||||
"Devanagari-Latin", CharsToUnicodeString("\\u092D\\u093E\\u0930\\u0924"), UnicodeString("bh\\u0101rata"),
|
||||
// "Contracted-Expanded", CharsToUnicodeString("\\u00C0\\u00C1\\u0042"), CharsToUnicodeString("\\u0041\\u0300\\u0041\\u0301\\u0042") ,
|
||||
// "Expanded-Contracted", CharsToUnicodeString("\\u0041\\u0300\\u0041\\u0301\\u0042"), CharsToUnicodeString("\\u00C0\\u00C1\\u0042") ,
|
||||
"Latin-Arabic", "aap", CharsToUnicodeString("\\u0627\\u06A4") ,
|
||||
"Arabic-Latin", CharsToUnicodeString("\\u0627\\u06A4"), "aap"
|
||||
//"Latin-Arabic", "aap", CharsToUnicodeString("\\u0627\\u06A4") ,
|
||||
//"Arabic-Latin", CharsToUnicodeString("\\u0627\\u06A4"), "aap"
|
||||
};
|
||||
|
||||
UnicodeString gotResult;
|
||||
|
@ -30,10 +30,10 @@ TransliteratorRoundTripTest::runIndexedTest(int32_t index, UBool exec,
|
||||
switch (index) {
|
||||
CASE(0,TestHiragana);
|
||||
CASE(1,TestKatakana);
|
||||
CASE(2,TestArabic);
|
||||
CASE(3,TestHebrew);
|
||||
CASE(4,TestGreek);
|
||||
CASE(5,TestCyrillic);
|
||||
//CASE(2,TestArabic);
|
||||
//CASE(3,TestHebrew);
|
||||
CASE(2,TestGreek);
|
||||
CASE(3,TestCyrillic);
|
||||
/*
|
||||
CASE(7,TestJamo);
|
||||
CASE(8,TestJamoHangul);
|
||||
@ -333,27 +333,27 @@ UBool RTTest::isReceivingTarget(const UnicodeString& s) {
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
void TransliteratorRoundTripTest::TestHiragana() {
|
||||
RTTest test("Latin-Kana",
|
||||
RTTest test("Latin-Hiragana",
|
||||
TestUtility::LATIN_SCRIPT, TestUtility::HIRAGANA_SCRIPT);
|
||||
test.test("[a-z]", UnicodeString("[\\u3040-\\u3094]", ""), this);
|
||||
}
|
||||
|
||||
void TransliteratorRoundTripTest::TestKatakana() {
|
||||
RTTest test("Latin-Kana",
|
||||
RTTest test("Latin-Katakana",
|
||||
TestUtility::LATIN_SCRIPT, TestUtility::KATAKANA_SCRIPT);
|
||||
test.test("[A-Z]", UnicodeString("[\\u30A1-\\u30FA]", ""), this);
|
||||
test.test("[a-z]", UnicodeString("[\\u30A1-\\u30FA]", ""), this);
|
||||
}
|
||||
|
||||
void TransliteratorRoundTripTest::TestArabic() {
|
||||
RTTest test("Latin-Arabic",
|
||||
TestUtility::LATIN_SCRIPT, TestUtility::ARABIC_SCRIPT);
|
||||
test.test("[a-z]", UnicodeString("[\\u0620-\\u065F-[\\u0640]]", ""), this);
|
||||
void TransliteratorRoundTripTest::TestArabic() {
|
||||
// RTTest test("Latin-Arabic",
|
||||
// TestUtility::LATIN_SCRIPT, TestUtility::ARABIC_SCRIPT);
|
||||
// test.test("[a-z]", UnicodeString("[\\u0620-\\u065F-[\\u0640]]", ""), this);
|
||||
}
|
||||
|
||||
void TransliteratorRoundTripTest::TestHebrew() {
|
||||
RTTest test("Latin-Hebrew",
|
||||
TestUtility::LATIN_SCRIPT, TestUtility::HEBREW_SCRIPT);
|
||||
test.test("", UnicodeString("[\\u05D0-\\u05EF]", ""), this);
|
||||
// RTTest test("Latin-Hebrew",
|
||||
// TestUtility::LATIN_SCRIPT, TestUtility::HEBREW_SCRIPT);
|
||||
// test.test("", UnicodeString("[\\u05D0-\\u05EF]", ""), this);
|
||||
}
|
||||
|
||||
void TransliteratorRoundTripTest::TestJamo() {
|
||||
@ -364,7 +364,7 @@ void TransliteratorRoundTripTest::TestJamo() {
|
||||
}
|
||||
|
||||
void TransliteratorRoundTripTest::TestJamoHangul() {
|
||||
RTTest t("Latin-Jamo;Jamo-Hangul",
|
||||
RTTest t("Latin-Hangul",
|
||||
TestUtility::LATIN_SCRIPT, TestUtility::HANGUL_SCRIPT);
|
||||
t.setErrorLimit(50); // Don't run full test -- too long
|
||||
t.test("", "", this);
|
||||
|
@ -462,35 +462,36 @@ void TransliteratorTest::keyboardAux(const Transliterator& t,
|
||||
}
|
||||
|
||||
void TransliteratorTest::TestArabic(void) {
|
||||
/*
|
||||
const char* DATA[] = {
|
||||
"Arabic", "\u062a\u062a\u0645\u062a\u0639\u0020"+
|
||||
"\u0627\u0644\u0644\u063a\u0629\u0020"+
|
||||
"\u0627\u0644\u0639\u0631\u0628\u0628\u064a\u0629\u0020"+
|
||||
"\u0628\u0628\u0646\u0638\u0645\u0020"+
|
||||
"\u0643\u062a\u0627\u0628\u0628\u064a\u0629\u0020"+
|
||||
"\u062c\u0645\u064a\u0644\u0629",
|
||||
};
|
||||
*/
|
||||
|
||||
UChar ar_raw[] = {
|
||||
0x062a, 0x062a, 0x0645, 0x062a, 0x0639, 0x0020, 0x0627,
|
||||
0x0644, 0x0644, 0x063a, 0x0629, 0x0020, 0x0627, 0x0644,
|
||||
0x0639, 0x0631, 0x0628, 0x0628, 0x064a, 0x0629, 0x0020,
|
||||
0x0628, 0x0628, 0x0646, 0x0638, 0x0645, 0x0020, 0x0643,
|
||||
0x062a, 0x0627, 0x0628, 0x0628, 0x064a, 0x0629, 0x0020,
|
||||
0x062c, 0x0645, 0x064a, 0x0644, 0x0629, 0
|
||||
};
|
||||
UnicodeString ar(ar_raw);
|
||||
UErrorCode status=U_ZERO_ERROR;
|
||||
UParseError parseError;
|
||||
Transliterator *t = Transliterator::createInstance("Latin-Arabic", UTRANS_FORWARD, parseError, status);
|
||||
if (t == 0) {
|
||||
errln("FAIL: createInstance failed");
|
||||
return;
|
||||
}
|
||||
expect(*t, "Arabic", ar);
|
||||
delete t;
|
||||
// Test disabled for 2.0 until new Arabic transliterator can be written.
|
||||
// /*
|
||||
// const char* DATA[] = {
|
||||
// "Arabic", "\u062a\u062a\u0645\u062a\u0639\u0020"+
|
||||
// "\u0627\u0644\u0644\u063a\u0629\u0020"+
|
||||
// "\u0627\u0644\u0639\u0631\u0628\u0628\u064a\u0629\u0020"+
|
||||
// "\u0628\u0628\u0646\u0638\u0645\u0020"+
|
||||
// "\u0643\u062a\u0627\u0628\u0628\u064a\u0629\u0020"+
|
||||
// "\u062c\u0645\u064a\u0644\u0629",
|
||||
// };
|
||||
// */
|
||||
//
|
||||
// UChar ar_raw[] = {
|
||||
// 0x062a, 0x062a, 0x0645, 0x062a, 0x0639, 0x0020, 0x0627,
|
||||
// 0x0644, 0x0644, 0x063a, 0x0629, 0x0020, 0x0627, 0x0644,
|
||||
// 0x0639, 0x0631, 0x0628, 0x0628, 0x064a, 0x0629, 0x0020,
|
||||
// 0x0628, 0x0628, 0x0646, 0x0638, 0x0645, 0x0020, 0x0643,
|
||||
// 0x062a, 0x0627, 0x0628, 0x0628, 0x064a, 0x0629, 0x0020,
|
||||
// 0x062c, 0x0645, 0x064a, 0x0644, 0x0629, 0
|
||||
// };
|
||||
// UnicodeString ar(ar_raw);
|
||||
// UErrorCode status=U_ZERO_ERROR;
|
||||
// UParseError parseError;
|
||||
// Transliterator *t = Transliterator::createInstance("Latin-Arabic", UTRANS_FORWARD, parseError, status);
|
||||
// if (t == 0) {
|
||||
// errln("FAIL: createInstance failed");
|
||||
// return;
|
||||
// }
|
||||
// expect(*t, "Arabic", ar);
|
||||
// delete t;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -500,9 +501,9 @@ void TransliteratorTest::TestArabic(void) {
|
||||
void TransliteratorTest::TestCompoundKana(void) {
|
||||
UParseError parseError;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
Transliterator* t = Transliterator::createInstance("Latin-Kana;Kana-Latin", UTRANS_FORWARD, parseError, status);
|
||||
Transliterator* t = Transliterator::createInstance("Latin-Hiragana;Hiragana-Latin", UTRANS_FORWARD, parseError, status);
|
||||
if (t == 0) {
|
||||
errln("FAIL: construction of Latin-Kana;Kana-Latin failed");
|
||||
errln("FAIL: construction of Latin-Hiragana;Hiragana-Latin failed");
|
||||
} else {
|
||||
expect(*t, "aaaaa", "aaaaa");
|
||||
delete t;
|
||||
@ -1150,10 +1151,10 @@ void TransliteratorTest::TestLiberalizedID(void) {
|
||||
// getID() return canonical case yet. It will all get rewritten
|
||||
// with the move to Source-Target/Variant IDs anyway. [aliu]
|
||||
const char* DATA[] = {
|
||||
"latin-arabic", NULL /*"Latin-Arabic"*/, "case insensitivity",
|
||||
"latin-greek", NULL /*"Latin-Greek"*/, "case insensitivity",
|
||||
" Null ", "Null", "whitespace",
|
||||
" Latin[a-z]-Arabic ", "Latin[a-z]-Arabic", "inline filter",
|
||||
" null ; latin-arabic ", NULL /*"Null;Latin-Arabic"*/, "compound whitespace",
|
||||
" Latin[a-z]-Greek ", "Latin[a-z]-Greek", "inline filter",
|
||||
" null ; latin-greek ", NULL /*"Null;Latin-Greek"*/, "compound whitespace",
|
||||
};
|
||||
const int32_t DATA_length = sizeof(DATA)/sizeof(DATA[0]);
|
||||
UParseError parseError;
|
||||
@ -1433,7 +1434,7 @@ void TransliteratorTest::TestCompoundFilter(void) {
|
||||
UParseError parseError;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
Transliterator *t = Transliterator::createInstance
|
||||
("Greek-Latin; Latin-Cyrillic; Lower", UTRANS_FORWARD, parseError, status);
|
||||
("Greek-Latin; Latin-Greek; Lower", UTRANS_FORWARD, parseError, status);
|
||||
if (t == 0) {
|
||||
errln("FAIL: createInstance failed");
|
||||
return;
|
||||
@ -1447,8 +1448,8 @@ void TransliteratorTest::TestCompoundFilter(void) {
|
||||
|
||||
// Only the 'A' at index 1 should remain unchanged
|
||||
expect(*t,
|
||||
CharsToUnicodeString("CA\\u039A\\u0391"),
|
||||
CharsToUnicodeString("\\u043AA\\u043A\\u0430"));
|
||||
CharsToUnicodeString("BA\\u039A\\u0391"),
|
||||
CharsToUnicodeString("\\u03b2A\\u03ba\\u03b1"));
|
||||
delete t;
|
||||
}
|
||||
|
||||
@ -2260,7 +2261,7 @@ void TransliteratorTest::TestDevanagariLatinRT(){
|
||||
"\\u0922\\u094D\\u092F", /* d\\u0323hya */
|
||||
// "hma", /* hma */
|
||||
"\\u0939\\u094D\\u092F", /* hya */
|
||||
"\\u0936\\u0943\\u0905", /* s\\u0301r\\u0325a */
|
||||
"\\u0936\\u0943", /* s\\u0301r\\u0325a */
|
||||
"\\u0936\\u094D\\u091A", /* s\\u0301ca */
|
||||
"\\u090d", /* e\\u0306 */
|
||||
"\\u0938\\u0902\\u091C\\u0940\\u092C\\u094D \\u0938\\u0947\\u0928\\u0917\\u0941\\u092A\\u094D\\u0924",
|
||||
@ -2347,13 +2348,13 @@ void TransliteratorTest::TestSanskritLatinRT(){
|
||||
"vi\\u1E63\\u0101da",
|
||||
"y\\u014Dga",
|
||||
"dhr\\u0325tar\\u0101\\u1E63\\u1E6Dra",
|
||||
"uv\\u0101cr\\u0325",
|
||||
"uv\\u0101cr\\u0325a",
|
||||
"dharmak\\u1E63\\u0113tr\\u0113",
|
||||
"kuruk\\u1E63\\u0113tr\\u0113",
|
||||
"samav\\u0113t\\u0101",
|
||||
"yuyutsava-\\u1E25",
|
||||
"m\\u0101mak\\u0101-\\u1E25",
|
||||
// "p\\u0101\\u1E47\\u1E0Dav\\u0101\\u015Bcaiva",
|
||||
// "p\\u0101\\u1E47\\u1E0Dav\\u0101\\u015Bcaiva",
|
||||
"kimakurvata",
|
||||
"san\\u0304java",
|
||||
};
|
||||
@ -2372,7 +2373,7 @@ void TransliteratorTest::TestSanskritLatinRT(){
|
||||
"\\u0938\\u092e\\u0935\\u0947\\u0924\\u093e",
|
||||
"\\u092f\\u0941\\u092f\\u0941\\u0924\\u094d\\u0938\\u0935\\u0903",
|
||||
"\\u092e\\u093e\\u092e\\u0915\\u093e\\u0903",
|
||||
//"\\u092a\\u093e\\u0923\\u094d\\u0921\\u0935\\u093e\\u0936\\u094d\\u091a\\u0948\\u0935",
|
||||
//"\\u092a\\u093e\\u0923\\u094d\\u0921\\u0935\\u093e\\u0936\\u094d\\u091a\\u0948\\u0935",
|
||||
"\\u0915\\u093f\\u092e\\u0915\\u0941\\u0930\\u094d\\u0935\\u0924",
|
||||
"\\u0938\\u0902\\u091c\\u0935",
|
||||
};
|
||||
@ -2407,7 +2408,7 @@ void TransliteratorTest::TestCompoundLatinRT(){
|
||||
"vi\\u1E63\\u0101da",
|
||||
"y\\u014Dga",
|
||||
"dhr\\u0325tar\\u0101\\u1E63\\u1E6Dra",
|
||||
"uv\\u0101cr\\u0325",
|
||||
"uv\\u0101cr\\u0325a",
|
||||
"dharmak\\u1E63\\u0113tr\\u0113",
|
||||
"kuruk\\u1E63\\u0113tr\\u0113",
|
||||
"samav\\u0113t\\u0101",
|
||||
|
@ -104,21 +104,30 @@ UnicodeSetTest::TestCategories(void) {
|
||||
void
|
||||
UnicodeSetTest::TestCloneEqualHash(void) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
//int8_t category=Unicode::LOWERCASE_LETTER;
|
||||
//UnicodeSet *set1=new UnicodeSet(category, status); // :Li: Letter, lowercase
|
||||
UnicodeSet *set1=new UnicodeSet("[:Ll:]", status); // Letter, lowercase
|
||||
int8_t category=Unicode::LOWERCASE_LETTER;
|
||||
UnicodeSet *set1=new UnicodeSet(category, status); // :Ll: Letter, lowercase
|
||||
UnicodeSet *set1a=new UnicodeSet("[:Ll:]", status); // Letter, lowercase
|
||||
if (U_FAILURE(status)){
|
||||
errln((UnicodeString)"FAIL: Can't construst set with category->Ll");
|
||||
return;
|
||||
}
|
||||
//category=Unicode::DECIMAL_DIGIT_NUMBER;
|
||||
//UnicodeSet *set2=new UnicodeSet(category, status); //Number, Decimal digit
|
||||
UnicodeSet *set2=new UnicodeSet("[:Nd:]", status); //Number, Decimal digit
|
||||
category=Unicode::DECIMAL_DIGIT_NUMBER;
|
||||
UnicodeSet *set2=new UnicodeSet(category, status); //Number, Decimal digit
|
||||
UnicodeSet *set2a=new UnicodeSet("[:Nd:]", status); //Number, Decimal digit
|
||||
if (U_FAILURE(status)){
|
||||
errln((UnicodeString)"FAIL: Can't construct set with category->Nd");
|
||||
return;
|
||||
}
|
||||
|
||||
if (*set1 != *set1a) {
|
||||
errln("FAIL: category constructor for Ll broken");
|
||||
}
|
||||
if (*set2 != *set2a) {
|
||||
errln("FAIL: category constructor for Nd broken");
|
||||
}
|
||||
delete set1a;
|
||||
delete set2a;
|
||||
|
||||
logln("Testing copy construction");
|
||||
UnicodeSet *set1copy=new UnicodeSet(*set1);
|
||||
if(*set1 != *set1copy || *set1 == *set2 ||
|
||||
|
Loading…
Reference in New Issue
Block a user