Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1624)

Unified Diff: source/test/cintltst/capitst.c

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/test/cintltst/bocu1tst.c ('k') | source/test/cintltst/cbiapts.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/cintltst/capitst.c
diff --git a/source/test/cintltst/capitst.c b/source/test/cintltst/capitst.c
index 0d2fdccda3193c0d2b5d3b5cacd76d8b12a43cd7..163bb6422dd20f7a0844faa512f90f693bc70bc6 100644
--- a/source/test/cintltst/capitst.c
+++ b/source/test/cintltst/capitst.c
@@ -1446,7 +1446,7 @@ void TestGetLocale() {
ucol_close(coll);
}
- /* completely non-existant locale for collator should get a default collator */
+ /* completely non-existent locale for collator should get a root collator */
{
UCollator *defaultColl = ucol_open(NULL, &status);
coll = ucol_open("blahaha", &status);
@@ -1455,15 +1455,13 @@ void TestGetLocale() {
if(strcmp(ucol_getLocaleByType(coll, ULOC_REQUESTED_LOCALE, &status), "blahaha")) {
log_err("Nonexisting locale didn't preserve the requested locale\n");
} */
- if(strcmp(ucol_getLocaleByType(coll, ULOC_VALID_LOCALE, &status),
- ucol_getLocaleByType(defaultColl, ULOC_VALID_LOCALE, &status))) {
- log_err("Valid locale for nonexisting locale locale collator differs "
- "from valid locale for default collator\n");
+ const char *name = ucol_getLocaleByType(coll, ULOC_VALID_LOCALE, &status);
+ if(*name != 0 && strcmp(name, "root") != 0) {
+ log_err("Valid locale for nonexisting-locale collator is \"%s\" not root\n", name);
}
- if(strcmp(ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, &status),
- ucol_getLocaleByType(defaultColl, ULOC_ACTUAL_LOCALE, &status))) {
- log_err("Actual locale for nonexisting locale locale collator differs "
- "from actual locale for default collator\n");
+ name = ucol_getLocaleByType(coll, ULOC_ACTUAL_LOCALE, &status);
+ if(*name != 0 && strcmp(name, "root") != 0) {
+ log_err("Actual locale for nonexisting-locale collator is \"%s\" not root\n", name);
}
ucol_close(coll);
ucol_close(defaultColl);
@@ -2424,14 +2422,13 @@ static void TestGetKeywordValuesForLocale(void) {
UErrorCode status = U_ZERO_ERROR;
UEnumeration *keywordValues = NULL;
- int32_t i, n, size, valueLength;
+ int32_t i, n, size;
const char *locale = NULL, *value = NULL;
UBool errorOccurred = FALSE;
for (i = 0; i < UPRV_LENGTHOF(PREFERRED) && !errorOccurred; i++) {
locale = PREFERRED[i][0];
value = NULL;
- valueLength = 0;
size = 0;
keywordValues = ucol_getKeywordValuesForLocale("collation", locale, TRUE, &status);
@@ -2440,6 +2437,7 @@ static void TestGetKeywordValuesForLocale(void) {
break;
}
size = uenum_count(keywordValues, &status);
+ (void)size;
for (n = 0; (value = PREFERRED[i][n+1]) != NULL; n++) {
if (!uenum_contains(keywordValues, value, &status)) {
« no previous file with comments | « source/test/cintltst/bocu1tst.c ('k') | source/test/cintltst/cbiapts.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698