mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-66 Don't test utf8 unsafe macros in an unsafe manner
X-SVN-Rev: 3652
This commit is contained in:
parent
1e5733e830
commit
e8546eb6e1
1 changed files with 6 additions and 9 deletions
|
@ -124,10 +124,6 @@ static void TestGetChar()
|
|||
0x31,
|
||||
0x9a,
|
||||
0xc9,
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
static uint32_t result[]={
|
||||
/*codepoint-unsafe, codepoint-safe(not strict) codepoint-safe(strict)*/
|
||||
|
@ -145,17 +141,18 @@ static void TestGetChar()
|
|||
0x31, 0x31, 0x31,
|
||||
0x31, 0x9a, 0x9a,
|
||||
0x240, UTF8_ERROR_VALUE_1, UTF8_ERROR_VALUE_1,
|
||||
|
||||
|
||||
};
|
||||
uint16_t i=0;
|
||||
UChar32 c;
|
||||
uint32_t offset=0;
|
||||
|
||||
for(offset=0; offset<sizeof(input); offset++) {
|
||||
UTF8_GET_CHAR_UNSAFE(input, offset, c);
|
||||
if(c != result[i]){
|
||||
log_err("ERROR: UTF8_GET_CHAR_UNSAFE failed for offset=%ld. Expected:%lx Got:%lx\n", offset, result[i], c);
|
||||
if (offset < sizeof(input) - 1) {
|
||||
UTF8_GET_CHAR_UNSAFE(input, offset, c);
|
||||
if(c != result[i]){
|
||||
log_err("ERROR: UTF8_GET_CHAR_UNSAFE failed for offset=%ld. Expected:%lx Got:%lx\n", offset, result[i], c);
|
||||
|
||||
}
|
||||
}
|
||||
UTF8_GET_CHAR_SAFE(input, 0, offset, sizeof(input), c, FALSE);
|
||||
if(c != result[i+1]){
|
||||
|
|
Loading…
Add table
Reference in a new issue