[Libreoffice-commits] core.git: sc/qa

Markus Mohrhard markus.mohrhard at googlemail.com
Sat May 13 21:35:09 UTC 2017


 sc/qa/unit/data/gnumeric/universal-content.gnumeric |binary
 sc/qa/unit/filters-test.cxx                         |   15 ++++++++++++++-
 sc/qa/unit/helper/qahelper.cxx                      |    3 ++-
 sc/qa/unit/helper/qahelper.hxx                      |    2 ++
 4 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit c90510acfe1ec042adf27452e311964a770965a6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat May 13 21:48:07 2017 +0200

    add basic universal content test, tdf#107828
    
    Change-Id: Ifb2a867cf2168a5ebf51d4a408d2e2a29032a764
    Reviewed-on: https://gerrit.libreoffice.org/37580
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/qa/unit/data/gnumeric/universal-content.gnumeric b/sc/qa/unit/data/gnumeric/universal-content.gnumeric
new file mode 100644
index 000000000000..440c2feb88d5
Binary files /dev/null and b/sc/qa/unit/data/gnumeric/universal-content.gnumeric differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 0548f1030360..ec5f4cb83c47 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -74,6 +74,7 @@ public:
     void testContentDIF();
     void testContentXLSB();
     void testContentXLS_XML();
+    void testContentGnumeric();
     void testSharedFormulaXLS();
     void testSharedFormulaXLSX();
     void testSheetNamesXLSX();
@@ -96,6 +97,7 @@ public:
     CPPUNIT_TEST(testContentDIF);
     CPPUNIT_TEST(testContentXLSB);
     CPPUNIT_TEST(testContentXLS_XML);
+    CPPUNIT_TEST(testContentGnumeric);
     CPPUNIT_TEST(testSharedFormulaXLS);
     CPPUNIT_TEST(testSharedFormulaXLSX);
     CPPUNIT_TEST(testSheetNamesXLSX);
@@ -230,7 +232,8 @@ void testContentImpl(ScDocument& rDoc, sal_Int32 nFormat ) //same code for ods,
     ASSERT_DOUBLES_EQUAL_MESSAGE("=C1+C2", 11.0, fValue);
 
     //check merged cells import
-    if (nFormat != FORMAT_LOTUS123 && nFormat != FORMAT_DIF && nFormat != FORMAT_XLS_XML)
+    if (nFormat != FORMAT_LOTUS123 && nFormat != FORMAT_DIF && nFormat != FORMAT_XLS_XML
+            && nFormat != FORMAT_GNUMERIC)
     {
         SCCOL nCol = 4;
         SCROW nRow = 1;
@@ -327,6 +330,16 @@ void ScFiltersTest::testContentXLS_XML()
     xDocSh->DoClose();
 }
 
+void ScFiltersTest::testContentGnumeric()
+{
+    ScDocShellRef xDocSh = loadDoc("universal-content.", FORMAT_GNUMERIC);
+    CPPUNIT_ASSERT(xDocSh.is());
+
+    ScDocument& rDoc = xDocSh->GetDocument();
+    testContentImpl(rDoc, FORMAT_GNUMERIC);
+    xDocSh->DoClose();
+}
+
 void ScFiltersTest::testSharedFormulaXLS()
 {
     ScDocShellRef xDocSh = loadDoc("shared-formula/basic.", FORMAT_XLS);
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index c8ac3457f1f6..5f37dd9ed0fa 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -82,7 +82,8 @@ const FileFormat ScBootstrapFixture::aFileFormats[] = {
     { "dif", "DIF", "calc_DIF", DIF_FORMAT_TYPE },
     { "xml", "MS Excel 2003 XML", "calc_MS_Excel_2003_XML", XLS_XML_FORMAT_TYPE },
     { "xlsb", "Calc MS Excel 2007 Binary", "MS Excel 2007 Binary", XLSB_XML_FORMAT_TYPE },
-    { "fods", "OpenDocument Spreadsheet Flat XML", "calc_ODS_FlatXML", FODS_FORMAT_TYPE }
+    { "fods", "OpenDocument Spreadsheet Flat XML", "calc_ODS_FlatXML", FODS_FORMAT_TYPE },
+    { "gnumeric", "Gnumeric Spreadsheet", "Gnumerix XML", GNUMERIC_FORMAT_TYPE }
 };
 
 bool testEqualsWithTolerance( long nVal1, long nVal2, long nTol )
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index cc4f5d40adc3..4e93f968611e 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -52,6 +52,7 @@
 #define XLS_XML_FORMAT_TYPE  (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::STARONEFILTER)
 #define XLSB_XML_FORMAT_TYPE (SfxFilterFlags::IMPORT |                          SfxFilterFlags::ALIEN | SfxFilterFlags::STARONEFILTER | SfxFilterFlags::PREFERED)
 #define FODS_FORMAT_TYPE     (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::OWN | SfxFilterFlags::STARONEFILTER )
+#define GNUMERIC_FORMAT_TYPE (SfxFilterFlags::IMPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::PREFERED )
 
 #define FORMAT_ODS      0
 #define FORMAT_XLS      1
@@ -64,6 +65,7 @@
 #define FORMAT_XLS_XML  8
 #define FORMAT_XLSB     9
 #define FORMAT_FODS     10
+#define FORMAT_GNUMERIC 11
 
 enum class StringType { PureString, StringValue };
 


More information about the Libreoffice-commits mailing list