diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-09-18 04:58:50 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-09-18 06:22:19 +0200 |
commit | 5f0b2c26ce6854463577058ee1d84fefd1889b2c (patch) | |
tree | e5450b9f0946935408da2c7cd2f58ae9dcf55bec /sc | |
parent | 59bdd7aef895256c34f81fb77767cb4972d596ae (diff) |
more tests for ScRangeList::DeleteArea
Change-Id: I1ba3278d8c74c62f28f2b89bec35bc33be477094
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/rangelst_test.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx index 3d6259c6e5b5..a2289b692a92 100644 --- a/sc/qa/unit/rangelst_test.cxx +++ b/sc/qa/unit/rangelst_test.cxx @@ -21,8 +21,10 @@ public: virtual void tearDown(); void testDeleteArea_4Ranges(); + void testDeleteArea_3Ranges(); void testDeleteArea_2Ranges(); void testDeleteArea_2Ranges_Case2(); + void testDeleteArea_1Range(); void testDeleteArea_0Ranges(); void testUpdateReference_DeleteRow(); @@ -30,8 +32,10 @@ public: CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testDeleteArea_4Ranges); + CPPUNIT_TEST(testDeleteArea_3Ranges); CPPUNIT_TEST(testDeleteArea_2Ranges); CPPUNIT_TEST(testDeleteArea_2Ranges_Case2); + CPPUNIT_TEST(testDeleteArea_1Range); CPPUNIT_TEST(testDeleteArea_0Ranges); CPPUNIT_TEST(testUpdateReference_DeleteRow); CPPUNIT_TEST(testUpdateReference_DeleteCol); @@ -81,6 +85,11 @@ void Test::testDeleteArea_4Ranges() } } +void Test::testDeleteArea_3Ranges() +{ + ScRangeList aList(ScRange(1,1,0,6,6,0)); +} + void Test::testDeleteArea_2Ranges() { ScRangeList aList(ScRange(0,0,0,5,5,5)); @@ -118,6 +127,20 @@ void Test::testDeleteArea_2Ranges_Case2() CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), aList.GetCellCount()); } +void Test::testDeleteArea_1Range() +{ + ScRangeList aList(ScRange(1,1,0,3,3,0)); + aList.DeleteArea(1,1,0,2,3,0); + + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size()); + + for(SCROW nRow = 1; nRow <= 3; ++nRow) + { + CPPUNIT_ASSERT(aList.In(ScRange(3,nRow,0))); + } + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList.GetCellCount()); +} + void Test::testDeleteArea_0Ranges() { ScRangeList aList(ScRange(1,1,0,3,3,0)); |