diff options
-rw-r--r-- | i18npool/qa/cppunit/test_characterclassification.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/i18npool/qa/cppunit/test_characterclassification.cxx b/i18npool/qa/cppunit/test_characterclassification.cxx index a683c3a50c9a..92066c7395db 100644 --- a/i18npool/qa/cppunit/test_characterclassification.cxx +++ b/i18npool/qa/cppunit/test_characterclassification.cxx @@ -27,9 +27,11 @@ public: virtual void tearDown(); void testTitleCase(); + void testStringType(); CPPUNIT_TEST_SUITE(TestCharacterClassification); CPPUNIT_TEST(testTitleCase); + CPPUNIT_TEST(testStringType); CPPUNIT_TEST_SUITE_END(); private: uno::Reference<i18n::XCharacterClassification> m_xCC; @@ -68,6 +70,30 @@ void TestCharacterClassification::testTitleCase() } } +//https://bugs.freedesktop.org/show_bug.cgi?id=69641 +void TestCharacterClassification::testStringType() +{ + lang::Locale aLocale; + aLocale.Language = OUString("en"); + aLocale.Country = OUString("US"); + + { + //simple case + OUString sTest("Some text"); + sal_Int32 nResult = m_xCC->getStringType(sTest, 0, sTest.getLength(), aLocale); + CPPUNIT_ASSERT_EQUAL(nResult, sal_Int32(230)); + } + + { + //tricky case + const sal_Unicode MATHEMATICAL_ITALIC_SMALL_THETA[] = { 0xD835, 0xDF03 }; + OUString sTest(MATHEMATICAL_ITALIC_SMALL_THETA, SAL_N_ELEMENTS(MATHEMATICAL_ITALIC_SMALL_THETA)); + sal_Int32 nResult = m_xCC->getStringType(sTest, 0, sTest.getLength(), aLocale); + CPPUNIT_ASSERT_EQUAL(nResult, sal_Int32(228)); + } + +} + void TestCharacterClassification::setUp() { BootstrapFixtureBase::setUp(); |