diff options
author | Korrawit Pruegsanusak <detective.conan.1412@gmail.com> | 2013-03-21 22:57:37 +0700 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-03-29 14:12:32 +0000 |
commit | e231e6bf27b8f6741ba0a8d3779fd293e5acb1e6 (patch) | |
tree | b067f155fc8a6149f21050e3528fb89c177bb695 /svl/qa | |
parent | a51d6bf40f2bd51263c547943a315a5738c14c13 (diff) |
unit test for i#116701
Change-Id: Id9a9532d0e02b478f7913bc4a687c38f79a3a322
Reviewed-on: https://gerrit.libreoffice.org/2896
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Tested-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'svl/qa')
-rw-r--r-- | svl/qa/unit/svl.cxx | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 0b481b87f238..0b72db3a9000 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -87,10 +87,12 @@ public: void testNumberFormat(); void testFdo60915(); + void testI116701(); CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testNumberFormat); CPPUNIT_TEST(testFdo60915); + CPPUNIT_TEST(testI116701); CPPUNIT_TEST_SUITE_END(); private: @@ -361,6 +363,49 @@ void Test::testFdo60915() } } +// https://issues.apache.org/ooo/show_bug.cgi?id=116701 +void Test::testI116701() +{ + LanguageType eLang = LANGUAGE_CHINESE_TRADITIONAL; + OUString sCode, sExpected; + double fPreviewNumber = 40573; // equals 30/01/2011 + SvNumberFormatter aFormatter(m_xContext, eLang); + // DateFormatskey25 in i18npool/source/localedata/data/zh_TW.xml + sal_Unicode CODE1[] = + { + 0x0047, 0x0047, 0x0047, 0x0045, 0x0045, // GGGEE + 0x0022, 0x5E74, 0x0022, + 0x004D, // M + 0x0022, 0x6708, 0x0022, + 0x0044, // D + 0x0022, 0x65E5, 0x0022 + }; + sCode = OUString(CODE1, SAL_N_ELEMENTS(CODE1)); + sal_Unicode EXPECTED[] = + { + 0x4E2D, 0x83EF, 0x6C11, 0x570B, + 0x0031, 0x0030, 0x0030, // 100 + 0x5E74, + 0x0031, // 1 + 0x6708, + 0x0033, 0x0030, // 30 + 0x65E5 + }; + sExpected = OUString(EXPECTED, SAL_N_ELEMENTS(EXPECTED)); + checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected); + sal_Unicode CODE2[] = + { + 0x0047, 0x0047, 0x0047, 0x0045, // GGGE + 0x0022, 0x5E74, 0x0022, + 0x004D, // M + 0x0022, 0x6708, 0x0022, + 0x0044, // D + 0x0022, 0x65E5, 0x0022 + }; + sCode = OUString(CODE2, SAL_N_ELEMENTS(CODE2)); + checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } |