diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-28 12:14:15 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-08-28 13:26:11 +0100 |
commit | 8c205bfccdf625d70cfc9fcf617f89548c1521b1 (patch) | |
tree | f6c7e3a5ac4af667de0516d7b9571364cd0edafb /i18npool/qa | |
parent | 5eb16c1cf277a8a3514e81e64b211a2e4f4c7a8f (diff) |
Related: #i58513# add regression test for Finnish break iterator rules
Change-Id: I5b8c1190db08f781143fd8d12b007dc05a4d6046
Diffstat (limited to 'i18npool/qa')
-rw-r--r-- | i18npool/qa/cppunit/test_breakiterator.cxx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx index e03fbe40452a..52dc05f1732c 100644 --- a/i18npool/qa/cppunit/test_breakiterator.cxx +++ b/i18npool/qa/cppunit/test_breakiterator.cxx @@ -487,6 +487,46 @@ void TestBreakIterator::testWordBoundaries() while (nPos++ < aTest.getLength()); CPPUNIT_ASSERT(i == SAL_N_ELEMENTS(aExpected)); } + + //See https://issues.apache.org/ooo/show_bug.cgi?id=58513 + { + aLocale.Language = "fi"; + aLocale.Country = "FI"; + + rtl::OUString aTest("Kuorma-auto kaakkois- ja Keski-Suomi"); + + { + sal_Int32 nPos = 0; + sal_Int32 aExpected[] = {12, 22, 25, 36}; + size_t i = 0; + do + { + CPPUNIT_ASSERT(i < SAL_N_ELEMENTS(aExpected)); + nPos = m_xBreak->getWordBoundary(aTest, nPos, aLocale, + i18n::WordType::WORD_COUNT, true).endPos; + CPPUNIT_ASSERT(aExpected[i++] == nPos); + } + while (nPos++ < aTest.getLength()); + CPPUNIT_ASSERT(i == SAL_N_ELEMENTS(aExpected)); + } + + { + sal_Int32 nPos = 0; + sal_Int32 aExpected[] = {0, 11, 12, 21, 22, 24, 25, 36}; + size_t i = 0; + do + { + CPPUNIT_ASSERT(i < SAL_N_ELEMENTS(aExpected)); + aBounds = m_xBreak->getWordBoundary(aTest, nPos, aLocale, + i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT(aExpected[i++] == aBounds.startPos); + CPPUNIT_ASSERT(aExpected[i++] == aBounds.endPos); + nPos = aBounds.endPos; + } + while (nPos++ < aTest.getLength()); + CPPUNIT_ASSERT(i == SAL_N_ELEMENTS(aExpected)); + } + } } //See http://qa.openoffice.org/issues/show_bug.cgi?id=111152 |