ICU-1948 move %%CollationBin under CollationElements table
X-SVN-Rev: 8890
This commit is contained in:
parent
cd14071b07
commit
9e2dca1c4e
@ -257,9 +257,8 @@ ucol_open( const char *loc,
|
||||
|
||||
UCollator *result = NULL;
|
||||
UResourceBundle *b = ures_open(NULL, loc, status);
|
||||
/* first take on tailoring version: */
|
||||
/* get CollationElements -> Version */
|
||||
UResourceBundle *binary = ures_getByKey(b, "%%CollationBin", NULL, status);
|
||||
UResourceBundle *collElem = ures_getByKey(b, "CollationElements", NULL, status);
|
||||
UResourceBundle *binary = ures_getByKey(collElem, "%%CollationBin", NULL, status);
|
||||
|
||||
if(*status == U_MISSING_RESOURCE_ERROR) { /* if we don't find tailoring, we'll fallback to UCA */
|
||||
*status = U_USING_DEFAULT_ERROR;
|
||||
@ -298,6 +297,7 @@ ucol_open( const char *loc,
|
||||
} else { /* There is another error, and we're just gonna clean up */
|
||||
clean:
|
||||
ures_close(b);
|
||||
ures_close(collElem);
|
||||
ures_close(binary);
|
||||
return NULL;
|
||||
}
|
||||
@ -306,6 +306,7 @@ clean:
|
||||
}
|
||||
result->requestedLocale = (char *)uprv_malloc((uprv_strlen(loc)+1)*sizeof(char));
|
||||
uprv_strcpy(result->requestedLocale, loc);
|
||||
ures_close(collElem);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -631,7 +631,7 @@ static void TestBinaryCollationData(){
|
||||
if(U_SUCCESS(status)){
|
||||
CONFIRM_ErrorCode(status, U_ZERO_ERROR);
|
||||
CONFIRM_INT_EQ(ures_getType(coll), RES_TABLE);
|
||||
binColl=ures_getByKey(teRes, "%%CollationBin", binColl, &status);
|
||||
binColl=ures_getByKey(coll, "%%CollationBin", binColl, &status);
|
||||
if(U_SUCCESS(status)){
|
||||
CONFIRM_ErrorCode(status, U_ZERO_ERROR);
|
||||
CONFIRM_INT_EQ(ures_getType(binColl), RES_BINARY);
|
||||
@ -711,7 +711,8 @@ static void TestAPI() {
|
||||
log_err("ERROR: ures_getNextResource() failed \n");
|
||||
}
|
||||
key=ures_getKey(teFillin);
|
||||
if(strcmp(key, "%%CollationBin") != 0){
|
||||
/*if(strcmp(key, "%%CollationBin") != 0){*/
|
||||
if(strcmp(key, "CollationElements") != 0){
|
||||
log_err("ERROR: ures_getNextResource() failed\n");
|
||||
}
|
||||
|
||||
@ -910,7 +911,7 @@ static void TestErrorConditions(){
|
||||
/*Test ures_getBinary(0 status != U_ILLEGAL_ARGUMENT_ERROR*/
|
||||
status=U_ZERO_ERROR;
|
||||
coll = ures_getByKey(teRes, "CollationElements", coll, &status);
|
||||
binColl=ures_getByKey(teRes, "%%CollationBin", binColl, &status);
|
||||
binColl=ures_getByKey(coll, "%%CollationBin", binColl, &status);
|
||||
|
||||
status=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
binResult=(uint8_t*)ures_getBinary(binColl, &len, &status);
|
||||
|
Loading…
Reference in New Issue
Block a user