diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-01-07 12:42:17 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-01-07 20:56:05 +0100 |
commit | 90cc24d4728dc94a30865d3b3af9409d5967b45a (patch) | |
tree | e48072dd42e91f1fb5391fdfd14b8816d3df1747 /sw/qa/extras/odfexport/odfexport.cxx | |
parent | 80f3c0ce51a7f94b127fe7c4dd4dd1d87ce694d6 (diff) |
tdf#139126: sw_odfexport: Add unittest
Change-Id: I28edbe108989470885fa5a0fe58190c0f3657f53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108934
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/extras/odfexport/odfexport.cxx')
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 54dbddf20825..15704c8eeaad 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -232,6 +232,23 @@ DECLARE_ODFEXPORT_TEST(testTdf130314, "tdf130314.docx") CPPUNIT_ASSERT_EQUAL(2, getPages()); } +DECLARE_ODFEXPORT_TEST(testTdf139126, "tdf139126.odt") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + uno::Reference<text::XTextTablesSupplier> xSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XNameAccess> xTables = xSupplier->getTextTables(); + uno::Reference<text::XTextTable> xTable(xTables->getByName("Table1"), uno::UNO_QUERY); + + uno::Reference<text::XTextRange> xD2(xTable->getCellByName("D2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("4.0"), xD2->getString()); + + // Without the fix in place, this test would have failed with + // - Expected: ** Expression is faulty ** + // - Actual : 17976931348623200... + uno::Reference<text::XTextRange> xE2(xTable->getCellByName("E2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("** Expression is faulty **"), xE2->getString()); +} + DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt") { CPPUNIT_ASSERT_EQUAL(1, getShapes()); |