diff options
author | Eike Rathke <erack@redhat.com> | 2015-06-09 23:41:36 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-06-09 23:48:22 +0200 |
commit | d7163dfa5c207f973d226e494c1620651c2b2b75 (patch) | |
tree | d3c91d7d0e8af677c0cb294b8adda6a3e970db7d | |
parent | 78fc4b66fe2d2c9c45cb90202679ebf5f490ffc5 (diff) |
more tests for the implemented cases, tdf#90001
Change-Id: Iec22ad67c9deaada827ba8eac47581e08f934353
(cherry picked from commit 782c116b5ac39aef27c3a00f7fc145c9f755e3a3)
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index fe7d417d6e9d..09ac70ddb0f9 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"); |