ICU-2039 improve code coverage

X-SVN-Rev: 10571
This commit is contained in:
Markus Scherer 2002-12-10 01:06:07 +00:00
parent 1ac328c13c
commit 3b3abb2441
2 changed files with 22 additions and 0 deletions

View File

@ -1861,10 +1861,18 @@ _MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
return 0xffff;
}
#if 0
/*
* Code disabled 2002dec09 (ICU 2.4) because it is not currently used in ICU. markus
* TODO In future releases, verify that this function is never called for SBCS
* conversions, i.e., that sharedData->table->mbcs.countStates==1 is still true.
* Removal improves code coverage.
*/
/* use optimized function if possible */
if(sharedData->table->mbcs.countStates==1) {
return _MBCSSingleSimpleGetNextUChar(sharedData, (uint8_t)(*(*pSource)++), useFallback);
}
#endif
stateTable=sharedData->table->mbcs.stateTable;
unicodeCodeUnits=sharedData->table->mbcs.unicodeCodeUnits;
@ -1962,6 +1970,11 @@ _MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
return 0xffff;
}
#if 0
/*
* Code disabled 2002dec09 (ICU 2.4) because it is not currently used in ICU. markus
* Removal improves code coverage.
*/
/**
* This version of _MBCSSimpleGetNextUChar() is optimized for single-byte, single-state codepages.
* It does not handle the EBCDIC swaplfnl option (set in UConverter).
@ -2009,6 +2022,7 @@ _MBCSSingleSimpleGetNextUChar(UConverterSharedData *sharedData,
return 0xffff;
}
}
#endif
/* MBCS-from-Unicode conversion functions ----------------------------------- */

View File

@ -438,6 +438,14 @@ static void TestStringFunctions()
if(u_strcmpCodePointOrder(strings[i], strings[i+1])>=0) {
log_err("error: u_strcmpCodePointOrder() fails for string %d and the following one\n", i);
}
if(u_strncmpCodePointOrder(strings[i], strings[i+1], 10)>=0) {
log_err("error: u_strncmpCodePointOrder() fails for string %d and the following one\n", i);
}
/* There are at least 2 UChars in each string - verify that strncmp()==memcmp(). */
if(u_strncmpCodePointOrder(strings[i], strings[i+1], 2)!=u_memcmpCodePointOrder(strings[i], strings[i+1], 2)) {
log_err("error: u_strncmpCodePointOrder(2)!=u_memcmpCodePointOrder(2) for string %d and the following one\n", i);
}
/* test u_strCompare(TRUE) */
len1=u_strlen(strings[i]);