ICU-12752 IBM i now passes

X-SVN-Rev: 39326
This commit is contained in:
Steven R. Loomis 2016-09-22 01:25:52 +00:00
parent 6f4591b256
commit d255867071
4 changed files with 20 additions and 4 deletions

View File

@ -320,6 +320,20 @@ uprv_compareInvEbcdic(const UDataSwapper *ds,
const char *outString, int32_t outLength,
const UChar *localString, int32_t localLength);
/**
* \def uprv_compareInvWithUChar
* Compare an invariant-character strings with a UChar string
* @internal
*/
#if U_CHARSET_FAMILY==U_ASCII_FAMILY
# define uprv_compareInvWithUChar uprv_compareInvAscii
#elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY
# define uprv_compareInvWithUChar uprv_compareInvEbcdic
#else
# error Unknown charset family!
#endif
/* material... -------------------------------------------------------------- */
#if 0

View File

@ -15,6 +15,7 @@
#include "umutex.h"
#include "uresimp.h"
#include "uvector.h"
#include "udataswp.h" /* for InvChar functions */
static UHashtable* gLocExtKeyMap = NULL;
static icu::UInitOnce gLocExtKeyMapInitOnce = U_INITONCE_INITIALIZER;
@ -314,7 +315,7 @@ initFromResourceBundle(UErrorCode& sts) {
break;
}
// check if this is an alias of canoncal legacy type
if (uprv_compareInvAscii(NULL, legacyTypeId, -1, to, toLen) == 0) {
if (uprv_compareInvWithUChar(NULL, legacyTypeId, -1, to, toLen) == 0) {
const char* from = ures_getKey(typeAliasDataEntry.getAlias());
if (isTZ) {
// replace colon with slash if necessary
@ -364,7 +365,7 @@ initFromResourceBundle(UErrorCode& sts) {
break;
}
// check if this is an alias of bcp type
if (uprv_compareInvAscii(NULL, bcpTypeId, -1, to, toLen) == 0) {
if (uprv_compareInvWithUChar(NULL, bcpTypeId, -1, to, toLen) == 0) {
const char* from = ures_getKey(bcpTypeAliasDataEntry.getAlias());
uhash_put(typeDataMap, (void*)from, t, &sts);
}

View File

@ -282,8 +282,7 @@ static void TestFPos_SkelWithSeconds()
UChar ubuf[kSizeUBuf];
int32_t ulen, uelen;
UErrorCode status = U_ZERO_ERROR;
u_strFromUTF8(ubuf, kSizeUBuf, &ulen, locSkelItemPtr->skeleton, -1, &status);
ulen = u_unescape(locSkelItemPtr->skeleton, ubuf, kSizeUBuf);
udifmt = udtitvfmt_open(locSkelItemPtr->locale, ubuf, ulen, zoneGMT, -1, &status);
if ( U_FAILURE(status) ) {
log_data_err("FAIL: udtitvfmt_open for locale %s, skeleton %s: %s\n",

View File

@ -6159,6 +6159,8 @@ static void TestToLegacyType(void)
}
} else if (uprv_strcmp(legacyType, expected) != 0) {
log_data_err("toLegacyType: keyword=%s, value=%s => %s, expected=%s\n", keyword, value, legacyType, expected);
} else {
log_verbose("toLegacyType: keyword=%s, value=%s => %s\n", keyword, value, legacyType);
}
}
}