From 8c205bfccdf625d70cfc9fcf617f89548c1521b1 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 28 Aug 2012 12:14:15 +0100 Subject: Related: #i58513# add regression test for Finnish break iterator rules Change-Id: I5b8c1190db08f781143fd8d12b007dc05a4d6046 --- i18npool/qa/cppunit/test_breakiterator.cxx | 40 ++++++++++++++++++++++++++++++ i18npool/source/breakiterator/data/README | 8 +----- 2 files changed, 41 insertions(+), 7 deletions(-) (limited to 'i18npool') 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 diff --git a/i18npool/source/breakiterator/data/README b/i18npool/source/breakiterator/data/README index e50b0613eda5..7d67cf0c6766 100644 --- a/i18npool/source/breakiterator/data/README +++ b/i18npool/source/breakiterator/data/README @@ -354,13 +354,6 @@ Date: Tue Oct 24 12:53:13 2006 +0000 INTEGRATION: CWS tl29 (1.12.24); FILE MERGED 2006/09/20 01:24:53 khong 1.12.24.1: #i69482# fixed mismatch of nextWord and getWordBoundary -commit be43820c99d96a9e03e2ec5871f6259283b53b58 -Author: Rüdiger Timm -Date: Thu May 4 08:11:17 2006 +0000 - - INTEGRATION: CWS locales203 (1.1.2); FILE ADDED - 2006/04/25 22:47:02 khong 1.1.2.1: #i58513 add break iterator rules for Finish - commit 97d89862a2285071202cc8010d888ffcbf96279a Author: Jens-Heiner Rechtien Date: Thu Nov 17 19:30:35 2005 +0000 @@ -592,6 +585,7 @@ Date: Mon Mar 8 16:17:05 2004 +0000 done, regression tests added: +#i58513# add break iterator rules for Finish #i19716# fix wrong line break on bracket characters #i21290# extend Greek script type #i21907# fix isBeginWord and isEndWord problem -- cgit