mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 07:39:16 +00:00
ICU-3938 more cldr 1.2 test updates
X-SVN-Rev: 16383
This commit is contained in:
parent
81d9667f1a
commit
61d6352299
3 changed files with 12 additions and 12 deletions
|
@ -716,14 +716,14 @@ TestConsistentCountryInfo(void) {
|
|||
}
|
||||
|
||||
static int32_t
|
||||
findStringSetMismatch(const UChar *string, int32_t langSize,
|
||||
findStringSetMismatch(const char *currLoc, const UChar *string, int32_t langSize,
|
||||
const UChar *exemplarCharacters, int32_t exemplarLen,
|
||||
UBool ignoreNumbers) {
|
||||
UErrorCode errorCode = U_ZERO_ERROR;
|
||||
USet *exemplarSet = uset_openPatternOptions(exemplarCharacters, exemplarLen, USET_CASE_INSENSITIVE, &errorCode);
|
||||
int32_t strIdx;
|
||||
if (U_FAILURE(errorCode)) {
|
||||
log_err("error uset_openPattern returned %s\n", u_errorName(errorCode));
|
||||
log_err("%s: error uset_openPattern returned %s\n", currLoc, u_errorName(errorCode));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -877,7 +877,7 @@ static void VerifyTranslation(void) {
|
|||
log_err("error uloc_getDisplayLanguage returned %s\n", u_errorName(errorCode));
|
||||
}
|
||||
else {
|
||||
strIdx = findStringSetMismatch(langBuffer, langSize, exemplarCharacters, exemplarLen, FALSE);
|
||||
strIdx = findStringSetMismatch(currLoc, langBuffer, langSize, exemplarCharacters, exemplarLen, FALSE);
|
||||
if (strIdx >= 0) {
|
||||
log_err("getDisplayLanguage(%s) at index %d returned characters not in the exemplar characters.\n",
|
||||
currLoc, strIdx);
|
||||
|
@ -888,7 +888,7 @@ static void VerifyTranslation(void) {
|
|||
log_err("error uloc_getDisplayCountry returned %s\n", u_errorName(errorCode));
|
||||
}
|
||||
else {
|
||||
strIdx = findStringSetMismatch(langBuffer, langSize, exemplarCharacters, exemplarLen, FALSE);
|
||||
strIdx = findStringSetMismatch(currLoc, langBuffer, langSize, exemplarCharacters, exemplarLen, FALSE);
|
||||
if (strIdx >= 0) {
|
||||
log_err("getDisplayCountry(%s) at index %d returned characters not in the exemplar characters.\n",
|
||||
currLoc, strIdx);
|
||||
|
@ -918,7 +918,7 @@ static void VerifyTranslation(void) {
|
|||
log_err("error ures_getStringByIndex(%d) returned %s\n", idx, u_errorName(errorCode));
|
||||
continue;
|
||||
}
|
||||
strIdx = findStringSetMismatch(fromBundleStr, langSize, exemplarCharacters, exemplarLen, TRUE);
|
||||
strIdx = findStringSetMismatch(currLoc, fromBundleStr, langSize, exemplarCharacters, exemplarLen, TRUE);
|
||||
if (strIdx >= 0) {
|
||||
log_err("getDayNames(%s, %d) at index %d returned characters not in the exemplar characters.\n",
|
||||
currLoc, idx, strIdx);
|
||||
|
@ -947,7 +947,7 @@ static void VerifyTranslation(void) {
|
|||
log_err("error ures_getStringByIndex(%d) returned %s\n", idx, u_errorName(errorCode));
|
||||
continue;
|
||||
}
|
||||
strIdx = findStringSetMismatch(fromBundleStr, langSize, exemplarCharacters, exemplarLen, TRUE);
|
||||
strIdx = findStringSetMismatch(currLoc, fromBundleStr, langSize, exemplarCharacters, exemplarLen, TRUE);
|
||||
if (strIdx >= 0) {
|
||||
log_err("getMonthNames(%s, %d) at index %d returned characters not in the exemplar characters.\n",
|
||||
currLoc, idx, strIdx);
|
||||
|
|
|
@ -854,7 +854,7 @@ static void TestISOFunctions()
|
|||
res = ures_open(NULL, "root", &status);
|
||||
ures_getByKey(res, "Languages", res, &status);
|
||||
if (U_FAILURE(status)) {
|
||||
log_err("There is an error in ures_getByKey(\"Languages\"), status=%s\n", u_errorName(status));
|
||||
log_err("There is an error in root's ures_getByKey(\"Languages\"), status=%s\n", u_errorName(status));
|
||||
status = U_ZERO_ERROR;
|
||||
}
|
||||
|
||||
|
|
|
@ -2169,21 +2169,21 @@ static void TestResourceLevelAliasing(void) {
|
|||
result = ures_getStringByKey(tb, keys[i], &resultLen, &status);
|
||||
uBufferLen = u_unescape(strings[i], uBuffer, 256);
|
||||
if(resultLen != uBufferLen || u_strncmp(result, uBuffer, resultLen) != 0) {
|
||||
log_err("Didn't get correct string while accesing alias table by key\n");
|
||||
log_err("Didn't get correct string while accesing alias table by key (%s)\n", keys[i]);
|
||||
}
|
||||
}
|
||||
for(i = 0; i < sizeof(strings)/sizeof(strings[0]); i++) {
|
||||
result = ures_getStringByIndex(tb, i, &resultLen, &status);
|
||||
uBufferLen = u_unescape(strings[i], uBuffer, 256);
|
||||
if(resultLen != uBufferLen || u_strncmp(result, uBuffer, resultLen) != 0) {
|
||||
log_err("Didn't get correct string while accesing alias table by index\n");
|
||||
log_err("Didn't get correct string while accesing alias table by index (%s)\n", strings[i]);
|
||||
}
|
||||
}
|
||||
for(i = 0; i < sizeof(strings)/sizeof(strings[0]); i++) {
|
||||
result = ures_getNextString(tb, &resultLen, &key, &status);
|
||||
uBufferLen = u_unescape(strings[i], uBuffer, 256);
|
||||
if(resultLen != uBufferLen || u_strncmp(result, uBuffer, resultLen) != 0) {
|
||||
log_err("Didn't get correct string while iterating over alias table\n");
|
||||
log_err("Didn't get correct string while iterating over alias table (%s)\n", strings[i]);
|
||||
}
|
||||
}
|
||||
tb = ures_getByKey(aliasB, "testGetStringByIndexAliasing", tb, &status);
|
||||
|
@ -2194,14 +2194,14 @@ static void TestResourceLevelAliasing(void) {
|
|||
result = ures_getStringByIndex(tb, i, &resultLen, &status);
|
||||
uBufferLen = u_unescape(strings[i], uBuffer, 256);
|
||||
if(resultLen != uBufferLen || u_strncmp(result, uBuffer, resultLen) != 0) {
|
||||
log_err("Didn't get correct string while accesing alias by index in an array\n");
|
||||
log_err("Didn't get correct string while accesing alias by index in an array (%s)\n", strings[i]);
|
||||
}
|
||||
}
|
||||
for(i = 0; i < sizeof(strings)/sizeof(strings[0]); i++) {
|
||||
result = ures_getNextString(tb, &resultLen, &key, &status);
|
||||
uBufferLen = u_unescape(strings[i], uBuffer, 256);
|
||||
if(resultLen != uBufferLen || u_strncmp(result, uBuffer, resultLen) != 0) {
|
||||
log_err("Didn't get correct string while iterating over aliases in an array\n");
|
||||
log_err("Didn't get correct string while iterating over aliases in an array (%s)\n", strings[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue