ICU-6717 return quaternary value as CE for strengths QUATERNARY, IDENTICAL. Re-enable TestSearchForNull.

X-SVN-Rev: 25368
This commit is contained in:
Eric Mader 2009-02-03 19:50:39 +00:00
parent d2624b1aef
commit 13a9d2c3ec
2 changed files with 5 additions and 7 deletions

View File

@ -162,13 +162,15 @@ inline int32_t getCE(const UStringSearch *strsrch, uint32_t sourcece)
// no shifting to quartenary is required since all primary values
// less than variabletop will need to be masked off anyway.
if (strsrch->variableTop > sourcece) {
if (strsrch->strength == UCOL_QUATERNARY) {
if (strsrch->strength >= UCOL_QUATERNARY) {
sourcece &= UCOL_PRIMARYORDERMASK;
}
else {
sourcece = UCOL_IGNORABLE;
}
}
} else if (strsrch->strength >= UCOL_QUATERNARY && sourcece == UCOL_IGNORABLE) {
sourcece = 0xFFFF;
}
return sourcece;

View File

@ -1,5 +1,5 @@
/********************************************************************
* Copyright (c) 2001-2008 International Business Machines
* Copyright (c) 2001-2009 International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************
* File usrchtst.c
@ -2268,7 +2268,6 @@ exitTestForwardBackward :
static void TestSearchForNull(void)
{
#if 0
UCollator *coll;
UErrorCode ec;
UStringSearch *search;
@ -2279,7 +2278,7 @@ static void TestSearchForNull(void)
int expectedNum;
int count = 0;
const UChar zerodigit = 0x0030; /* 0 */
const UChar nulldigit = 0x0001; /* null */
const UChar nulldigit = 0x0000; /* null */
/* static const UChar var[(length)+1]=U_DECLARE_UTF16(cs) */
#define PATTERN_LEN 4
@ -2349,9 +2348,6 @@ static void TestSearchForNull(void)
{
log_err("Expected %d search hits, found %d\n", expectedNum, count);
}
#else
log_info("Note: test disabled because it is known to fail (#4184).\n");
#endif
}
static void TestStrengthIdentical(void)