]> granicus.if.org Git - icu/commitdiff
ICU-8624 Updated the test case in the previous change to show the current case first...
authorYoshito Umaoka <y.umaoka@gmail.com>
Mon, 20 Jun 2011 17:19:35 +0000 (17:19 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Mon, 20 Jun 2011 17:19:35 +0000 (17:19 +0000)
X-SVN-Rev: 30221

icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationRegressionTest.java

index 7224339362bda8c9a1b3dbc29e7245597bd720f6..cc4fe20e46c0e41b8737d671d8e562df7feb1be5 100644 (file)
@@ -1189,16 +1189,16 @@ public class CollationRegressionTest extends TestFmwk {
     public void TestCaseFirstCompression() {
         RuleBasedCollator col = (RuleBasedCollator)Collator.getInstance(Locale.US);
 
-        // default
-        caseFirstCompressionSub(col);
+        // Default
+        caseFirstCompressionSub(col, "default");
 
         // Upper first
         col.setUpperCaseFirst(true);
-        caseFirstCompressionSub(col);
+        caseFirstCompressionSub(col, "upper first");
 
         // Lower first
         col.setLowerCaseFirst(true);
-        caseFirstCompressionSub(col);
+        caseFirstCompressionSub(col, "lower first");
     }
 
     /*
@@ -1206,14 +1206,14 @@ public class CollationRegressionTest extends TestFmwk {
      * Collation#compare and CollationKey#compareTo, called from
      * TestCaseFirstCompression.
      */
-    private void caseFirstCompressionSub(Collator col) {
+    private void caseFirstCompressionSub(RuleBasedCollator col, String opt) {
         final int maxLength = 50;
 
         StringBuilder buf1 = new StringBuilder();
         StringBuilder buf2 = new StringBuilder();
         String str1, str2;
 
-        for (int n = 1; n < maxLength; n++) {
+        for (int n = 1; n <= maxLength; n++) {
             buf1.setLength(0);
             buf2.setLength(0);
 
@@ -1234,7 +1234,7 @@ public class CollationRegressionTest extends TestFmwk {
             int cmpCol = col.compare(str1, str2);
 
             if ((cmpKey < 0 && cmpCol >= 0) || (cmpKey > 0 && cmpCol <= 0) || (cmpKey == 0 && cmpCol != 0)) {
-                errln("Inconsistent comparison: str1=" + str1 + ", str2=" + str2 + ", cmpKey=" + cmpKey + " , cmpCol=" + cmpCol);
+                errln("Inconsistent comparison(" + opt + "): str1=" + str1 + ", str2=" + str2 + ", cmpKey=" + cmpKey + " , cmpCol=" + cmpCol);
             }
         }
     }