From: Andy Heninger Date: Wed, 18 Jan 2017 19:43:01 +0000 (+0000) Subject: ICU-12918 Dictionary Break Iterator Assertion Failure X-Git-Tag: milestone-59-0-1~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b63a4751fae81b3b0a940813f795c2dfa5dc4203;p=icu ICU-12918 Dictionary Break Iterator Assertion Failure X-SVN-Rev: 39574 --- diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITest.java index c66052f91f3..07259a5c4bf 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITest.java @@ -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); + } + } + }