summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Weigel <stefan.weigel@bildungskreis.org>2011-10-17 22:03:35 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-10-17 22:08:48 +0200
commit92bbd8dcff997c606cf8c5662f0c8b0e5227f44b (patch)
tree34050dd05704544352eba5e0e1836878e8f388e2
parent045e8340a04350b192152bd4918669df9fdd648e (diff)
add initial test for matrix functions
-rwxr-xr-xsc/qa/unit/data/contentCSV/matrix.csv10
-rwxr-xr-xsc/qa/unit/data/ods/matrix.odsbin0 -> 13159 bytes
-rwxr-xr-xsc/qa/unit/data/xls/matrix.xlsbin0 -> 24576 bytes
-rw-r--r--sc/qa/unit/filters-test.cxx27
4 files changed, 37 insertions, 0 deletions
diff --git a/sc/qa/unit/data/contentCSV/matrix.csv b/sc/qa/unit/data/contentCSV/matrix.csv
new file mode 100755
index 000000000000..fb4a32939eab
--- /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 000000000000..3c9f16a4b400
--- /dev/null
+++ b/sc/qa/unit/data/ods/matrix.ods
Binary files differ
diff --git a/sc/qa/unit/data/xls/matrix.xls b/sc/qa/unit/data/xls/matrix.xls
new file mode 100755
index 000000000000..73db360f007e
--- /dev/null
+++ b/sc/qa/unit/data/xls/matrix.xls
Binary files differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 1faba35c5758..8b8c8a240fff 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."));