]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/cintltst/callcoll.c
ICU-551.51.4.tar.gz
[apple/icu.git] / icuSources / test / cintltst / callcoll.c
index 12f9ac3ef58f3ff2b35b9615f81e799b6a1386a3..8e7f9a576f9d1ff04176c044653b3391cfab0421 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1997-2012, International Business Machines Corporation and
+ * Copyright (c) 1997-2014, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 /*******************************************************************************
@@ -398,6 +398,7 @@ static void doTestVariant(UCollator* myCollation, const UChar source[], const UC
 
     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));
@@ -900,6 +901,7 @@ static void TestJB581(void)
     }
     /* 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)
@@ -1010,6 +1012,13 @@ static void TestJB1401(void)
 */
 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)];
@@ -1076,6 +1085,7 @@ static void TestVariableTop(void)
     ucol_close(myCollation);
     enCollation = NULL;
     myCollation = NULL;
+#endif
 }
 
 /**
@@ -1165,13 +1175,13 @@ TestInvalidRules(){
         "& 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;
 
@@ -1190,11 +1200,14 @@ TestInvalidRules(){
         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));
         }
     }  
 }
@@ -1213,7 +1226,7 @@ TestJitterbug1098(){
          "&\\'<\\\\",
          "&\\\"<'\\'",
          "&'\"'<\\'",
-         '\0'
+         NULL
 
     };
     const UCollationResult results1098[] = {
@@ -1305,6 +1318,11 @@ static void TestJ5298(void)
     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) {