summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-07-17 21:26:56 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-07-18 17:27:08 +0100
commitb4f077af546e5e54ed6f12edaae88b69ac052bdf (patch)
treea19498f9a136dfb319567ae4d3650f4adce60c23 /i18npool
parentf1eab266dc8036267e163cd897df95dfd4d20df5 (diff)
move test to right category
Change-Id: If2cb8da2a24331cc01fed85750747fff3d2fc8e0
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/qa/cppunit/test_breakiterator.cxx67
1 files changed, 34 insertions, 33 deletions
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index 3ed44fcb9ff5..28f46b1deec6 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -125,39 +125,6 @@ void TestBreakIterator::testLineBreaking()
CPPUNIT_ASSERT_MESSAGE("Expected a break at the the start of the word", aResult.breakIndex == aWord.getLength()+1);
}
}
-
- //See https://bugs.freedesktop.org/show_bug.cgi?id=49629
- for (int mode = i18n::WordType::ANY_WORD; mode <= i18n::WordType::WORD_COUNT; ++mode)
- {
- //make sure that in all cases isBeginWord and isEndWord matches getWordBoundary
- //
- //test "Word", then "Word\x01" then "Word\x02"
- for (sal_Unicode i = 0; i < 3; ++i)
- {
- ::rtl::OUString aTest("Word");
- if (i > 0)
- aTest += rtl::OUString(i) + rtl::OUString("Word");
- i18n::Boundary aBounds = m_xBreak->getWordBoundary(aTest, 0, aLocale, mode, true);
- switch (mode)
- {
- case i18n::WordType::ANY_WORD:
- CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 4);
- break;
- case i18n::WordType::ANYWORD_IGNOREWHITESPACES:
- CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 4);
- break;
- case i18n::WordType::DICTIONARY_WORD:
- CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 4);
- break;
- case i18n::WordType::WORD_COUNT:
- CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 4);
- break;
- }
-
- CPPUNIT_ASSERT(m_xBreak->isBeginWord(aTest, aBounds.startPos, aLocale, mode));
- CPPUNIT_ASSERT(m_xBreak->isEndWord(aTest, aBounds.endPos, aLocale, mode));
- }
- }
}
//See https://bugs.freedesktop.org/show_bug.cgi?id=49629
@@ -253,6 +220,40 @@ void TestBreakIterator::testWordBoundaries()
aBounds = m_xBreak->getWordBoundary(aTest, 90, aLocale, i18n::WordType::DICTIONARY_WORD, false);
CPPUNIT_ASSERT(aBounds.startPos == 88 && aBounds.endPos == 92);
}
+
+ //See https://bugs.freedesktop.org/show_bug.cgi?id=49629
+ for (int mode = i18n::WordType::ANY_WORD; mode <= i18n::WordType::WORD_COUNT; ++mode)
+ {
+ //make sure that in all cases isBeginWord and isEndWord matches getWordBoundary
+ //
+ //test "Word", then "Word\x01" then "Word\x02"
+ for (sal_Unicode i = 0; i < 3; ++i)
+ {
+ ::rtl::OUString aTest("Word");
+ if (i > 0)
+ aTest += rtl::OUString(i) + rtl::OUString("Word");
+ aBounds = m_xBreak->getWordBoundary(aTest, 0, aLocale, mode, true);
+ switch (mode)
+ {
+ case i18n::WordType::ANY_WORD:
+ CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 4);
+ break;
+ case i18n::WordType::ANYWORD_IGNOREWHITESPACES:
+ CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 4);
+ break;
+ case i18n::WordType::DICTIONARY_WORD:
+ CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 4);
+ break;
+ case i18n::WordType::WORD_COUNT:
+ CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 4);
+ break;
+ }
+
+ CPPUNIT_ASSERT(m_xBreak->isBeginWord(aTest, aBounds.startPos, aLocale, mode));
+ CPPUNIT_ASSERT(m_xBreak->isEndWord(aTest, aBounds.endPos, aLocale, mode));
+ }
+ }
+
}
//See http://qa.openoffice.org/issues/show_bug.cgi?id=111152