diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-05-15 20:46:27 +0200 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2020-05-16 00:09:25 +0200 |
commit | ec8dc357e68e20fa00a7d37f8c3195f571fb1fa6 (patch) | |
tree | c1098addcea50f950a9636738f0ba5e732d2aa5d /sw/qa/extras/rtfexport | |
parent | 3bc8b14bea3c11159bdbd6fc4f9658fce3ba252e (diff) |
CppUnittest: assert shapes in odf files
found by bin/check-missing-export-asserts.py
Change-Id: I270b5dce748039427aaf5507006a8c145ef1419b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94331
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/extras/rtfexport')
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 5 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport3.cxx | 1 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport4.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport5.cxx | 2 |
4 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index b12fd8ec1db3..76d880c17a0f 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -398,6 +398,7 @@ DECLARE_RTFEXPORT_TEST(testFdo77979, "fdo77979.odt") DECLARE_RTFEXPORT_TEST(testFdo53113, "fdo53113.odt") { + CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); /* * The problem was that a custom shape was missing its second (and all the other remaining) coordinates. @@ -449,6 +450,7 @@ DECLARE_RTFEXPORT_TEST(testFdo55939, "fdo55939.odt") DECLARE_RTFEXPORT_TEST(testTextFrames, "textframes.odt") { + CPPUNIT_ASSERT_EQUAL(3, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The output was simply invalid, so let's check if all 3 frames were imported back. uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); @@ -801,6 +803,7 @@ DECLARE_RTFEXPORT_TEST(testFdo80167, "fdo80167.rtf") DECLARE_RTFEXPORT_TEST(testFdo32613, "fdo32613.odt") { + CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // This was AS_CHARACTER, RTF export did not support writing anchored pictures. CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, @@ -834,6 +837,7 @@ DECLARE_RTFEXPORT_TEST(testTdf113408, "tdf113408.rtf") DECLARE_RTFEXPORT_TEST(testAbi10039, "abi10039.odt") { + CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Make sure we don't just crash on export, and additionally the shape should not be inline (as it's at-page anchored originally). CPPUNIT_ASSERT(text::TextContentAnchorType_AS_CHARACTER @@ -873,6 +877,7 @@ DECLARE_RTFEXPORT_TEST(testNumberingFont, "numbering-font.rtf") DECLARE_RTFEXPORT_TEST(testFdo82860, "fdo82860.odt") { + CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // The problem was that: // 1) The import tried to use fieldmarks for SHAPE fields diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 43c06fd68208..7bb20cbb410e 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -205,6 +205,7 @@ DECLARE_RTFEXPORT_TEST(testTdf117268, "tdf117268.rtf") DECLARE_RTFEXPORT_TEST(testTdf117505, "tdf117505.odt") { + CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles")); uno::Reference<beans::XPropertySet> xFirstPage(xPageStyles->getByName("First Page"), diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index e17d8743b40b..d0906fae9b3a 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -237,6 +237,7 @@ DECLARE_RTFEXPORT_TEST(testBtlrCell, "btlr-cell.rtf") DECLARE_RTFEXPORT_TEST(testTbrlFrame, "tbrl-frame.odt") { + CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); auto nActual = getProperty<sal_Int16>(xShape, "WritingMode"); @@ -249,6 +250,7 @@ DECLARE_RTFEXPORT_TEST(testTbrlFrame, "tbrl-frame.odt") DECLARE_RTFEXPORT_TEST(testBtlrFrame, "btlr-frame.odt") { + CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); auto nActual = getProperty<sal_Int16>(xShape, "WritingMode"); diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index 299cea3bcc90..12023f321232 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -1155,6 +1155,7 @@ DECLARE_RTFEXPORT_TEST(testTdf106950, "tdf106950.rtf") DECLARE_RTFEXPORT_TEST(testTdf116371, "tdf116371.odt") { + CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); auto xShape(getShape(1)); // Without the accompanying fix in place, this test would have failed with @@ -1165,6 +1166,7 @@ DECLARE_RTFEXPORT_TEST(testTdf116371, "tdf116371.odt") DECLARE_RTFEXPORT_TEST(testTdf128320, "tdf128320.odt") { + CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // Shape does exist in RTF output auto xShape(getShape(1)); |