[Libreoffice-commits] .: sc/qa

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Mon Oct 17 13:09:26 PDT 2011


 sc/qa/unit/data/contentCSV/matrix.csv |   10 ++++++++++
 sc/qa/unit/data/ods/matrix.ods        |binary
 sc/qa/unit/data/xls/matrix.xls        |binary
 sc/qa/unit/filters-test.cxx           |   27 +++++++++++++++++++++++++++
 4 files changed, 37 insertions(+)

New commits:
commit 92bbd8dcff997c606cf8c5662f0c8b0e5227f44b
Author: Stefan Weigel <stefan.weigel at bildungskreis.org>
Date:   Mon Oct 17 22:03:35 2011 +0200

    add initial test for matrix functions

diff --git a/sc/qa/unit/data/contentCSV/matrix.csv b/sc/qa/unit/data/contentCSV/matrix.csv
new file mode 100755
index 0000000..fb4a329
--- /dev/null
+++ b/sc/qa/unit/data/contentCSV/matrix.csv
@@ -0,0 +1,10 @@
+10,55
+20,54
+30,47
+40,52
+50,50
+60,37
+70,48
+80,55
+90,50
+100,52
diff --git a/sc/qa/unit/data/ods/matrix.ods b/sc/qa/unit/data/ods/matrix.ods
new file mode 100755
index 0000000..3c9f16a
Binary files /dev/null and b/sc/qa/unit/data/ods/matrix.ods differ
diff --git a/sc/qa/unit/data/xls/matrix.xls b/sc/qa/unit/data/xls/matrix.xls
new file mode 100755
index 0000000..73db360
Binary files /dev/null and b/sc/qa/unit/data/xls/matrix.xls differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 1faba35..8b8c8a2 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -166,6 +166,7 @@ public:
     void testFunctions();
     void testDatabaseRanges();
     void testFormats();
+    void testMatrix();
     void testBugFixesODS();
     void testBugFixesXLS();
     void testBugFixesXLSX();
@@ -180,6 +181,7 @@ public:
     CPPUNIT_TEST(testFunctions);
     CPPUNIT_TEST(testDatabaseRanges);
     CPPUNIT_TEST(testFormats);
+    CPPUNIT_TEST(testMatrix);
     CPPUNIT_TEST(testBugFixesODS);
     CPPUNIT_TEST(testBugFixesXLS);
     CPPUNIT_TEST(testBugFixesXLSX);
@@ -531,6 +533,31 @@ void ScFiltersTest::testFormats()
     }
 }
 
+void ScFiltersTest::testMatrix()
+{
+    const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("matrix."));
+    for (int i = 0; i < 2; ++i)
+    {
+        rtl::OUString aFileExtension(aFileFormats[0].pName, strlen(aFileFormats[0].pName), RTL_TEXTENCODING_UTF8 );
+        rtl::OUString aFilterName(aFileFormats[0].pFilterName, strlen(aFileFormats[0].pFilterName), RTL_TEXTENCODING_UTF8) ;
+        rtl::OUString aFileName;
+        createFileURL(aFileNameBase, aFileExtension, aFileName);
+        rtl::OUString aFilterType(aFileFormats[0].pTypeName, strlen(aFileFormats[0].pTypeName), RTL_TEXTENCODING_UTF8);
+        std::cout << aFileFormats[0].pName << " Test" << std::endl;
+        ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[0].nFormatType);
+
+        CPPUNIT_ASSERT_MESSAGE("Failed to load matrix.*", xDocSh.Is());
+        ScDocument* pDoc = xDocSh->GetDocument();
+
+
+        rtl::OUString aCSVFileName;
+        createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("matrix.")), aCSVFileName);
+        testFile(aCSVFileName, pDoc, 0);
+
+        xDocSh->DoClose();
+    }
+}
+
 void ScFiltersTest::testBugFixesODS()
 {
     const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("bug-fixes."));


More information about the Libreoffice-commits mailing list