summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-09-17 16:07:19 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-09-17 20:52:34 +0200
commitf165111cf4f62353a674bd3497d8cf4a0480a3ab (patch)
tree0f1465cb16e4c5eba04827f33c012e512b560f64 /sc
parentd2092dc56b19c24b481f64fa9708f4ed3f9c8dfb (diff)
one more test for ScRangeList::DeleteArea
Change-Id: I42d31f6653990a81eff815d3d0feffad84b1379e
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/rangelst_test.cxx33
1 files changed, 33 insertions, 0 deletions
diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx
index 290196598ac8..41d459051cec 100644
--- a/sc/qa/unit/rangelst_test.cxx
+++ b/sc/qa/unit/rangelst_test.cxx
@@ -22,11 +22,16 @@ public:
void testDeleteArea_4Ranges();
void testDeleteArea_2Ranges();
+ void testDeleteArea_2Ranges_Case2();
void testDeleteArea_0Ranges();
+ void testUpdateReference_DeleteRow();
+ void testUpdateReference_DeleteCol();
+
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testDeleteArea_4Ranges);
CPPUNIT_TEST(testDeleteArea_2Ranges);
+ CPPUNIT_TEST(testDeleteArea_2Ranges_Case2);
CPPUNIT_TEST(testDeleteArea_0Ranges);
CPPUNIT_TEST_SUITE_END();
@@ -96,6 +101,21 @@ void Test::testDeleteArea_2Ranges()
}
}
+void Test::testDeleteArea_2Ranges_Case2()
+{
+ ScRangeList aList(ScRange(1,1,0,1,5,0));
+ aList.DeleteArea(0,3,0,MAXCOL,3,0);
+
+ for(SCROW nRow = 1; nRow <= 5; ++nRow)
+ {
+ if(nRow == 3)
+ CPPUNIT_ASSERT(!aList.Intersects(ScRange(1,3,0)));
+ else
+ CPPUNIT_ASSERT(aList.Intersects(ScRange(1,nRow,0)));
+ }
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), aList.GetCellCount());
+}
+
void Test::testDeleteArea_0Ranges()
{
ScRangeList aList(ScRange(1,1,0,3,3,0));
@@ -109,6 +129,19 @@ void Test::testDeleteArea_0Ranges()
CPPUNIT_ASSERT(aList.empty());
}
+void Test::testUpdateReference_DeleteRow()
+{
+ ScRangeList aList(ScRange(1,1,0,4,4,0));
+ bool bUpdated = aList.UpdateReference(URM_INSDEL, m_pDoc, ScRange(0,3,0,MAXCOL,MAXROW,0), 0, -1, 0);
+ CPPUNIT_ASSERT(bUpdated);
+
+}
+
+void Test::testUpdateReference_DeleteCol()
+{
+
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();