/**
* UCAConformanceTest performs conformance tests defined in the data
- * files. ICU ships with stub data files, as the whole test are too
+ * files. ICU ships with stub data files, as the whole test are too
* long. To do the whole test, download the test files.
*/
public UCAConformanceTest() {
}
-
+
@Before
public void init() throws Exception {
- UCA = (RuleBasedCollator)Collator.getInstance(ULocale.ROOT);
+ UCA = (RuleBasedCollator) Collator.getInstance(ULocale.ROOT);
comparer = new UTF16.StringComparator(true, false, UTF16.StringComparator.FOLD_CASE_DEFAULT);
}
-
+
private RuleBasedCollator UCA;
private RuleBasedCollator rbUCA;
private UTF16.StringComparator comparer;
- private boolean isAtLeastUCA62 =
- UCharacter.getUnicodeVersion().compareTo(VersionInfo.UNICODE_6_2) >= 0;
+ private boolean isAtLeastUCA62 = UCharacter.getUnicodeVersion().compareTo(VersionInfo.UNICODE_6_2) >= 0;
@Test
public void TestTableNonIgnorable() {
@Test
public void TestRulesNonIgnorable() {
- if(logKnownIssue("cldrbug:6745", "UCARules.txt has problems")) { return; }
+ if (logKnownIssue("cldrbug:6745", "UCARules.txt has problems")) {
+ return;
+ }
initRbUCA();
- if(rbUCA == null) { return; }
+ if (rbUCA == null) {
+ return;
+ }
setCollNonIgnorable(rbUCA);
openTestFile("NON_IGNORABLE");
@Test
public void TestRulesShifted() {
- logln("This test is currently disabled, as it is impossible to "+
- "wholly represent fractional UCA using tailoring rules.");
+ logln("This test is currently disabled, as it is impossible to "
+ + "wholly represent fractional UCA using tailoring rules.");
return;
/*
- initRbUCA();
- if(rbUCA == null) { return; }
-
- setCollShifted(rbUCA);
- openTestFile("SHIFTED");
- testConformance(rbUCA);
- */
+ * initRbUCA(); if(rbUCA == null) { return; }
+ *
+ * setCollShifted(rbUCA); openTestFile("SHIFTED"); testConformance(rbUCA);
+ */
}
+
BufferedReader in;
- private void openTestFile(String type)
- {
+
+ private void openTestFile(String type) {
String collationTest = "CollationTest_";
String ext = ".txt";
try {
- in = TestUtil.getDataReader(collationTest+type+"_SHORT"+ext);
+ in = TestUtil.getDataReader(collationTest + type + "_SHORT" + ext);
} catch (Exception e) {
try {
- in = TestUtil.getDataReader(collationTest+type+ext);
+ in = TestUtil.getDataReader(collationTest + type + ext);
} catch (Exception e1) {
try {
- in = TestUtil.getDataReader(collationTest+type+"_STUB"+ext);
- logln( "INFO: Working with the stub file.\n"+
- "If you need the full conformance test, please\n"+
- "download the appropriate data files from:\n"+
- "http://unicode.org/cldr/trac/browser/trunk/common/uca");
+ in = TestUtil.getDataReader(collationTest + type + "_STUB" + ext);
+ logln("INFO: Working with the stub file.\n" + "If you need the full conformance test, please\n"
+ + "download the appropriate data files from:\n"
+ + "http://unicode.org/cldr/trac/browser/trunk/common/uca");
} catch (Exception e11) {
errln("ERROR: Could not find any of the test files");
}
}
}
- }
+ }
- private void setCollNonIgnorable(RuleBasedCollator coll)
- {
- if(coll != null) {
+ private void setCollNonIgnorable(RuleBasedCollator coll) {
+ if (coll != null) {
coll.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
coll.setLowerCaseFirst(false);
coll.setCaseLevel(false);
}
}
- private void setCollShifted(RuleBasedCollator coll)
- {
- if(coll != null) {
+ private void setCollShifted(RuleBasedCollator coll) {
+ if (coll != null) {
coll.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
coll.setLowerCaseFirst(false);
coll.setCaseLevel(false);
}
}
-
-
- private void initRbUCA()
- {
- if(rbUCA == null) {
+ private void initRbUCA() {
+ if (rbUCA == null) {
String ucarules = UCA.getRules(true);
try {
rbUCA = new RuleBasedCollator(ucarules);
- } catch(Exception e) {
+ } catch (Exception e) {
errln("Failure creating UCA rule-based collator: " + e);
}
}
int i = 0, value;
StringBuilder result = new StringBuilder(), buffer = new StringBuilder();
- for(;;) {
- while(i < line.length() && Character.isWhitespace(line.charAt(i))) {
+ for (;;) {
+ while (i < line.length() && Character.isWhitespace(line.charAt(i))) {
i++;
}
- while(i < line.length() && Character.isLetterOrDigit(line.charAt(i))) {
+ while (i < line.length() && Character.isLetterOrDigit(line.charAt(i))) {
buffer.append(line.charAt(i));
i++;
}
- if(buffer.length() == 0) {
+ if (buffer.length() == 0) {
// We hit something that was not whitespace/letter/digit.
// Should be ';' or end of string.
return result.toString();
}
private void conformanceTest(RuleBasedCollator coll) {
- if(in == null || coll == null) {
+ if (in == null || coll == null) {
return;
}
int skipFlags = 0;
- if(coll.isAlternateHandlingShifted()) {
+ if (coll.isAlternateHandlingShifted()) {
skipFlags |= IS_SHIFTED;
}
- if(coll == rbUCA) {
+ if (coll == rbUCA) {
skipFlags |= FROM_RULES;
}
try {
while ((line = in.readLine()) != null) {
lineNo++;
- if(line.length() == 0 || line.charAt(0) == '#') {
+ if (line.length() == 0 || line.charAt(0) == '#') {
continue;
}
buffer = parseString(line);
- if(skipLineBecauseOfBug(buffer, skipFlags)) {
+ if (skipLineBecauseOfBug(buffer, skipFlags)) {
logln("Skipping line " + lineNo + " because of a known bug");
continue;
}
- if(withSortKeys) {
+ if (withSortKeys) {
coll.getRawCollationKey(buffer, newSk);
}
- if(oldSk != null) {
+ if (oldSk != null) {
boolean ok = true;
int skres = withSortKeys ? oldSk.compareTo(newSk) : 0;
int cmpres = coll.compare(oldB, buffer);
int cmpres2 = coll.compare(buffer, oldB);
- if(cmpres != -cmpres2) {
+ if (cmpres != -cmpres2) {
errln(String.format(
- "Compare result not symmetrical on line %i: " +
- "previous vs. current (%d) / current vs. previous (%d)",
+ "Compare result not symmetrical on line %d: "
+ + "previous vs. current (%d) / current vs. previous (%d)",
lineNo, cmpres, cmpres2));
ok = false;
}
// TODO: Compare with normalization turned off if the input passes the FCD test.
- if(withSortKeys && cmpres != normalizeResult(skres)) {
- errln("Difference between coll.compare (" + cmpres + ") and sortkey compare (" + skres + ") on line " + lineNo);
+ if (withSortKeys && cmpres != normalizeResult(skres)) {
+ errln("Difference between coll.compare (" + cmpres + ") and sortkey compare (" + skres
+ + ") on line " + lineNo);
ok = false;
}
int res = cmpres;
- if(res == 0 && !isAtLeastUCA62) {
+ if (res == 0 && !isAtLeastUCA62) {
// Up to UCA 6.1, the collation test files use a custom tie-breaker,
// comparing the raw input strings.
res = comparer.compare(oldB, buffer);
// comparing the NFD versions of the input strings,
// which we do via setting strength=identical.
}
- if(res > 0) {
+ if (res > 0) {
errln("Line " + lineNo + " is not greater or equal than previous line");
ok = false;
}
- if(!ok) {
+ if (!ok) {
errln(" Previous data line " + oldLine);
errln(" Current data line " + line);
- if(withSortKeys) {
+ if (withSortKeys) {
errln(" Previous key: " + CollationTest.prettify(oldSk));
errln(" Current key: " + CollationTest.prettify(newSk));
}
oldSk = newSk;
oldB = buffer;
oldLine = line;
- if(oldSk == sk1) {
+ if (oldSk == sk1) {
newSk = sk2;
} else {
newSk = sk1;
}
}
} catch (Exception e) {
- errln("Unexpected exception "+e);
+ errln("Unexpected exception " + e);
} finally {
try {
in.close();
dm=null;
}
if(dt<0) {
- errln(String.format("error in UnicodeData.txt: syntax error in U+%04lX decomposition field", ch));
+ errln(String.format("error in UnicodeData.txt: syntax error in U+%04x decomposition field", ch));
return;
}
int i=UCharacter.getIntPropertyValue(ch, UProperty.DECOMPOSITION_TYPE);
break;
}
-
+
String title = fields[14];
tempchar = ch;
"." + ages[i + 4]);
}
}
-
+
int[] valid_tests = {
UCharacter.MIN_VALUE, UCharacter.MIN_VALUE+1,
UCharacter.MAX_VALUE-1, UCharacter.MAX_VALUE};
int[] invalid_tests = {
UCharacter.MIN_VALUE-1, UCharacter.MIN_VALUE-2,
UCharacter.MAX_VALUE+1, UCharacter.MAX_VALUE+2};
-
+
for(int i=0; i< valid_tests.length; i++){
try{
UCharacter.getAge(valid_tests[i]);
"an exception. Value passed: " + valid_tests[i]);
}
}
-
+
for(int i=0; i< invalid_tests.length; i++){
try{
UCharacter.getAge(invalid_tests[i]);
{ 0xff9f, UProperty.GRAPHEME_BASE, 0 }, /* changed from Unicode 3.2 to 4 and again 5 to 5.1 */
{ 0x0300, UProperty.GRAPHEME_EXTEND, 1 },
- { 0xff9d, UProperty.GRAPHEME_EXTEND, 0 },
+ { 0xff9d, UProperty.GRAPHEME_EXTEND, 0 },
{ 0xff9f, UProperty.GRAPHEME_EXTEND, 1 }, /* changed from Unicode 3.2 to 4 and again 5 to 5.1 */
{ 0x0603, UProperty.GRAPHEME_EXTEND, 0 },
public void TestBlockData()
{
Class ubc = UCharacter.UnicodeBlock.class;
-
+
for (int b = 1; b < UCharacter.UnicodeBlock.COUNT; b += 1) {
UCharacter.UnicodeBlock blk = UCharacter.UnicodeBlock.getInstance(b);
int id = blk.getID();
String name = blk.toString();
-
+
if (id != b) {
errln("UCharacter.UnicodeBlock.getInstance(" + b + ") returned a block with id = " + id);
}
-
+
try {
if (ubc.getField(name + "_ID").getInt(blk) != b) {
errln("UCharacter.UnicodeBlock.getInstance(" + b + ") returned a block with a name of " + name +
//UCharacter.UnicodeBlock.forName("");
//Tests when "if (b == null)" is true
}
-
+
/*
* The following method tests
* public static int getNumericValue(int ch)
65834,65835,65836,65837,65838,65839,65840,65841,65842,65843,65861,
65862,65863,65868,65869,65870,65875,65876,65877,65878,65899,65900,
65901,65902,65903,65904,65905,65906,66378,68167};
-
+
int[] results =
{1000,1000,10000,500,1000,500,1000,1000,5000,10000,50000,100000,
10000,100000000,1000,100000000,-2,1000,10000,1000,300,400,500,
10000,20000,30000,40000,50000,60000,70000,80000,90000,500,5000,
50000,500,1000,5000,500,1000,10000,50000,300,500,500,500,500,500,
1000,5000,900,1000};
-
+
if(valid_values.length != results.length){
errln("The valid_values array and the results array need to be "+
"the same length.");
* could not be covered even with input values from UTF16.CODEPOINT_MIN_VALUE
* to UTF16.CODEPOINT_MAX_VALUE. I also tested from UTF16.CODEPOINT_MAX_VALUE to
* Integer.MAX_VALUE and didn't recieve any code coverage there too.
- * Therefore, the code could either be dead code or meaningless.
+ * Therefore, the code could either be dead code or meaningless.
*/
}
int[] invalid_tests = {
UCharacter.MIN_VALUE-1, UCharacter.MIN_VALUE-2,
UCharacter.MAX_VALUE+1, UCharacter.MAX_VALUE+2};
-
+
for(int i=0; i< valid_tests.length; i++){
if(UCharacter.toString(valid_tests[i]) == null){
errln("UCharacter.toString(int) was not suppose to return " +
valid_tests[i] + ". Got null.");
}
}
-
+
for(int i=0; i< invalid_tests.length; i++){
if(UCharacter.toString(invalid_tests[i]) != null){
errln("UCharacter.toString(int) was suppose to return " +
int[] invalid_tests = {
UCharacter.MIN_VALUE-1, UCharacter.MIN_VALUE-2,
UCharacter.MAX_VALUE+1, UCharacter.MAX_VALUE+2};
-
+
for(int i=0; i< valid_tests.length; i++){
try{
UCharacter.getCombiningClass(valid_tests[i]);
"an exception. Value passed: " + valid_tests[i]);
}
}
-
+
for(int i=0; i< invalid_tests.length; i++){
try{
assertEquals("getCombiningClass(out of range)",
}
}
}
-
+
/*
* The following method tests
* public static String getISOComment(int ch)
int[] invalid_tests = {
UCharacter.MIN_VALUE-1, UCharacter.MIN_VALUE-2,
UCharacter.MAX_VALUE+1, UCharacter.MAX_VALUE+2};
-
+
for(int i=0; i< invalid_tests.length; i++){
if(UCharacter.getISOComment(invalid_tests[i]) != null){
errln("UCharacter.getISOComment(int) was suppose to return " +
for(int i=0; i<locale.length; i++){
UCharacter.toTitleCase(new Locale(locale[i]), "", null);
}
-
+
// Calls the function "String toTitleCase(ULocale locale, String str, BreakIterator titleIter, int options)"
// Tests when "if (locale == null)" is true
UCharacter.toTitleCase((ULocale)null, "", null, 0);
-
+
// TODO: Tests when "if(index==BreakIterator.DONE || index>srcLength)" is true
// TODO: Tests when "while((c=iter.nextCaseMapCP())>=0 && UCaseProps.NONE==gCsp.getType(c))" is false
// TODO: Tests when "if(prev<titleStart)" is false
0x824c, //CJK_IDEOGRAPH_TEN_THOUSAND_
0x5104, //CJK_IDEOGRAPH_HUNDRED_MILLION_
};
-
+
int[] invalid = {-5,-2,-1,0};
-
+
int[] results = {0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,100,100,
1000,1000,10000,100000000};
-
+
if(valid.length != results.length){
errln("The arrays valid and results are suppose to be the same length " +
"to test getHanNumericValue(int ch).");
} else{
for(int i=0; i<valid.length; i++){
if(UCharacter.getHanNumericValue(valid[i]) != results[i]){
- errln("UCharacter.getHanNumericValue does not return the " +
+ errln("UCharacter.getHanNumericValue does not return the " +
"same result as expected. Passed value: " + valid[i] +
". Got: " + UCharacter.getHanNumericValue(valid[i]) +
". Expected: " + results[i]);
}
}
}
-
+
for(int i=0; i<invalid.length; i++){
if(UCharacter.getHanNumericValue(invalid[i]) != -1){
- errln("UCharacter.getHanNumericValue does not return the " +
+ errln("UCharacter.getHanNumericValue does not return the " +
"same result as expected. Passed value: " + invalid[i] +
". Got: " + UCharacter.getHanNumericValue(invalid[i]) +
". Expected: -1");
/*
* The following method tests
- * public static boolean hasBinaryProperty(int ch, int property)
+ * public static boolean hasBinaryProperty(int ch, int property)
*/
@Test
public void TestHasBinaryProperty(){
}
}
-
+
// Testing when "if(ch<NormalizerImpl.JAMO_L_BASE)" is true
for(int i=Normalizer2Impl.Hangul.JAMO_L_BASE-5; i<Normalizer2Impl.Hangul.JAMO_L_BASE; i++){
if(UCharacter.getIntPropertyValue(i, UProperty.HANGUL_SYLLABLE_TYPE) != 0){
}
}
-
+
// Testing when "else if((ch-=NormalizerImpl.HANGUL_BASE)<0)" is true
for(int i=Normalizer2Impl.Hangul.HANGUL_BASE-5; i<Normalizer2Impl.Hangul.HANGUL_BASE; i++){
if(UCharacter.getIntPropertyValue(i, UProperty.HANGUL_SYLLABLE_TYPE) != 0){
"but got " + UCharacter.getIntPropertyMaxValue(cases[i]));
}
}
-
+
// TODO: Testing when the case statment reaches "default"
// After testing between values of UProperty.INT_START and
// UProperty.INT_LIMIT are covered, none of the values reaches default.
}
-
+
/*
* The following method tests
* public static final int codePointAt(CharSequence seq, int index)
*/
@Test
public void TestCodePointAt(){
-
+
// {LEAD_SURROGATE_MIN_VALUE,
// LEAD_SURROGATE_MAX_VALUE, LEAD_SURROGATE_MAX_VALUE-1
String[] cases = {"\uD800","\uDBFF","\uDBFE"};
for(int i=0; i < cases.length; i++){
/* Testing UCharacter.codePointAt(seq, index) */
// Testing when "if (index < seq.length())" is false
- if(UCharacter.codePointAt((CharSequence) cases[i], 0) != result[i])
+ if(UCharacter.codePointAt(cases[i], 0) != result[i])
errln("UCharacter.codePointAt(CharSequence ...) did not return as expected. " +
"Passed value: " + cases[i] + ". Expected: " +
result[i] + ". Got: " +
- UCharacter.codePointAt((CharSequence) cases[i], 0));
-
+ UCharacter.codePointAt(cases[i], 0));
+
/* Testing UCharacter.codePointAt(text, index) */
// Testing when "if (index < text.length)" is false
if(UCharacter.codePointAt(cases[i].toCharArray(), 0) != result[i])
"Passed value: " + cases[i] + ". Expected: " +
result[i] + ". Got: " +
UCharacter.codePointAt(cases[i].toCharArray(), 0));
-
+
/* Testing UCharacter.codePointAt(text, index, limit) */
// Testing when "if (index < limit)" is false
if(UCharacter.codePointAt(cases[i].toCharArray(), 0, 1) != result[i])
char[] one_char_text = {'a'};
char[] reg_text = {'d','u','m','m','y'};
int[] limitCases = {2,3,5,10,25};
-
+
// When index >= limit
for(int i=0; i < limitCases.length; i++){
try{
} catch(Exception e){
}
}
-
+
// When limit > text.length
for(int i=0; i < limitCases.length; i++){
try{
0 + ", Limit: " + limitCases[i] + ".");
} catch(Exception e){
}
-
+
try{
UCharacter.codePointCount(one_char_text, 0, limitCases[i]);
errln("UCharacter.codePointCount was suppose to return an exception " +
for(int i=0; i < cases.length; i++){
/* Testing UCharacter.codePointBefore(seq, index) */
// Testing when "if (index > 0)" is false
- if(UCharacter.codePointBefore((CharSequence) cases[i], 1) != result[i])
+ if(UCharacter.codePointBefore(cases[i], 1) != result[i])
errln("UCharacter.codePointBefore(CharSequence ...) did not return as expected. " +
"Passed value: " + cases[i] + ". Expected: " +
result[i] + ". Got: " +
- UCharacter.codePointBefore((CharSequence) cases[i], 1));
-
+ UCharacter.codePointBefore(cases[i], 1));
+
/* Testing UCharacter.codePointBefore(text, index) */
// Testing when "if (index > 0)" is false
if(UCharacter.codePointBefore(cases[i].toCharArray(), 1) != result[i])
"Passed value: " + cases[i] + ". Expected: " +
result[i] + ". Got: " +
UCharacter.codePointBefore(cases[i].toCharArray(), 1));
-
+
/* Testing UCharacter.codePointBefore(text, index, limit) */
// Testing when "if (index > limit)" is false
if(UCharacter.codePointBefore(cases[i].toCharArray(), 1, 0) != result[i])
result[i] + ". Got: " +
UCharacter.codePointBefore(cases[i].toCharArray(), 1, 0));
}
-
+
/* Testing UCharacter.codePointBefore(text, index, limit) */
char[] dummy = {'d','u','m','m','y'};
// Testing when "if (index <= limit || limit < 0)" is true
int[] negative_cases = {-100,-10,-5,-2,-1};
int[] index_cases = {0,1,2,5,10,100};
-
+
for(int i=0; i < negative_cases.length; i++){
try{
UCharacter.codePointBefore(dummy, 10000, negative_cases[i]);
"when the parameter limit of " + negative_cases[i] + " is a negative number.");
} catch(Exception e) {}
}
-
+
for(int i=0; i < index_cases.length; i++){
try{
UCharacter.codePointBefore(dummy, index_cases[i], 101);
public void TestToChars(){
int[] positive_cases = {1,2,5,10,100};
char[] dst = {'a'};
-
+
/* Testing UCharacter.toChars(cp, dst, dstIndex) */
for(int i=0; i < positive_cases.length; i++){
// Testing negative values when cp < 0 for if (cp >= 0)
"when the parameter " + (-1*positive_cases[i]) + " is a negative number.");
} catch(Exception e){
}
-
+
// Testing when "if (cp < MIN_SUPPLEMENTARY_CODE_POINT)" is true
if(UCharacter.toChars(UCharacter.MIN_SUPPLEMENTARY_CODE_POINT-positive_cases[i], dst, 0) != 1){
errln("UCharacter.toChars(int,char[],int) was suppose to return a value of 1. Got: " +
UCharacter.toChars(UCharacter.MIN_SUPPLEMENTARY_CODE_POINT-positive_cases[i], dst, 0));
}
-
+
// Testing when "if (cp < MIN_SUPPLEMENTARY_CODE_POINT)" is false and
// when "if (cp <= MAX_CODE_POINT)" is false
try{
} catch(Exception e){
}
}
-
-
+
+
/* Testing UCharacter.toChars(cp)*/
for(int i=0; i<positive_cases.length; i++){
// Testing negative values when cp < 0 for if (cp >= 0)
"when the parameter " + positive_cases[i] + " is a negative number.");
} catch(Exception e){
}
-
+
// Testing when "if (cp < MIN_SUPPLEMENTARY_CODE_POINT)" is true
if(UCharacter.toChars(UCharacter.MIN_SUPPLEMENTARY_CODE_POINT-positive_cases[i]).length <= 0){
errln("UCharacter.toChars(int) was suppose to return some result result when the parameter " +
(UCharacter.MIN_SUPPLEMENTARY_CODE_POINT-positive_cases[i]) + "is passed.");
}
-
+
// Testing when "if (cp < MIN_SUPPLEMENTARY_CODE_POINT)" is false and
// when "if (cp <= MAX_CODE_POINT)" is false
try{
char[] reg_text = {'d','u','m','m','y'};
int[] invalid_startCases = {-1,-2,-5,-10,-100};
int[] limitCases = {2,3,5,10,25};
-
+
// When start < 0
for(int i=0; i < invalid_startCases.length; i++){
try{
UCharacter.codePointCount(reg_text, invalid_startCases[i], 1);
errln("UCharacter.codePointCount was suppose to return an exception " +
"but got " + UCharacter.codePointCount(reg_text, invalid_startCases[i], 1) +
- ". The following passed parameters were Text: " + String.valueOf(reg_text) + ", Start: " +
+ ". The following passed parameters were Text: " + String.valueOf(reg_text) + ", Start: " +
invalid_startCases[i] + ", Limit: " + 1 + ".");
} catch(Exception e){
}
} catch(Exception e){
}
}
-
+
// When limit > text.length
for(int i=0; i < limitCases.length; i++){
try{
0 + ", Limit: " + limitCases[i] + ".");
} catch(Exception e){
}
-
+
try{
UCharacter.codePointCount(one_char_text, 0, limitCases[i]);
errln("UCharacter.codePointCount was suppose to return an exception " +
}
}
}
-
+
/*
* The following method tests
* private static int getEuropeanDigit(int ch)
//The number retrieved from 0xFF41 to 0xFF5A is due to
// exhaustive testing from UTF16.CODEPOINT_MIN_VALUE to
// UTF16.CODEPOINT_MAX_VALUE return a value of -1.
-
+
int[] radixResult = {
10,11,12,13,14,15,16,17,18,19,20,21,22,
23,24,25,26,27,28,29,30,31,32,33,34,35};
- // Invalid and too-small-for-these-digits radix values.
+ // Invalid and too-small-for-these-digits radix values.
int[] radixCase1 = {0,1,5,10,100};
// Radix values that work for at least some of the "digits".
int[] radixCase2 = {12,16,20,36};
-
+
for(int i=0xFF41; i<=0xFF5A; i++){
for(int j=0; j < radixCase1.length; j++){
if(UCharacter.digit(i, radixCase1[j]) != -1){
}
}
}
-
+
/* Tests the method
* private static final int getProperty(int ch)
* from public static int getType(int ch)
+ "did not return 0 for passed value of " + cases[i] +
" but got " + UCharacter.getType(cases[i]));
}
-
+
/* Tests the class
* abstract public static class XSymbolTable implements SymbolTable
*/
public void TestXSymbolTable(){
class MyXSymbolTable extends UnicodeSet.XSymbolTable {}
MyXSymbolTable st = new MyXSymbolTable();
-
+
// Tests "public UnicodeMatcher lookupMatcher(int i)"
if(st.lookupMatcher(0) != null)
errln("XSymbolTable.lookupMatcher(int i) was suppose to return null.");
-
+
// Tests "public boolean applyPropertyAlias(String propertyName, String propertyValue, UnicodeSet result)"
if(st.applyPropertyAlias("", "", new UnicodeSet()) != false)
errln("XSymbolTable.applyPropertyAlias(String propertyName, String propertyValue, UnicodeSet result) was suppose to return false.");
// Tests "public char[] lookup(String s)"
if(st.lookup("") != null)
errln("XSymbolTable.lookup(String s) was suppose to return null.");
-
+
// Tests "public String parseReference(String text, ParsePosition pos, int limit)"
if(st.parseReference("", null, 0) != null)
errln("XSymbolTable.parseReference(String text, ParsePosition pos, int limit) was suppose to return null.");
}
-
+
/* Tests the method
* public boolean isFrozen()
*/
UnicodeSet us = new UnicodeSet();
if(us.isFrozen() != false)
errln("Unicode.isFrozen() was suppose to return false.");
-
+
us.freeze();
if(us.isFrozen() != true)
errln("Unicode.isFrozen() was suppose to return true.");