ICU-6955 Improve code coverage for charset SCSU. Fix some errors in CharsetSCSU.

X-SVN-Rev: 26133
This commit is contained in:
Michael Ow 2009-06-19 19:20:55 +00:00
parent 181acd1d71
commit 1be173845b
3 changed files with 22 additions and 6 deletions

View File

@ -834,6 +834,14 @@ conversion:table(nofallback) {
:intvector{},
:int{1}, :int{0}, "", "0", :bin{""}
}
//Improve code coverage for SCSU
{
"SCSU",
:bin{ 0fd899dc7fd888dc99e041424361 },
"\ud899\udc7f\ud888\udc99\u0041\u0042\u0043\u0061",
:intvector{},
:int{1}, :int{0}, "", "0", :bin{""}
}
}
}
@ -1610,6 +1618,14 @@ conversion:table(nofallback) {
:intvector{},
:int{1}, :int{0}, "", ".", ""
}
// Improve code coverage for SCSU
{
"SCSU",
"\ud899\udc7f\ud977\ud888\udc99\ud888\u0041",
:bin{ 0fd899dc7fd888dc99e041 },
:intvector{},
:int{1}, :int{0}, "", "0", ""
}
}
}

View File

@ -513,15 +513,15 @@ class CharsetSCSU extends CharsetICU{
LabelLoop = false;
return label;
}
b = source.get();
b = (short)(source.get() & UConverterConstants.UNSIGNED_BYTE_MASK);
++nextSourceIndex;
switch(state){
case readCommand:
if((byte)(b -UC0)>(Urs - UC0)){
if((short)((b -UC0)&UConverterConstants.UNSIGNED_BYTE_MASK)>(Urs - UC0)){
byteOne = b;
toUBytesArray[0] = (byte)b;
toULength = 1;
state = quotePairOne;
state = quotePairTwo;
}else if((b&UConverterConstants.UNSIGNED_BYTE_MASK) <= UC7){
dynamicWindow = (byte)(b - UC0);
sourceIndex = nextSourceIndex;
@ -1026,7 +1026,7 @@ class CharsetSCSU extends CharsetICU{
} else if(c<0xe000 && !AfterGetTrailUnicode){
label = GetTrailUnicode;
return label;
} else {
} else if (!AfterGetTrailUnicode){
/*quote to avoid SCSU tags*/
c|=UQU<<16;
length = 3;

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e45a334fc1a57269c5a6365b5a074a3d3f41d7824cd9fa2900acda7377a1f182
size 772209
oid sha256:7519a822ce8a3697adbad3fe85f070e8663b1fde3b8f310cac0243345f13b902
size 772303