diff --git a/icu4j/src/com/ibm/icu/dev/test/lang/TestUScript.java b/icu4j/src/com/ibm/icu/dev/test/lang/TestUScript.java index f88b60d1e9..dfd3d9436d 100755 --- a/icu4j/src/com/ibm/icu/dev/test/lang/TestUScript.java +++ b/icu4j/src/com/ibm/icu/dev/test/lang/TestUScript.java @@ -8,6 +8,9 @@ package com.ibm.icu.dev.test.lang; import com.ibm.icu.lang.UScript; +import com.ibm.icu.lang.UScriptRun; +import com.ibm.icu.text.Transliterator; +import com.ibm.icu.text.UnicodeSet; import com.ibm.icu.dev.test.TestFmwk; import java.util.Locale; @@ -268,13 +271,46 @@ public class TestUScript extends TestFmwk{ } public void TestAllCodepoints(){ int code; + String oldId=""; + String oldAbbrId=""; for( int i =0; i <= 0x10ffff; i++){ code =UScript.INVALID_CODE; code = UScript.getScript(i); if(code==UScript.INVALID_CODE){ errln("UScript.getScript for codepoint 0x"+ hex(i)+" failed"); } + String id =UScript.getName(code); + String abbr = UScript.getShortName(code); + String newId ="[:"+id+":];NFD"; + String newAbbrId ="[:"+abbr+":];NFD"; + if(!oldId.equals(newId)){ + try{ + Transliterator t = Transliterator.getInstance(newId); + if(t==null){ + errln("Failed to create transliterator for "+hex(i)+ + " script code: " +id); + } + }catch(Exception e){ + errln("Failed to create transliterator for "+hex(i) + +" script code: " +id + + " Exception: "+e.getMessage()); + } + } + oldId = newId; + if(!oldAbbrId.equals(newAbbrId)){ + try{ + Transliterator t = Transliterator.getInstance(newAbbrId); + if(t==null){ + errln("Failed to create transliterator for "+hex(i)+ + " script code: " +abbr); + } + }catch(Exception e){ + errln("Failed to create transliterator for "+hex(i) + +" script code: " +abbr + + " Exception: "+e.getMessage()); + } + } + oldAbbrId = newAbbrId; } - } - + } } \ No newline at end of file