summaryrefslogtreecommitdiff
path: root/i18npool/qa/cppunit
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-05-09 16:28:18 +0100
committerMichael Meeks <michael.meeks@collabora.com>2014-05-12 10:56:33 +0100
commit69a74afb07c7c58b201d315dbd254bc50b9c9f03 (patch)
tree0c81326a377b22ca3f1946d0797907452cf11d15 /i18npool/qa/cppunit
parent22259f02b211694525251afcdba12a5d3a43cbae (diff)
Avoid expensive dlopen thrash for break iterators.
Change-Id: I770c1b3e5164cb486b5a5c2b1259f713914a1bae
Diffstat (limited to 'i18npool/qa/cppunit')
-rw-r--r--i18npool/qa/cppunit/test_breakiterator.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index 6f7b53753dee..36e3d3b808fc 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -68,6 +68,7 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
uno::Reference<i18n::XBreakIterator> m_xBreak;
+ void doTestJapanese(uno::Reference< i18n::XBreakIterator > &xBreak);
};
void TestBreakIterator::testLineBreaking()
@@ -906,7 +907,7 @@ void TestBreakIterator::testKhmer()
}
#endif
-void TestBreakIterator::testJapanese()
+void TestBreakIterator::doTestJapanese(uno::Reference< i18n::XBreakIterator > &xBreak)
{
lang::Locale aLocale;
aLocale.Language = "ja";
@@ -917,7 +918,7 @@ void TestBreakIterator::testJapanese()
const sal_Unicode JAPANESE[] = { 0x30B7, 0x30E3, 0x30C3, 0x30C8, 0x30C0, 0x30A6, 0x30F3 };
OUString aTest(JAPANESE, SAL_N_ELEMENTS(JAPANESE));
- aBounds = m_xBreak->getWordBoundary(aTest, 5, aLocale,
+ aBounds = xBreak->getWordBoundary(aTest, 5, aLocale,
i18n::WordType::DICTIONARY_WORD, true);
CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 7);
@@ -927,18 +928,29 @@ void TestBreakIterator::testJapanese()
const sal_Unicode JAPANESE[] = { 0x9EBB, 0x306E, 0x8449, 0x9EBB, 0x306E, 0x8449 };
OUString aTest(JAPANESE, SAL_N_ELEMENTS(JAPANESE));
- aBounds = m_xBreak->getWordBoundary(aTest, 1, aLocale,
+ aBounds = xBreak->getWordBoundary(aTest, 1, aLocale,
i18n::WordType::DICTIONARY_WORD, true);
CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 3);
- aBounds = m_xBreak->getWordBoundary(aTest, 5, aLocale,
+ aBounds = xBreak->getWordBoundary(aTest, 5, aLocale,
i18n::WordType::DICTIONARY_WORD, true);
CPPUNIT_ASSERT(aBounds.startPos == 3 && aBounds.endPos == 6);
}
}
+void TestBreakIterator::testJapanese()
+{
+ doTestJapanese(m_xBreak);
+
+ // fdo#78479 - test second / cached instantiation of xdictionary
+ uno::Reference< i18n::XBreakIterator > xTmpBreak(m_xSFactory->createInstance(
+ "com.sun.star.i18n.BreakIterator"), uno::UNO_QUERY_THROW);
+
+ doTestJapanese(xTmpBreak);
+}
+
void TestBreakIterator::testChinese()
{
lang::Locale aLocale;