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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 24 16:24:07 UTC 2021


 sw/qa/extras/odfexport/odfexport.cxx       |   13 +++++++++++++
 sw/qa/extras/odfexport/odfexport2.cxx      |    9 +++++++++
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx |    4 ++++
 sw/qa/extras/ooxmlexport/ooxmlexport12.cxx |    1 +
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx |    2 ++
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx |    5 +++++
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx |   24 ++++++++++++++++++++++++
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx  |    3 +++
 sw/qa/extras/rtfexport/rtfexport5.cxx      |    1 +
 sw/qa/extras/ww8export/ww8export3.cxx      |   15 ++++++++++-----
 10 files changed, 72 insertions(+), 5 deletions(-)

New commits:
commit fb7d05f3d56c3e21ed7ba5cf8723a02801640caa
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Sep 24 15:30:13 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Sep 24 18:23:28 2021 +0200

    CppUnittest: sw: add missing asserts to odf files
    
    Change-Id: I59036904483d4ed04481b034183bf17c3ec21bdb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122594
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 905c3e949a19..db4cc260eefd 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -134,6 +134,8 @@ DECLARE_ODFEXPORT_TEST(testMathObjectFlatExport, "2_MathType3.docx")
 
 DECLARE_ODFEXPORT_TEST(testTdf144319, "tdf144319.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(7, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     OUString formula1(getFormula(getRun(getParagraph(3), 1)));
     CPPUNIT_ASSERT_EQUAL(OUString("{ x = frac { { - b +- sqrt { b ^ 2 - 4 a c } } } { { 2 a } } }"), formula1);
     OUString formula2(getFormula(getRun(getParagraph(4), 1)));
@@ -252,6 +254,8 @@ DECLARE_ODFEXPORT_TEST(testTdf130314, "tdf130314.docx")
 
 DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTdf133487, "MadeByLO7.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(3, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
     // shape in background has lowest index
     assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:custom-shape", "z-index", "0");
@@ -266,6 +270,8 @@ DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTdf133487, "MadeByLO7.odt")
 
 DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTdf141467, "Formcontrol needs high z-index.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(2, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
     // shape in foreground has lowest index
     assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:custom-shape", "z-index", "0");
