summaryrefslogtreecommitdiff
path: root/i18npool/qa
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-07-27 15:06:51 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-07-27 15:45:27 +0100
commit2cf7896039fa883901c0524ecbb71dca790bdb84 (patch)
tree1fc08969677748af28755a791a01cd3257783ab3 /i18npool/qa
parentfae17f307efeebf535d5e389e2e829fbd9dace58 (diff)
add regression test for #i21290
Change-Id: Ic60f440f8dc8fcfa76a023557e76fcf8e3c52476
Diffstat (limited to 'i18npool/qa')
-rw-r--r--i18npool/qa/cppunit/test_breakiterator.cxx41
1 files changed, 41 insertions, 0 deletions
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index b04dc531ebec..23a4092d4fc6 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -435,6 +435,47 @@ void TestBreakIterator::testWordBoundaries()
while (nPos++ < aTest.getLength());
CPPUNIT_ASSERT(i == SAL_N_ELEMENTS(aExpected));
}
+
+ //https://issues.apache.org/ooo/show_bug.cgi?id=21290
+ for (int j = 0; j < 2; ++j)
+ {
+ switch (j)
+ {
+ case 0:
+ aLocale.Language = rtl::OUString("en");
+ aLocale.Country = rtl::OUString("US");
+ break;
+ case 1:
+ aLocale.Language = rtl::OUString("grc");
+ aLocale.Country = rtl::OUString();
+ break;
+ default:
+ CPPUNIT_ASSERT(false);
+ break;
+ }
+
+ const sal_Unicode TEST[] =
+ {
+ 0x1F0C, 0x03BD, 0x03B4, 0x03C1, 0x03B1, 0x0020, 0x1F00,
+ 0x03C1, 0x03BD, 0x1F7B, 0x03BC, 0x03B5, 0x03BD, 0x03BF,
+ 0x03C2, 0x0020, 0x1F00, 0x03BB, 0x03BB, 0x0020, 0x1F24,
+ 0x03C3, 0x03B8, 0x03B9, 0x03BF, 0x03BD
+ };
+ rtl::OUString aTest(TEST, SAL_N_ELEMENTS(TEST));
+
+ sal_Int32 nPos = 0;
+ sal_Int32 aExpected[] = {5, 15, 19, 26};
+ size_t i = 0;
+ do
+ {
+ CPPUNIT_ASSERT(i < SAL_N_ELEMENTS(aExpected));
+ nPos = m_xBreak->getWordBoundary(aTest, nPos, aLocale,
+ i18n::WordType::DICTIONARY_WORD, true).endPos;
+ CPPUNIT_ASSERT(aExpected[i++] == nPos);
+ }
+ while (nPos++ < aTest.getLength());
+ CPPUNIT_ASSERT(i == SAL_N_ELEMENTS(aExpected));
+ }
}
//See http://qa.openoffice.org/issues/show_bug.cgi?id=111152