From 9d5b07b9085f97edfff5d4ac474e9711036bb0c4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 28 Oct 2013 15:47:04 +0000 Subject: Related: fdo#69641 add a regression test Change-Id: Icf3324a224d02425acd679a286f3c4a0b7e3ed1c --- .../qa/cppunit/test_characterclassification.cxx | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'i18npool/qa') 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 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(); -- cgit