diff --git a/UnicodeJsps/src/test/java/org/unicode/jsptest/TestUnicodeSet.java b/UnicodeJsps/src/test/java/org/unicode/jsptest/TestUnicodeSet.java index 70aca7455..2bc45bb53 100644 --- a/UnicodeJsps/src/test/java/org/unicode/jsptest/TestUnicodeSet.java +++ b/UnicodeJsps/src/test/java/org/unicode/jsptest/TestUnicodeSet.java @@ -217,86 +217,6 @@ public void TestICUEnums() { } } - @Test - public void TestICUStringProps() { - XPropertyFactory factory = XPropertyFactory.make(); - BreakIterator titleIter = BreakIterator.getWordInstance(ULocale.ROOT); - for (int propEnum = UProperty.STRING_START; propEnum < UProperty.STRING_LIMIT; ++propEnum) { - String propName = UCharacter.getPropertyName(propEnum, NameChoice.SHORT); - String propNameLong = UCharacter.getPropertyName(propEnum, NameChoice.LONG); - UnicodeProperty prop3 = factory.getProperty(propName); - logln(Utility.hex(propEnum) + "\t" + propName + "\t" + propNameLong); - int errorCount = 0; - for (int i = 0; i <= 0x10ffff; ++i) { - if (i == 'ß') { - int debug = 0; - } - String icuValue; - try { - switch (propEnum) { - case UProperty.BIDI_PAIRED_BRACKET: - icuValue = UTF16.valueOf(UCharacter.getBidiPairedBracket(i)); - break; - case UProperty.CASE_FOLDING: - icuValue = UCharacter.foldCase(UTF16.valueOf(i), true); - break; - case UProperty.LOWERCASE_MAPPING: - icuValue = UCharacter.toLowerCase(UTF16.valueOf(i)); - break; - case UProperty.TITLECASE_MAPPING: - icuValue = UCharacter.toTitleCase(UTF16.valueOf(i), titleIter); - break; - case UProperty.UPPERCASE_MAPPING: - icuValue = UCharacter.toUpperCase(UTF16.valueOf(i)); - break; - default: - icuValue = - UCharacter.getStringPropertyValue( - propEnum, i, NameChoice.SHORT); - if (propEnum == UProperty.AGE) { - icuValue = - icuValue.equals("0.0.0.0") - ? "unassigned" - : VersionInfo.getInstance(icuValue) - .getVersionString(2, 2); - } - } - } catch (Exception e) { - errln(propNameLong + "\t" + e.getMessage()); - if (++errorCount > 5) break; - else continue; - } - String propValue = prop3.getValue(i); - if (!Objects.equal( - icuValue, propValue)) { // do to avoid verbose mode being every character - assertEquals("string value", icuValue, propValue); - if (++errorCount > 5) break; - else continue; - } - } - } - } - - @Test - public void TestICUDoubleProps() { - XPropertyFactory factory = XPropertyFactory.make(); - // currently only one double property - assertEquals("only 1 double property", 1, UProperty.DOUBLE_LIMIT - UProperty.DOUBLE_START); - String propName = UCharacter.getPropertyName(UProperty.NUMERIC_VALUE, NameChoice.SHORT); - UnicodeProperty prop3 = factory.getProperty(propName); - for (int i = 0; i <= 0x10ffff; ++i) { - Double icuValue = UCharacter.getUnicodeNumericValue(i); - if (icuValue == UCharacter.NO_NUMERIC_VALUE) { - icuValue = Double.NaN; - } - String propString = prop3.getValue(i); - Double propValue = propString == null ? Double.NaN : Double.parseDouble(propString); - if (!icuValue.equals(propValue)) { // do to avoid verbose mode being every character - assertEquals("double value", icuValue, propValue); - } - } - } - private void checkProperty(XPropertyFactory factory, int propEnum) { try { int min = UCharacter.getIntPropertyMinValue(propEnum);