/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2012, International Business Machines Corporation and
+ * Copyright (c) 1997-2014, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/*******************************************************************************
sortklenmax = (sortklen1>sortklen2?sortklen1:sortklen2);
sortklenmin = (sortklen1<sortklen2?sortklen1:sortklen2);
+ (void)sortklenmin; /* Suppress set but not used warning. */
sortKey1 =(uint8_t*)malloc(sizeof(uint8_t) * (sortklenmax+1));
sortKey1a=(uint8_t*)malloc(sizeof(uint8_t) * (sortklenmax+1));
}
/* Now, do the same comparison with keys */
sourceKeyOut = ucol_getSortKey(myCollator, source, -1, sourceKeyArray, 100);
+ (void)sourceKeyOut; /* Suppress set but not used warning. */
targetKeyOut = ucol_getSortKey(myCollator, target, -1, targetKeyArray, 100);
bufferLen = ((targetKeyOut > 100) ? 100 : targetKeyOut);
if (memcmp(sourceKeyArray, targetKeyArray, bufferLen) != 0)
*/
static void TestVariableTop(void)
{
+#if 0
+ /*
+ * Starting with ICU 53, setting the variable top via a pseudo relation string
+ * is not supported any more.
+ * It was replaced by the [maxVariable symbol] setting.
+ * See ICU tickets #9958 and #8032.
+ */
static const char str[] = "&z = [variable top]";
int len = strlen(str);
UChar rules[sizeof(str)];
ucol_close(myCollation);
enCollation = NULL;
myCollation = NULL;
+#endif
}
/**
"& C < ch, cH, & Ch[variable top]"
};
static const char* preContextArr[MAX_ERROR_STATES] = {
- "his should fail",
- "& C < ch, cH, ",
+ " C < ch, cH, Ch",
+ "& C < ch, cH",
};
static const char* postContextArr[MAX_ERROR_STATES] = {
- "<d",
- " Ch[variable t"
+ "[this should fa",
+ ", & Ch[variable"
};
int i;
u_memset(parseError.postContext,0x0000,U_PARSE_CONTEXT_LEN);
/* open the rules and test */
coll = ucol_openRules(rules,u_strlen(rules),UCOL_OFF,UCOL_DEFAULT_STRENGTH,&parseError,&status);
+ (void)coll; /* Suppress set but not used warning. */
if(u_strcmp(parseError.preContext,preContextExp)!=0){
- log_err_status(status, "preContext in UParseError for ucol_openRules does not match\n");
+ log_err_status(status, "preContext in UParseError for ucol_openRules does not match: \"%s\"\n",
+ aescstrdup(parseError.preContext, -1));
}
if(u_strcmp(parseError.postContext,postContextExp)!=0){
- log_err_status(status, "postContext in UParseError for ucol_openRules does not match\n");
+ log_err_status(status, "postContext in UParseError for ucol_openRules does not match: \"%s\"\n",
+ aescstrdup(parseError.postContext, -1));
}
}
}
"&\\'<\\\\",
"&\\\"<'\\'",
"&'\"'<\\'",
- '\0'
+ NULL
};
const UCollationResult results1098[] = {
const char *keywordValue = NULL;
log_verbose("Number of collator locales returned : %i \n", ucol_countAvailable());
values = ucol_getKeywordValues("collation", &status);
+ while ((keywordValue = uenum_next(values, NULL, &status)) != NULL) {
+ if (strncmp(keywordValue, "private-", 8) == 0) {
+ log_err("ucol_getKeywordValues() returns private collation keyword: %s\n", keywordValue);
+ }
+ }
for (i = 0; i < ucol_countAvailable(); i++) {
uenum_reset(values, &status);
while ((keywordValue = uenum_next(values, NULL, &status)) != NULL) {