[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 16 21:39:24 UTC 2021


 sc/qa/unit/uicalc/uicalc.cxx |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

New commits:
commit 1a73d70ffc834ff4ff29e13b1d1c06be60ce58b5
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Aug 16 18:56:14 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Aug 16 23:38:39 2021 +0200

    tdf#143896: sc_uicalc: Add unittest
    
    Change-Id: Idb8aa411a9e9d2c83346f21705ff4ae5aef74aab
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120554
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120557

diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index d133876f6d04..432d4d600771 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -165,6 +165,28 @@ ScModelObj* ScUiCalcTest::saveAndReload(css::uno::Reference<css::lang::XComponen
     return pModelObj;
 }
 
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf143896)
+{
+    mxComponent = loadFromDesktop("private:factory/scalc");
+    ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get());
+    CPPUNIT_ASSERT(pModelObj);
+    ScDocument* pDoc = pModelObj->GetDocument();
+    CPPUNIT_ASSERT(pDoc);
+
+    insertStringToCell(*pModelObj, "A2000", "Test");
+
+    CPPUNIT_ASSERT_EQUAL(OUString("Test"), pDoc->GetString(ScAddress(0, 1999, 0)));
+
+    pModelObj = saveAndReload(mxComponent, "Calc Office Open XML");
+    pDoc = pModelObj->GetDocument();
+    CPPUNIT_ASSERT(pDoc);
+
+    // Without the fix in place, this test would have failed with
+    // - Expected: Test
+    // - Actual  :
+    CPPUNIT_ASSERT_EQUAL(OUString("Test"), pDoc->GetString(ScAddress(0, 1999, 0)));
+}
+
 CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf100582)
 {
     ScModelObj* pModelObj = createDoc("tdf100582.xls");


More information about the Libreoffice-commits mailing list