ICU-2194 fix exhaustive testing failures
X-SVN-Rev: 12008
This commit is contained in:
parent
3f3d20dad3
commit
913cae8031
@ -351,8 +351,17 @@ compareMapping(uint32_t codepoint, uint32_t* mapping,int32_t mapLength,
|
||||
length = (int8_t)mappingData[index];
|
||||
index++;
|
||||
}
|
||||
int32_t realLength =0;
|
||||
/* figure out the real length */
|
||||
for(int32_t i=0; i<mapLength; i++){
|
||||
if(mapping[i] > 0xFFFF){
|
||||
realLength +=2;
|
||||
}else{
|
||||
realLength++;
|
||||
}
|
||||
}
|
||||
|
||||
if(mapLength != length){
|
||||
if(realLength != length){
|
||||
pTestIDNA->errln( "Did not get the expected length. Expected: %i Got: %i\n", mapLength, length);
|
||||
}
|
||||
|
||||
|
@ -543,7 +543,7 @@ void TestIDNA::testAPI(const UChar* src, const UChar* expected, const char* test
|
||||
destLen = func(src,-1,dest,destLen+1,options, &parseError, &status);
|
||||
// TODO : compare output with expected
|
||||
if(U_SUCCESS(status) && (doCompare==TRUE) && u_strCaseCompare(dest,destLen, expected,expectedLen,0,&status)!=0){
|
||||
errln("Did not get the expected result for %s null terminated source.\n",testName);
|
||||
errln("Did not get the expected result for "+UnicodeString(testName) +" null terminated source : "+ prettify(UnicodeString(expected,expectedLen)));
|
||||
}
|
||||
}else{
|
||||
errln( "%s null terminated source failed. Requires destCapacity > 300\n",testName);
|
||||
@ -563,7 +563,9 @@ void TestIDNA::testAPI(const UChar* src, const UChar* expected, const char* test
|
||||
destLen = func(src,-1,dest,destLen+1,options | UIDNA_ALLOW_UNASSIGNED, &parseError, &status);
|
||||
// TODO : compare output with expected
|
||||
if(U_SUCCESS(status) && (doCompare==TRUE) && u_strCaseCompare(dest,destLen, expected,expectedLen,0,&status)!=0){
|
||||
errln("Did not get the expected result for %s null terminated source with both options set.\n",testName);
|
||||
//errln("Did not get the expected result for %s null terminated source with both options set.\n",testName);
|
||||
errln("Did not get the expected result for "+UnicodeString(testName) +" null terminated source with both options set. Expected: "+ prettify(UnicodeString(expected,expectedLen)));
|
||||
|
||||
}
|
||||
}else{
|
||||
errln( "%s null terminated source failed. Requires destCapacity > 300\n",testName);
|
||||
@ -1391,13 +1393,17 @@ void TestIDNA::TestIDNAMonkeyTest(){
|
||||
|
||||
void TestIDNA::TestCompareReferenceImpl(){
|
||||
|
||||
UChar src [3] = {0,0,0};
|
||||
UChar src [2] = {0,0};
|
||||
int32_t srcLen = 0;
|
||||
|
||||
if(quick==TRUE){
|
||||
return;
|
||||
}
|
||||
for(int32_t i = 1 ; i< 0x10ffff; i++){
|
||||
|
||||
for(int32_t i = 0x40000 ; i< 0x10ffff; i++){
|
||||
if(quick==TRUE && i> 0x1FFFF){
|
||||
return;
|
||||
}
|
||||
if(i >= 0x30000){
|
||||
i+=0xB0000;
|
||||
}
|
||||
if(i>0xFFFF){
|
||||
src[0] = U16_LEAD(i);
|
||||
src[1] = U16_TRAIL(i);
|
||||
|
Loading…
Reference in New Issue
Block a user