summaryrefslogtreecommitdiff
path: root/i18npool/qa
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-28 15:47:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-10-28 15:52:30 +0000
commit9d5b07b9085f97edfff5d4ac474e9711036bb0c4 (patch)
treebb4709e8ab472383be549deefb33a08a31278601 /i18npool/qa
parent507e627d83dbfb6a35677450a3fc42d10c79a82e (diff)
Related: fdo#69641 add a regression test
Change-Id: Icf3324a224d02425acd679a286f3c4a0b7e3ed1c
Diffstat (limited to 'i18npool/qa')
-rw-r--r--i18npool/qa/cppunit/test_characterclassification.cxx26
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();