]> granicus.if.org Git - icu/commitdiff
ICU-12918 Dictionary Break Iterator Assertion Failure
authorAndy Heninger <andy.heninger@gmail.com>
Wed, 18 Jan 2017 19:43:01 +0000 (19:43 +0000)
committerAndy Heninger <andy.heninger@gmail.com>
Wed, 18 Jan 2017 19:43:01 +0000 (19:43 +0000)
X-SVN-Rev: 39574

icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITest.java

index c66052f91f3308f6b6ed57aa9797fd65a2f4f35f..07259a5c4bf60a8f1182748bd049b5939a710f79 100644 (file)
@@ -936,4 +936,25 @@ public class RBBITest extends TestFmwk {
             }
         }
     }
+
+    @Test
+    public void TestBug12918() {
+        // This test triggered an assertion failure in ICU4C, in dictbe.cpp
+        // The equivalent code in ICU4J is structured slightly differently,
+        // and does not appear vulnerable to the same issue.
+        //
+        // \u3325 decomposes with normalization, then the CJK dictionary
+        // finds a break within the decomposition.
+
+        String crasherString = "\u3325\u4a16";
+        BreakIterator iter = BreakIterator.getWordInstance(ULocale.ENGLISH);
+        iter.setText(crasherString);
+        iter.first();
+        int pos = 0;
+        int lastPos = -1;
+        while((pos = iter.next()) != BreakIterator.DONE) {
+            assertTrue("", pos > lastPos);
+        }
+    }
+
 }