summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-03-14 16:23:57 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-03-14 17:27:59 +0100
commitbee6568ae5d49f5b697740a23c5a1c6775f64d52 (patch)
treea3de874cc04481d0bf640611a7ea784e19cf948c /sc/qa
parent24e213b11569400751fc54bfbeb5a5f6afdd4172 (diff)
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/parallelism.cxx30
1 files changed, 30 insertions, 0 deletions
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)
{