@@ -1877,6 +1883,7 @@ DECLARE_ODFEXPORT_TEST(testTdf118393, "tdf118393.odt")
 
 DECLARE_ODFEXPORT_TEST(testTdf135338_firstLeftPageFooter, "tdf135338_firstLeftPageFooter.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(6, getPages());
     // The first page is a left page only style, but it should still show the first page footer
     // instead of the left footer text "EVEN/LEFT (Left page only)"
     CPPUNIT_ASSERT_EQUAL(OUString("First (Left page only)"),  parseDump("/root/page[2]/footer/txt/text()"));
@@ -1936,6 +1943,7 @@ DECLARE_ODFEXPORT_TEST(testMasterPageWithDrawingPage, "sw_hatch.odt")
 
 DECLARE_ODFEXPORT_EXPORTONLY_TEST(testPageStyleBackgroundFullSizeOOo, "pagestyle_background_ooo33.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(3, getPages());
     xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
     // Standard
     assertXPath(pXmlDoc,
@@ -1992,6 +2000,7 @@ DECLARE_ODFEXPORT_EXPORTONLY_TEST(testPageStyleBackgroundFullSizeOOo, "pagestyle
 
 DECLARE_ODFEXPORT_EXPORTONLY_TEST(testPageStyleBackgroundFullSizeLO64, "pagestyle_background_lo64.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(6, getPages());
     xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
     // Standard
     assertXPath(pXmlDoc,
@@ -2099,6 +2108,7 @@ DECLARE_ODFEXPORT_EXPORTONLY_TEST(testPageStyleBackgroundFullSizeLO64, "pagestyl
 
 DECLARE_ODFEXPORT_EXPORTONLY_TEST(testPageStyleBackgroundFullSizeLO70, "pagestyle_background_lo70.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(6, getPages());
     xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
     // Standard
     assertXPath(pXmlDoc,
@@ -2206,6 +2216,8 @@ DECLARE_ODFEXPORT_EXPORTONLY_TEST(testPageStyleBackgroundFullSizeLO70, "pagestyl
 
 DECLARE_ODFEXPORT_EXPORTONLY_TEST(testFillBitmapUnused, "fillbitmap3.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(4, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // nav_5f_home and all its references are completely gone
     xmlDocUniquePtr pXmlDoc = parseExport("styles.xml");
 
@@ -3135,6 +3147,7 @@ DECLARE_ODFEXPORT_EXPORTONLY_TEST(tdf135942, "nestedTableInFooter.odt")
 
 DECLARE_ODFEXPORT_TEST(testGutterLeft, "gutter-left.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     uno::Reference<beans::XPropertySet> xPageStyle;
     getStyles("PageStyles")->getByName("Standard") >>= xPageStyle;
     sal_Int32 nGutterMargin{};
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx
index f234f2a2a88b..bb05521f08fc 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -32,6 +32,7 @@ public:
 
 DECLARE_ODFEXPORT_TEST(testTdf52065_centerTabs, "testTdf52065_centerTabs.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     sal_Int32 nTabStop = parseDump("//body/txt[4]/Text[3]", "nWidth").toInt32();
     // Without the fix, the text was unseen, with a tabstop width of 64057. It should be 3057
     CPPUNIT_ASSERT(nTabStop < 4000);
@@ -41,6 +42,8 @@ DECLARE_ODFEXPORT_TEST(testTdf52065_centerTabs, "testTdf52065_centerTabs.odt")
 
 DECLARE_ODFEXPORT_TEST(testTdf104254_noHeaderWrapping, "tdf104254_noHeaderWrapping.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     xmlDocUniquePtr pXmlDoc = parseLayoutDump();
 
     sal_Int32 nParaHeight = getXPath(pXmlDoc, "//header/txt[1]/infos/bounds", "height").toInt32();
@@ -51,6 +54,7 @@ DECLARE_ODFEXPORT_TEST(testTdf104254_noHeaderWrapping, "tdf104254_noHeaderWrappi
 
 DECLARE_ODFEXPORT_TEST(testTdf143793_noBodyWrapping, "tdf143793_noBodyWrapping.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(2, getShapes());
     // Preserve old document wrapping. Compat "Use OOo 1.1 text wrapping around objects"
     // Originally, the body text did not wrap around spill-over header images
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "Fits on one page", 1, getPages() );
@@ -76,6 +80,7 @@ DECLARE_ODFEXPORT_TEST(testTdf137199, "tdf137199.docx")
 
 DECLARE_ODFEXPORT_TEST(testTdf143605, "tdf143605.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // With numbering type "none" there should be nothing
     CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(getParagraph(1), "ListLabelString"));
 }
@@ -114,6 +119,8 @@ DECLARE_ODFEXPORT_TEST(testListFormatDocx, "listformat.docx")
 
 DECLARE_ODFEXPORT_TEST(testShapeWithHyperlink, "shape-with-hyperlink.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml"))
     {
         // Check how conversion from prefix/suffix to list format did work
@@ -124,6 +131,7 @@ DECLARE_ODFEXPORT_TEST(testShapeWithHyperlink, "shape-with-hyperlink.odt")
 
 DECLARE_ODFEXPORT_TEST(testShapesHyperlink, "shapes-hyperlink.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     CPPUNIT_ASSERT_EQUAL(5, getShapes());
     uno::Reference<beans::XPropertySet> const xPropSet1(getShape(1), uno::UNO_QUERY);
     CPPUNIT_ASSERT_EQUAL(OUString("http://libreoffice.org/"), getProperty<OUString>(xPropSet1, "Hyperlink"));
@@ -143,6 +151,7 @@ DECLARE_ODFEXPORT_TEST(testShapesHyperlink, "shapes-hyperlink.odt")
 
 DECLARE_ODFEXPORT_TEST(testListFormatOdt, "listformat.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // Ensure in resulting ODT we also have not just prefix/suffix, but custom delimiters
     CPPUNIT_ASSERT_EQUAL(OUString(">1<"), getProperty<OUString>(getParagraph(1), "ListLabelString"));
     CPPUNIT_ASSERT_EQUAL(OUString(">>1.1<<"), getProperty<OUString>(getParagraph(2), "ListLabelString"));
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 08e0cbd9f8f7..772a748b396d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -1500,6 +1500,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf67207_MERGEFIELD_DATABASE, "tdf67207.docx")
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf101122_noFillForCustomShape, "tdf101122_noFillForCustomShape.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(2, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // tdf#101122 check whether the "F" (noFill) option has been exported to docx
     xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
 
@@ -1520,6 +1522,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf101122_noFillForCustomShape, "tdf1011
 //
 DECLARE_OOXMLEXPORT_TEST(testTdf124678_case1, "tdf124678_no_leading_paragraph.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(2, getPages());
     CPPUNIT_ASSERT_EQUAL_MESSAGE("First page header text", OUString(""), parseDump("/root/page[1]/header/txt"));
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Second page header text", OUString("HEADER"), parseDump("/root/page[2]/header/txt"));
 }
@@ -1531,6 +1534,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124678_case1, "tdf124678_no_leading_paragraph.od
 //
 DECLARE_OOXMLEXPORT_TEST(testTdf124678_case2, "tdf124678_with_leading_paragraph.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(2, getPages());
     CPPUNIT_ASSERT_EQUAL_MESSAGE("First page header text", OUString(""), parseDump("/root/page[1]/header/txt"));
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Second page header text", OUString("HEADER"), parseDump("/root/page[2]/header/txt"));
 }
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index f2718ad49c38..d485c094ce15 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -923,6 +923,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf117137, "tdf117137.docx")
 
 DECLARE_OOXMLEXPORT_TEST(testTdf138780, "tdf138780.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // Paragraphs were not part of a numbering anymore after roundtrip.
     uno::Reference<beans::XPropertySet> xPara1(getParagraph(1), uno::UNO_QUERY);
     CPPUNIT_ASSERT(xPara1.is());
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 41a5f26acb8b..31631d7d1579 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -185,6 +185,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123873, "tdf123873.docx")
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Tdf133065, "tdf133065.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(7, getShapes());
+    CPPUNIT_ASSERT_EQUAL(3, getPages());
     auto pxmldoc = parseExport("word/document.xml");
     CPPUNIT_ASSERT(pxmldoc);
     OUString aVal;
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index bcf763ab4a0c..9decd693f327 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -48,6 +48,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123621, "tdf123621.docx")
 
 DECLARE_OOXMLEXPORT_TEST(testTdf131540, "tdf131540.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(2, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // There are 2 OLEs test if one of them moved on save:
     CPPUNIT_ASSERT_EQUAL_MESSAGE("The shape1 moved on saving!", text::RelOrientation::PAGE_FRAME,
                                  getProperty<sal_Int16>(getShape(1), "HoriOrientRelation"));
@@ -791,6 +793,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138345_charStyleHighlight, "tdf138345_charStyleH
 
 DECLARE_OOXMLEXPORT_TEST(testTdf125268, "tdf125268.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     const uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(1), 1, "Hello"), uno::UNO_QUERY);
     // Without the fix in place, this test would have failed with
     // - Expected: -1
@@ -921,6 +924,8 @@ DECLARE_OOXMLEXPORT_TEST(TestTdf132483, "tdf132483.docx")
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(TestTdf143028, "fail_bracePair.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     auto pExportXml = parseExport();
 
     CPPUNIT_ASSERT_EQUAL(1, getXPathNode(
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index e2f68bc4e7de..cf5ad5e41fc8 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -76,6 +76,8 @@ protected:
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf143860NonPrimitiveCustomShape,
                                     "tdf143860_NonPrimitiveCustomShape.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // The document has a custom shape of type non-primitive without handles. Make sure that the shape
     // is not exported with preset but with custom geometry.
     xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
@@ -86,6 +88,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf143860NonPrimitiveCustomShape,
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testWrapPolygonCurve, "tdf136386_WrapPolygonCurve.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // Document has a curve with contour wrap and 'outside only'. Error was, that type 'square' was
     // written and no wrap polygon. Make sure we write wrapTight and a wrapPolygon.
     xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
@@ -101,6 +105,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testWrapPolygonCurve, "tdf136386_WrapPolygon
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testWrapPolygonLineShape, "tdf136386_WrapPolygonLineShape.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // Document has a sloping line with contour wrap. Error was, that type 'square' was written and
     // no wrap polygon. Now we write 'through' and use wrap polygon 0|0, 21600|21600, 0|0.
     xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
@@ -116,6 +122,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testWrapPolygonLineShape, "tdf136386_WrapPol
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testWrapPolygonCustomShape,
                                     "tdf142433_WrapPolygonCustomShape.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // Document has 4-point star with contour wrap. Error was, that the enhanced path was written
     // literally as wrap polygon. But that does not work, because path might have links to equations
     // and handles and not only numbers.
@@ -134,6 +142,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testWrapPolygonCustomShape,
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFrameWrapTextMode, "tdf143432_Frame_WrapTextMode.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(2, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
     CPPUNIT_ASSERT(pXmlDocument);
     // Without the fix the value "largest" was written to file in both cases.
@@ -193,6 +203,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf134219ContourWrap_stroke_shadow)
 
 DECLARE_OOXMLEXPORT_TEST(testTdf123569_rotWriterImage, "tdf123569_rotWriterImage_46deg.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(2, getPages());
     uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY);
     // Error was, that position of logical rectangle was treated as position of snap rectangle.
     // Thus a wrong position was calculated.
@@ -215,6 +227,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf142486_LeftMarginShadowLeft, "tdf142486_LeftMarg
 
 DECLARE_OOXMLEXPORT_TEST(testTdf142486_FrameShadow, "tdf142486_FrameShadow.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
     uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(
         xModel->getCurrentController(), uno::UNO_QUERY_THROW);
@@ -233,6 +247,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf142486_FrameShadow, "tdf142486_FrameShadow.odt")
 
 DECLARE_OOXMLEXPORT_TEST(testTdf136059, "tdf136059.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Contour has not been exported!", true,
         getProperty<bool>(getShape(1), "SurroundContour"));
     // With the fix this shall pass, see tdf136059.
@@ -475,6 +491,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf134619_numberingProps, "tdf134619_num
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf134951_duplicates, "tdf134951_duplicates.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(3, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     uno::Reference<text::XEndnotesSupplier> xEndnotesSupplier(mxComponent, uno::UNO_QUERY);
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xEndnotesSupplier->getEndnotes()->getCount());
 
@@ -492,6 +510,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf135773_numberingShading, "tdf135774_n
 
 DECLARE_OOXMLEXPORT_TEST(testTdf140336_paraNoneShading, "tdf140336_paraNoneShading.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // Before the fix, the background from a style was exported to dis-inheriting paragraphs/styles.
     CPPUNIT_ASSERT_EQUAL(sal_uInt32(COL_AUTO), getProperty<sal_uInt32>(getParagraph(1), "ParaBackColor"));
     uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("CanclledBackground"), uno::UNO_QUERY);
@@ -691,6 +710,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138953, "croppedAndRotated.odt")
 
 DECLARE_OOXMLEXPORT_TEST(testTdf118535, "tdf118535.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(2, getShapes());
+    CPPUNIT_ASSERT_EQUAL(2, getPages());
     uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL());
     CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/media/image1.jpeg")));
     // Without the accompanying fix in place, this test would have failed with:
@@ -842,6 +863,8 @@ DECLARE_OOXMLEXPORT_TEST(testCommentDoneModel, "CommentDone.docx")
 
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_ShadowDirection, "tdf142361ShadowDirection.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // The attribute 'rotWithShape' has the default value 'true' in OOXML, so Words interprets a
     // missing attribute as 'true'. That means that Word rotates the shadow if the shape is
     // rotated. Because in LibreOffice a shadow is never rotated, we must not omit this
@@ -895,6 +918,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf139549, "tdf139549.docx")
 
 DECLARE_OOXMLEXPORT_TEST(testTdf143726, "Simple-TOC.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
     CPPUNIT_ASSERT(pXmlStyles);
     // Without the fix this was "TOA Heading" which belongs to the "Table of Authorities" index in Word
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 86a44f551057..5d67ff57170f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -95,6 +95,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92470_footnoteRestart, "tdf92470_footnoteRestart
 
 DECLARE_OOXMLEXPORT_TEST(testTdf108944_footnoteSeparator2, "tdf108944_footnoteSeparator2.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
     //This was zero. The comment was causing the bHasFtnSep flag to be reset to false, so the separator was missing.
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(25), getProperty<sal_Int32>(xPageStyle, "FootnoteLineRelativeWidth"));
@@ -1206,6 +1207,8 @@ CPPUNIT_TEST_FIXTURE(Test, testBodyPrUpright)
 
 DECLARE_OOXMLEXPORT_TEST(testLostArrow, "tdf99810-lost-arrow.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     // tdf#99810: check whether we use normal shape instead of connector shape if the XML namespace
     // is wps, because wps:
     xmlDocUniquePtr pDoc = parseExport("word/document.xml");
diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx
index b1d11df3a0f8..322084db95a1 100644
--- a/sw/qa/extras/rtfexport/rtfexport5.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport5.cxx
@@ -1261,6 +1261,7 @@ DECLARE_RTFEXPORT_TEST(testTdf138210, "tdf138210.rtf")
 
 DECLARE_RTFEXPORT_TEST(testTdf137894, "tdf137894.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     lang::Locale locale1(getProperty<lang::Locale>(getRun(getParagraph(1), 1), "CharLocaleAsian"));
     CPPUNIT_ASSERT_EQUAL(OUString("ja"), locale1.Language);
     CPPUNIT_ASSERT_EQUAL(OUString("MS UI Gothic"),
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index d3a22cb13013..a0df68658947 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -270,6 +270,7 @@ DECLARE_WW8EXPORT_TEST(testdf79553_lineNumbers, "tdf79553_lineNumbers.doc")
 
 DECLARE_WW8EXPORT_TEST(tesTdf138302_restartNumbering, "tdf138302_restartNumbering.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     uno::Reference<beans::XPropertySet> xPara(getParagraph(8), uno::UNO_QUERY);
     CPPUNIT_ASSERT_EQUAL(OUString("1."), getProperty<OUString>(xPara, "ListLabelString"));
 }
@@ -436,11 +437,15 @@ DECLARE_WW8EXPORT_TEST(testTdf120225_textControlCrossRef, "tdf120225_textControl
 
 DECLARE_WW8EXPORT_TEST(testTdf134948, "tdf134948.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Only 1 paragraph", 1, getParagraphs());
 }
 
 DECLARE_WW8EXPORT_TEST(testTdf132726, "tdf132726.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getShapes());
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     uno::Reference<text::XTextRange> xRun = getRun(getParagraph(1), 1, "What sentence has a yellow background? ");
     CPPUNIT_ASSERT_EQUAL( COL_AUTO, Color(ColorTransparency, getProperty<sal_uInt32>(xRun, "CharBackColor")) );
 
@@ -572,6 +577,7 @@ DECLARE_WW8EXPORT_TEST(testTdf128608_tableParaBackColor, "tdf128608_tableParaBac
 
 DECLARE_WW8EXPORT_TEST(testTdf117217_largeTableBackgrounds, "tdf117217_largeTableBackgrounds.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
     uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
     uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
@@ -946,15 +952,14 @@ DECLARE_WW8EXPORT_TEST(testTdf142760, "tdf142760.doc")
 DECLARE_WW8EXPORT_TEST(testTdf134570, "tdf134570.doc")
 {
     CPPUNIT_ASSERT_EQUAL(1, getPages());
-    {
-        uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY);
-        CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), getProperty<sal_Int16>(xPara, "NumberingLevel"));
-        CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(xPara, "ListLabelString"));
-    }
+    uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), getProperty<sal_Int16>(xPara, "NumberingLevel"));
+    CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(xPara, "ListLabelString"));
 }
 
 DECLARE_WW8EXPORT_TEST(testTdf136814, "tdf136814.odt")
 {
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
     uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
     sal_Int32 nBorderDistance = static_cast<sal_Int32>(106);
 


More information about the Libreoffice-commits mailing list