ICU-447 fix for Windows 2000/Solaris CC differences. The unsafe macro is not called when the utf8 character is larger than the size of the array.
X-SVN-Rev: 2121
This commit is contained in:
parent
33a776e6e5
commit
6ccfa23662
@ -208,8 +208,8 @@ void TestNextPrevChar(){
|
||||
12, 12, 12, 1, 1, 1,
|
||||
13, 13, 13, 1, 1, 1,
|
||||
14, 14, 14, 1, 1, 1,
|
||||
18, 15, 15, 1, 1, 1,
|
||||
16, 16, 16, 0, 0, 0,
|
||||
14, 15, 15, 1, 1, 1,
|
||||
14, 16, 16, 0, 0, 0,
|
||||
|
||||
|
||||
};
|
||||
@ -219,6 +219,7 @@ void TestNextPrevChar(){
|
||||
uint32_t i=0;
|
||||
uint32_t offset=0, setOffset=0;
|
||||
for(offset=0; offset<sizeof(input); offset++){
|
||||
if (offset < sizeof(input) - 2) { /* Can't have it go off the end of the array based on input */
|
||||
setOffset=offset;
|
||||
UTF8_NEXT_CHAR_UNSAFE(input, setOffset, c);
|
||||
if(setOffset != movedOffset[i]){
|
||||
@ -228,6 +229,7 @@ void TestNextPrevChar(){
|
||||
if(c != result[i]){
|
||||
log_err("ERROR: UTF8_NEXT_CHAR_UNSAFE failed for offset=%ld. Expected:%lx Got:%lx\n", offset, result[i], c);
|
||||
}
|
||||
}
|
||||
setOffset=offset;
|
||||
UTF8_NEXT_CHAR_SAFE(input, setOffset, sizeof(input), c, FALSE);
|
||||
if(setOffset != movedOffset[i+1]){
|
||||
|
Loading…
Reference in New Issue
Block a user