| OLD | NEW |
| 1 /* | 1 /* |
| 2 ********************************************************************** | 2 ********************************************************************** |
| 3 * Copyright (C) 1999-2013, International Business Machines | 3 * Copyright (C) 1999-2014, International Business Machines |
| 4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
| 5 ********************************************************************** | 5 ********************************************************************** |
| 6 * Date Name Description | 6 * Date Name Description |
| 7 * 11/10/99 aliu Creation. | 7 * 11/10/99 aliu Creation. |
| 8 ********************************************************************** | 8 ********************************************************************** |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "unicode/utypes.h" | 11 #include "unicode/utypes.h" |
| 12 | 12 |
| 13 #if !UCONFIG_NO_TRANSLITERATION | 13 #if !UCONFIG_NO_TRANSLITERATION |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 TESTCASE(79,TestBeginEndToRules); | 191 TESTCASE(79,TestBeginEndToRules); |
| 192 TESTCASE(80,TestRegisterAlias); | 192 TESTCASE(80,TestRegisterAlias); |
| 193 TESTCASE(81,TestRuleStripping); | 193 TESTCASE(81,TestRuleStripping); |
| 194 TESTCASE(82,TestHalfwidthFullwidth); | 194 TESTCASE(82,TestHalfwidthFullwidth); |
| 195 TESTCASE(83,TestThai); | 195 TESTCASE(83,TestThai); |
| 196 TESTCASE(84,TestAny); | 196 TESTCASE(84,TestAny); |
| 197 default: name = ""; break; | 197 default: name = ""; break; |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 | 200 |
| 201 static const UVersionInfo ICU_39 = {3,9,4,0}; | |
| 202 /** | 201 /** |
| 203 * Make sure every system transliterator can be instantiated. | 202 * Make sure every system transliterator can be instantiated. |
| 204 * | 203 * |
| 205 * ALSO test that the result of toRules() for each rule is a valid | 204 * ALSO test that the result of toRules() for each rule is a valid |
| 206 * rule. Do this here so we don't have to have another test that | 205 * rule. Do this here so we don't have to have another test that |
| 207 * instantiates everything as well. | 206 * instantiates everything as well. |
| 208 */ | 207 */ |
| 209 void TransliteratorTest::TestInstantiation() { | 208 void TransliteratorTest::TestInstantiation() { |
| 210 UErrorCode ec = U_ZERO_ERROR; | 209 UErrorCode ec = U_ZERO_ERROR; |
| 211 StringEnumeration* avail = Transliterator::getAvailableIDs(ec); | 210 StringEnumeration* avail = Transliterator::getAvailableIDs(ec); |
| (...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 UnicodeString expc = CharsToUnicodeString(CANON[i+2]); | 1470 UnicodeString expc = CharsToUnicodeString(CANON[i+2]); |
| 1472 expect(*NFD, in, expd); | 1471 expect(*NFD, in, expd); |
| 1473 expect(*NFC, in, expc); | 1472 expect(*NFC, in, expc); |
| 1474 } | 1473 } |
| 1475 delete NFD; | 1474 delete NFD; |
| 1476 delete NFC; | 1475 delete NFC; |
| 1477 | 1476 |
| 1478 Transliterator* NFKD = Transliterator::createInstance("NFKD", UTRANS_FORWARD
, parseError, status); | 1477 Transliterator* NFKD = Transliterator::createInstance("NFKD", UTRANS_FORWARD
, parseError, status); |
| 1479 Transliterator* NFKC = Transliterator::createInstance("NFKC", UTRANS_FORWARD
, parseError, status); | 1478 Transliterator* NFKC = Transliterator::createInstance("NFKC", UTRANS_FORWARD
, parseError, status); |
| 1480 if (!NFKD || !NFKC) { | 1479 if (!NFKD || !NFKC) { |
| 1481 errln("FAIL: createInstance failed"); | 1480 dataerrln("FAIL: createInstance failed"); |
| 1482 delete NFKD; | 1481 delete NFKD; |
| 1483 delete NFKC; | 1482 delete NFKC; |
| 1484 return; | 1483 return; |
| 1485 } | 1484 } |
| 1486 for (i=0; COMPAT[i]; i+=3) { | 1485 for (i=0; COMPAT[i]; i+=3) { |
| 1487 UnicodeString in = CharsToUnicodeString(COMPAT[i]); | 1486 UnicodeString in = CharsToUnicodeString(COMPAT[i]); |
| 1488 UnicodeString expkd = CharsToUnicodeString(COMPAT[i+1]); | 1487 UnicodeString expkd = CharsToUnicodeString(COMPAT[i+1]); |
| 1489 UnicodeString expkc = CharsToUnicodeString(COMPAT[i+2]); | 1488 UnicodeString expkc = CharsToUnicodeString(COMPAT[i+2]); |
| 1490 expect(*NFKD, in, expkd); | 1489 expect(*NFKD, in, expkd); |
| 1491 expect(*NFKC, in, expkc); | 1490 expect(*NFKC, in, expkc); |
| (...skipping 2784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4276 "", // test case commented out below, this is here to keep from messing up t
he indexes | 4275 "", // test case commented out below, this is here to keep from messing up t
he indexes |
| 4277 | 4276 |
| 4278 // [17] | 4277 // [17] |
| 4279 "::[abc];" | 4278 "::[abc];" |
| 4280 "abc <> xy;" | 4279 "abc <> xy;" |
| 4281 "::Null;" | 4280 "::Null;" |
| 4282 "aba <> yz;" | 4281 "aba <> yz;" |
| 4283 "::Upper(Lower);" | 4282 "::Upper(Lower);" |
| 4284 "::([XYZ]);" | 4283 "::([XYZ]);" |
| 4285 }; | 4284 }; |
| 4286 static const int32_t BEGIN_END_RULES_length = (int32_t)(sizeof(BEGIN_END_RULES)
/ sizeof(BEGIN_END_RULES[0])); | |
| 4287 | 4285 |
| 4288 /* | 4286 /* |
| 4289 (This entire test is commented out below and will need some heavy revision when
we re-add | 4287 (This entire test is commented out below and will need some heavy revision when
we re-add |
| 4290 the ::BEGIN/::END stuff) | 4288 the ::BEGIN/::END stuff) |
| 4291 static const char* BOGUS_BEGIN_END_RULES[] = { | 4289 static const char* BOGUS_BEGIN_END_RULES[] = { |
| 4292 // [7] | 4290 // [7] |
| 4293 "::BEGIN;" | 4291 "::BEGIN;" |
| 4294 "abc > xy;" | 4292 "abc > xy;" |
| 4295 "::BEGIN;" | 4293 "::BEGIN;" |
| 4296 "aba > z;" | 4294 "aba > z;" |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4836 if (pass) { | 4834 if (pass) { |
| 4837 logln(UnicodeString("(")+tag+") " + prettify(summary)); | 4835 logln(UnicodeString("(")+tag+") " + prettify(summary)); |
| 4838 } else { | 4836 } else { |
| 4839 dataerrln(UnicodeString("FAIL: (")+tag+") " | 4837 dataerrln(UnicodeString("FAIL: (")+tag+") " |
| 4840 + prettify(summary) | 4838 + prettify(summary) |
| 4841 + ", expected " + prettify(expectedResult)); | 4839 + ", expected " + prettify(expectedResult)); |
| 4842 } | 4840 } |
| 4843 } | 4841 } |
| 4844 | 4842 |
| 4845 #endif /* #if !UCONFIG_NO_TRANSLITERATION */ | 4843 #endif /* #if !UCONFIG_NO_TRANSLITERATION */ |
| OLD | NEW |