[Libreoffice-commits] .: sc/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 14 10:31:42 PDT 2012


 sc/qa/unit/ucalc.cxx |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit 3ed834ae87eca0f6c486666699112a95edb74abb
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Sep 14 12:18:02 2012 -0400

    Unit test for ScRangeList. For now it's very basic. May expand later.
    
    Change-Id: Ib7454253df250ddc991aed0dd5cd5b0f90476dd8

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 0dd8e4e..5a2043a 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");


More information about the Libreoffice-commits mailing list