summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-06-09 23:41:36 +0200
committerEike Rathke <erack@redhat.com>2015-06-09 23:42:54 +0200
commit782c116b5ac39aef27c3a00f7fc145c9f755e3a3 (patch)
treeaf2ab2acb94c6ae3e431b891160def268955a047
parent20e4ccc6ba366cd70c9218e016ccff4025e3d816 (diff)
more tests for the implemented cases, tdf#90001
Change-Id: Iec22ad67c9deaada827ba8eac47581e08f934353
-rw-r--r--sc/qa/unit/ucalc_formula.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 9a0fb334efac..ed49635b8556 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -1616,6 +1616,35 @@ void Test::testFormulaRefUpdateSheetsDelete()
m_pDoc->InsertTab(2, "Sheet3");
m_pDoc->InsertTab(3, "Sheet4");
+ m_pDoc->SetString(ScAddress(4,1,0), "=SUM(Sheet2.A4:Sheet4.A4)");
+ m_pDoc->SetString(ScAddress(4,2,0), "=SUM($Sheet2.A4:$Sheet4.A4)");
+ m_pDoc->DeleteTab(1);
+ if (!checkFormula(*m_pDoc, ScAddress(4,1,0), "SUM(Sheet3.A4:Sheet4.A4)"))
+ CPPUNIT_FAIL("Wrong Formula");
+ if (!checkFormula(*m_pDoc, ScAddress(4,2,0), "SUM($Sheet3.A4:$Sheet4.A4)"))
+ CPPUNIT_FAIL("Wrong Formula");
+ m_pDoc->InsertTab(1, "Sheet2");
+
+ m_pDoc->SetString(ScAddress(5,1,3), "=SUM(Sheet1.A5:Sheet3.A5)");
+ m_pDoc->SetString(ScAddress(5,2,3), "=SUM($Sheet1.A5:$Sheet3.A5)");
+ m_pDoc->DeleteTab(2);
+ if (!checkFormula(*m_pDoc, ScAddress(5,1,2), "SUM(Sheet1.A5:Sheet2.A5)"))
+ CPPUNIT_FAIL("Wrong Formula");
+ if (!checkFormula(*m_pDoc, ScAddress(5,2,2), "SUM($Sheet1.A5:$Sheet2.A5)"))
+ CPPUNIT_FAIL("Wrong Formula");
+ m_pDoc->InsertTab(2, "Sheet3");
+
+ m_pDoc->SetString(ScAddress(6,1,3), "=SUM(Sheet1.A6:Sheet3.A6)");
+ m_pDoc->SetString(ScAddress(6,2,3), "=SUM($Sheet1.A6:$Sheet3.A6)");
+ m_pDoc->DeleteTabs(0,3);
+ if (!checkFormula(*m_pDoc, ScAddress(6,1,0), "SUM(#REF!.A6:#REF!.A6)"))
+ CPPUNIT_FAIL("Wrong Formula");
+ if (!checkFormula(*m_pDoc, ScAddress(6,2,0), "SUM($#REF!.A6:$#REF!.A6)"))
+ CPPUNIT_FAIL("Wrong Formula");
+ m_pDoc->InsertTab(0, "Sheet1");
+ m_pDoc->InsertTab(1, "Sheet2");
+ m_pDoc->InsertTab(2, "Sheet3");
+
m_pDoc->SetString(ScAddress(1,1,1), "=SUM(Sheet1.A2:Sheet3.A2");
m_pDoc->SetString(ScAddress(2,1,1), "=SUM(Sheet1.A1:Sheet2.A1");
m_pDoc->SetString(ScAddress(3,1,1), "=SUM(Sheet2.A3:Sheet4.A3");