sc/qa/unit/parallelism.cxx |   30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

New commits:
commit 111b6d6c0421f78e383df24d05442b9fe943424a
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Mar 14 16:23:57 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Mar 15 10:23:23 2022 +0100

    tdf#147905: sc_parallelism: Add unittest
    
    Change-Id: Ib71a30d7ef8d907c1fd86e35d3e6cae5c15218bf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131549
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit bee6568ae5d49f5b697740a23c5a1c6775f64d52)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131483

diff --git a/sc/qa/unit/parallelism.cxx b/sc/qa/unit/parallelism.cxx
index 37dcd79e546c..5fc47c23304d 100644
--- a/sc/qa/unit/parallelism.cxx
+++ b/sc/qa/unit/parallelism.cxx
@@ -35,6 +35,7 @@ public:
     void testVLOOKUP();
     void testVLOOKUPSUM();
     void testSingleRef();
+    void testTdf147905();
     void testSUMIFImplicitRange();
     void testFGCycleWithPlainFormulaCell1();
     void testFGCycleWithPlainFormulaCell2();
@@ -54,6 +55,7 @@ public:
     CPPUNIT_TEST(testVLOOKUP);
     CPPUNIT_TEST(testVLOOKUPSUM);
     CPPUNIT_TEST(testSingleRef);
+    CPPUNIT_TEST(testTdf147905);
     CPPUNIT_TEST(testSUMIFImplicitRange);
     CPPUNIT_TEST(testFGCycleWithPlainFormulaCell1);
     CPPUNIT_TEST(testFGCycleWithPlainFormulaCell2);
@@ -400,6 +402,34 @@ void ScParallelismTest::testSingleRef()
     m_pDoc->DeleteTab(0);
 }
 
+void ScParallelismTest::testTdf147905()
+{
+    m_pDoc->InsertTab(0, "1");
+
+    OUString aFormula;
+    const size_t nNumRows = 500;
+    for (size_t i = 0; i < nNumRows; ++i)
+    {
+        m_pDoc->SetString(0, i, 0, "AAAAAAAA");
+        aFormula = "=PROPER($A" + OUString::number(i+1) + ")";
+        m_pDoc->SetFormula(ScAddress(1, i, 0),
+                           aFormula,
+                           formula::FormulaGrammar::GRAM_NATIVE_UI);
+    }
+
+    m_xDocShell->DoHardRecalc();
+
+    for (size_t i = 0; i < nNumRows; ++i)
+    {
+        OString aMsg = "At row " + OString::number(i);
+        CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), OUString("AAAAAAAA"), 
m_pDoc->GetString(0, i, 0));
+
+        // Without the fix in place, this test would have failed here
+        CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), OUString("Aaaaaaaa"), 
m_pDoc->GetString(1, i, 0));
+    }
+    m_pDoc->DeleteTab(0);
+}
+
 // Common test setup steps for testSUMIFImplicitRange*()
 static void lcl_setupCommon(ScDocument* pDoc, size_t nNumRows, size_t 
nConstCellValue)
 {

Reply via email to