summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-09-14 12:18:02 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-09-14 13:31:59 -0400
commit3ed834ae87eca0f6c486666699112a95edb74abb (patch)
treef89d876cc06cfea48110a478516d51c8d183506f
parent0cc522175e1a6519b5bb8d3ac946ad7395c8803b (diff)
Unit test for ScRangeList. For now it's very basic. May expand later.
Change-Id: Ib7454253df250ddc991aed0dd5cd5b0f90476dd8
-rw-r--r--sc/qa/unit/ucalc.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 0dd8e4ea4a22..5a2043a9c55b 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -108,6 +108,7 @@ public:
virtual void tearDown();
void testCollator();
+ void testRangeList();
void testInput();
void testCellFunctions();
@@ -226,6 +227,7 @@ public:
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testCollator);
+ CPPUNIT_TEST(testRangeList);
CPPUNIT_TEST(testInput);
CPPUNIT_TEST(testCellFunctions);
CPPUNIT_TEST(testSheetsFunc);
@@ -357,6 +359,22 @@ void Test::testCollator()
CPPUNIT_ASSERT_MESSAGE("these strings are supposed to be different!", nRes != 0);
}
+void Test::testRangeList()
+{
+ m_pDoc->InsertTab(0, "foo");
+
+ ScRangeList aRL;
+ aRL.Append(ScRange(1,1,0,3,10,0));
+ CPPUNIT_ASSERT_MESSAGE("List should have one range.", aRL.size() == 1);
+ const ScRange* p = aRL[0];
+ CPPUNIT_ASSERT_MESSAGE("Failed to get the range object.", p);
+ CPPUNIT_ASSERT_MESSAGE("Wrong range.", p->aStart == ScAddress(1,1,0) && p->aEnd == ScAddress(3,10,0));
+
+ // TODO: Add more tests here.
+
+ m_pDoc->DeleteTab(0);
+}
+
void Test::testInput()
{
rtl::OUString aTabName("foo");