diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-06-08 14:31:15 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-06-08 23:05:08 +0200 |
commit | 43ba50e1ce8d4dfb94650abf562c1db9be3405e5 (patch) | |
tree | e6db492912ded80eca5930aa963d38fecfacfc78 | |
parent | cd384e2d31f74223948ea70d8aa3c318d3ceeb50 (diff) |
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@libreoffice.org>
-rw-r--r-- | sc/qa/unit/data/xls/tdf81470.xls | bin | 0 -> 26624 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 24 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/tdf81470.xls b/sc/qa/unit/data/xls/tdf81470.xls Binary files differnew file mode 100644 index 000000000000..5389fbbe22d5 --- /dev/null +++ b/sc/qa/unit/data/xls/tdf81470.xls 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); @@ -5031,6 +5033,28 @@ void ScExportTest::testTdf131372() 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(); } void ScExportTest::testTdf122331() |