[Libreoffice-commits] core.git: Branch 'feature/ods-edit-cell-import' - sc/qa

Kohei Yoshida kohei.yoshida at gmail.com
Mon Feb 11 14:50:56 PST 2013


 sc/qa/unit/data/ods/basic-cell-content.ods |binary
 sc/qa/unit/subsequent_filters-test.cxx     |   18 ++++++++++++++++++
 2 files changed, 18 insertions(+)

New commits:
commit 651b55606cdc620f000e27418874d8d84fb2b651
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Mon Feb 11 17:51:22 2013 -0500

    Add new filter test for raw cell value import from ods.
    
    If import of raw cell values doesn't work, all bets are off. Let's make
    sure it does.
    
    We'll add more test cases to this file as the need arises.
    
    Change-Id: I1469c285e6e87056406415bd8c767890c153b2b5

diff --git a/sc/qa/unit/data/ods/basic-cell-content.ods b/sc/qa/unit/data/ods/basic-cell-content.ods
new file mode 100644
index 0000000..70f6b6e
Binary files /dev/null and b/sc/qa/unit/data/ods/basic-cell-content.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 16db954..748922f 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -95,6 +95,7 @@ public:
     virtual void tearDown();
 
     //ods, xls, xlsx filter tests
+    void testBasicCellContentODS();
     void testRangeNameXLS();
     void testRangeNameXLSX();
     void testHardRecalcODS();
@@ -151,6 +152,7 @@ public:
     void testOptimalHeightReset();
 
     CPPUNIT_TEST_SUITE(ScFiltersTest);
+    CPPUNIT_TEST(testBasicCellContentODS);
     CPPUNIT_TEST(testRangeNameXLS);
     CPPUNIT_TEST(testRangeNameXLSX);
     CPPUNIT_TEST(testHardRecalcODS);
@@ -266,6 +268,22 @@ void testRangeNameImpl(ScDocument* pDoc)
 
 }
 
+void ScFiltersTest::testBasicCellContentODS()
+{
+    ScDocShellRef xDocSh = loadDoc("basic-cell-content.", ODS);
+    CPPUNIT_ASSERT_MESSAGE("Failed to load basic-cell-content.ods", xDocSh.Is());
+
+    ScDocument* pDoc = xDocSh->GetDocument();
+    OUString aStr = pDoc->GetString(1, 1, 0); // B2
+    CPPUNIT_ASSERT_EQUAL(OUString("LibreOffice Calc"), aStr);
+    double fVal = pDoc->GetValue(1, 2, 0); // B3
+    CPPUNIT_ASSERT_EQUAL(12345.0, fVal);
+    aStr = pDoc->GetString(1, 3, 0); // B4
+    CPPUNIT_ASSERT_EQUAL(OUString("A < B"), aStr);
+
+    xDocSh->DoClose();
+}
+
 void ScFiltersTest::testRangeNameXLS()
 {
     ScDocShellRef xDocSh = loadDoc("named-ranges-global.", XLS);


More information about the Libreoffice-commits mailing list