Kaydet (Commit) cef9cf59 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Test joining two disjoint ranges into one by adding a third inbetween

In particular, the case where the third one even overlaps one of the
existing ones, not just borders it.

Change-Id: I3a0dff51a68b048b615f60e579e6e698518cf1bd
üst ab65fe80
......@@ -46,6 +46,7 @@ public:
void testJoin_Case2();
void testJoin_Case3();
void testJoin_Case4();
void testJoin_Case5();
void testGetIntersectedRange();
void testUpdateReference_DeleteRow();
......@@ -76,6 +77,7 @@ public:
CPPUNIT_TEST(testJoin_Case2);
CPPUNIT_TEST(testJoin_Case3);
CPPUNIT_TEST(testJoin_Case4);
CPPUNIT_TEST(testJoin_Case5);
CPPUNIT_TEST(testUpdateReference_DeleteRow);
CPPUNIT_TEST(testUpdateReference_DeleteLastRow);
CPPUNIT_TEST(testUpdateReference_DeleteCol);
......@@ -481,6 +483,24 @@ void Test::testJoin_Case4()
CPPUNIT_ASSERT_EQUAL(ScRange(1,1,0,8,8,0), *aList2[0]);
}
void Test::testJoin_Case5()
{
ScRangeList aList;
aList.Join(ScRange(0,0,0,4,4,0));
aList.Join(ScRange(8,0,0,10,4,0));
// Nothing special so far, two disjoint ranges
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aList.size());
CPPUNIT_ASSERT_EQUAL(ScRange(0,0,0,4,4,0), *aList[0]);
CPPUNIT_ASSERT_EQUAL(ScRange(8,0,0,10,4,0), *aList[1]);
// This should join the two ranges into one
aList.Join(ScRange(5,0,0,9,4,0));
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size());
CPPUNIT_ASSERT_EQUAL(ScRange(0,0,0,10,4,0), *aList[0]);
}
void Test::testUpdateReference_DeleteRow()
{
ScRangeList aList(ScRange(1,1,0,4,4,0));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment