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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 8 21:06:03 UTC 2020


 sc/qa/unit/data/xls/tdf81470.xls      |binary
 sc/qa/unit/subsequent_export-test.cxx |   24 ++++++++++++++++++++++++
 2 files changed, 24 insertions(+)

New commits:
commit 43ba50e1ce8d4dfb94650abf562c1db9be3405e5
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Jun 8 14:31:15 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Jun 8 23:05:08 2020 +0200

    tdf#81470: sc: Add unittest
    
    Change-Id: Ie31b206fced1d91861033af65e052f129dad4275
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95804
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/qa/unit/data/xls/tdf81470.xls b/sc/qa/unit/data/xls/tdf81470.xls
new file mode 100644
index 000000000000..5389fbbe22d5
Binary files /dev/null and b/sc/qa/unit/data/xls/tdf81470.xls differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 9e685e502093..95b69860433b 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -247,6 +247,7 @@ public:
     void testTdf128976();
     void testTdf120502();
     void testTdf131372();
+    void testTdf81470();
     void testTdf122331();
     void testTdf83779();
 
@@ -394,6 +395,7 @@ public:
     CPPUNIT_TEST(testTdf128976);
     CPPUNIT_TEST(testTdf120502);
     CPPUNIT_TEST(testTdf131372);
+    CPPUNIT_TEST(testTdf81470);
     CPPUNIT_TEST(testTdf122331);
     CPPUNIT_TEST(testTdf83779);
 
@@ -5030,6 +5032,28 @@ void ScExportTest::testTdf131372()
     assertXPathContent(pSheet, "/x:worksheet/x:sheetData/x:row/x:c[1]/x:f", "NA()");
     assertXPathContent(pSheet, "/x:worksheet/x:sheetData/x:row/x:c[2]/x:f", "#N/A");
 
+    xShell->DoClose();
+
+}
+void ScExportTest::testTdf81470()
+{
+    ScDocShellRef xShell = loadDoc("tdf81470.", FORMAT_XLS);
+    CPPUNIT_ASSERT(xShell);
+
+    //without the fix in place, it would have crashed at export time
+    auto pXPathFile = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX);
+
+    //also check revisions are exported
+    xmlDocUniquePtr pHeaders = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/revisions/revisionHeaders.xml");
+    CPPUNIT_ASSERT(pHeaders);
+
+    assertXPath(pHeaders, "/x:headers/x:header[1]", "dateTime", "2014-07-11T13:46:00.000000000Z");
+    assertXPath(pHeaders, "/x:headers/x:header[1]", "userName", "Kohei Yoshida");
+    assertXPath(pHeaders, "/x:headers/x:header[2]", "dateTime", "2014-07-11T18:38:00.000000000Z");
+    assertXPath(pHeaders, "/x:headers/x:header[2]", "userName", "Kohei Yoshida");
+    assertXPath(pHeaders, "/x:headers/x:header[3]", "dateTime", "2014-07-11T18:43:00.000000000Z");
+    assertXPath(pHeaders, "/x:headers/x:header[3]", "userName", "Kohei Yoshida");
+
     xShell->DoClose();
 }
 


More information about the Libreoffice-commits mailing list