summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-09-11 01:35:39 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-09-13 02:17:19 +0200
commit0bc368babc36542cd157803fb9fefb4260f0a9e2 (patch)
tree7b51a9e124fd1dbe987518cb82705b28889196b5 /sc/qa/unit
parent8b309a9e15c62466dce4dd45059bc5eb8312dd90 (diff)
add files for bugFix tests and restructure filters-test a bit
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/data/ods/bugFixes.odsbin0 -> 9361 bytes
-rw-r--r--sc/qa/unit/data/xls/bugFixes.xlsbin0 -> 5632 bytes
-rw-r--r--sc/qa/unit/data/xlsx/bugFixes.xlsxbin0 -> 4697 bytes
-rw-r--r--sc/qa/unit/filters-test.cxx60
4 files changed, 58 insertions, 2 deletions
diff --git a/sc/qa/unit/data/ods/bugFixes.ods b/sc/qa/unit/data/ods/bugFixes.ods
new file mode 100644
index 000000000000..dcdbd69e66c7
--- /dev/null
+++ b/sc/qa/unit/data/ods/bugFixes.ods
Binary files differ
diff --git a/sc/qa/unit/data/xls/bugFixes.xls b/sc/qa/unit/data/xls/bugFixes.xls
new file mode 100644
index 000000000000..c0cb20a29349
--- /dev/null
+++ b/sc/qa/unit/data/xls/bugFixes.xls
Binary files differ
diff --git a/sc/qa/unit/data/xlsx/bugFixes.xlsx b/sc/qa/unit/data/xlsx/bugFixes.xlsx
new file mode 100644
index 000000000000..7fc481a6e3fc
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/bugFixes.xlsx
Binary files differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 40e64ae3272c..b07af3adc6f9 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -155,12 +155,18 @@ public:
void testContent();
void testContentImpl(ScDocument* pDoc); //same code for ods, xls, xlsx
void testFunctions();
+ void testBugFixesODS();
+ void testBugFixesXLS();
+ void testBugFixesXLSX();
CPPUNIT_TEST_SUITE(FiltersTest);
CPPUNIT_TEST(testCVEs);
CPPUNIT_TEST(testRangeName);
CPPUNIT_TEST(testContent);
CPPUNIT_TEST(testFunctions);
+ CPPUNIT_TEST(testBugFixesODS);
+ CPPUNIT_TEST(testBugFixesXLS);
+ CPPUNIT_TEST(testBugFixesXLSX);
CPPUNIT_TEST_SUITE_END();
private:
@@ -319,7 +325,8 @@ void FiltersTest::testRangeName()
{
rtl::OUString aFileExtension(aFileFormats[i].pName, strlen(aFileFormats[i].pName), RTL_TEXTENCODING_UTF8 );
rtl::OUString aFilterName(aFileFormats[i].pFilterName, strlen(aFileFormats[i].pFilterName), RTL_TEXTENCODING_UTF8) ;
- rtl::OUString aFileName = m_aSrcRoot + m_aBaseString + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + aFileExtension + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + aFileNameBase + aFileExtension;
+ rtl::OUString aFileName;
+ createFilePath( aFileNameBase, aFileExtension, aFileName );
rtl::OUString aFilterType(aFileFormats[i].pTypeName, strlen(aFileFormats[i].pTypeName), RTL_TEXTENCODING_UTF8);
std::cout << aFileFormats[i].pName << " Test" << std::endl;
ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[i].nFormatType);
@@ -373,7 +380,8 @@ void FiltersTest::testContent()
{
rtl::OUString aFileExtension(aFileFormats[i].pName, strlen(aFileFormats[i].pName), RTL_TEXTENCODING_UTF8 );
rtl::OUString aFilterName(aFileFormats[i].pFilterName, strlen(aFileFormats[i].pFilterName), RTL_TEXTENCODING_UTF8) ;
- rtl::OUString aFileName = m_aSrcRoot + m_aBaseString + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + aFileExtension + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + aFileNameBase + aFileExtension;
+ rtl::OUString aFileName;
+ createFilePath(aFileNameBase, aFileExtension, aFileName);
rtl::OUString aFilterType(aFileFormats[i].pTypeName, strlen(aFileFormats[i].pTypeName), RTL_TEXTENCODING_UTF8);
std::cout << aFileFormats[i].pName << " Test" << std::endl;
ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[i].nFormatType);
@@ -402,6 +410,54 @@ void FiltersTest::testFunctions()
testFile(aCSVFileName, pDoc, 0);
}
+void FiltersTest::testBugFixesODS()
+{
+ const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("bugFixes."));
+ 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;
+ createFilePath(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 bugFixes.ods", xDocSh.Is());
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT_MESSAGE("No Document", pDoc); //remove with first test
+}
+
+void FiltersTest::testBugFixesXLS()
+{
+ const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("bugFixes."));
+ rtl::OUString aFileExtension(aFileFormats[1].pName, strlen(aFileFormats[1].pName), RTL_TEXTENCODING_UTF8 );
+ rtl::OUString aFilterName(aFileFormats[1].pFilterName, strlen(aFileFormats[1].pFilterName), RTL_TEXTENCODING_UTF8) ;
+ rtl::OUString aFileName;
+ createFilePath(aFileNameBase, aFileExtension, aFileName);
+ rtl::OUString aFilterType(aFileFormats[1].pTypeName, strlen(aFileFormats[1].pTypeName), RTL_TEXTENCODING_UTF8);
+ std::cout << aFileFormats[1].pName << " Test" << std::endl;
+ ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[1].nFormatType);
+
+ CPPUNIT_ASSERT_MESSAGE("Failed to load bugFixes.xls", xDocSh.Is());
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT_MESSAGE("No Document", pDoc); //remove with first test
+}
+
+void FiltersTest::testBugFixesXLSX()
+{
+ const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("bugFixes."));
+ rtl::OUString aFileExtension(aFileFormats[2].pName, strlen(aFileFormats[2].pName), RTL_TEXTENCODING_UTF8 );
+ rtl::OUString aFilterName(aFileFormats[2].pFilterName, strlen(aFileFormats[2].pFilterName), RTL_TEXTENCODING_UTF8) ;
+ rtl::OUString aFileName;
+ createFilePath(aFileNameBase, aFileExtension, aFileName);
+ rtl::OUString aFilterType(aFileFormats[2].pTypeName, strlen(aFileFormats[2].pTypeName), RTL_TEXTENCODING_UTF8);
+ std::cout << aFileFormats[2].pName << " Test" << std::endl;
+ ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[2].nFormatType);
+
+ CPPUNIT_ASSERT_MESSAGE("Failed to load bugFixes.xlsx", xDocSh.Is());
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT_MESSAGE("No Document", pDoc); //remove with first test
+}
+
FiltersTest::FiltersTest()
: m_aSrcRoot(RTL_CONSTASCII_USTRINGPARAM("file://")),
m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data"))