[PATCH] unit test for i#116701

Korrawit Pruegsanusak (via Code Review) gerrit at gerrit.libreoffice.org
Thu Mar 21 08:59:44 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2896

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/96/2896/1

unit test for i#116701

Change-Id: Id9a9532d0e02b478f7913bc4a687c38f79a3a322
---
M svl/qa/unit/svl.cxx
1 file changed, 45 insertions(+), 0 deletions(-)



diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 26a0b8d..b002e01 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -87,10 +87,12 @@
 
     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 @@
     }
 }
 
+// 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);
 
 }

-- 
To view, visit https://gerrit.libreoffice.org/2896
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9a9532d0e02b478f7913bc4a687c38f79a3a322
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Korrawit Pruegsanusak <detective.conan.1412 at gmail.com>



More information about the LibreOffice mailing list