sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
New commits: commit 69f62aea8bfaa6d80cf9f54bd01e9af6fca0f9bb Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Tue Feb 8 20:20:34 2022 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed Feb 9 08:17:28 2022 +0100 CppunitTest_sw_ooxmlexport: avoid mustTestImportOf() Can use CPPUNIT_TEST_FIXTURE() instead. See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd (CppunitTest_sw_rtfimport: convert one testcase to use CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation. Change-Id: Id86c3c7129fe3f61351325eda8a6f0b44efd2151 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129691 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index d11dc3f7f2e1..d1a348612779 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -38,14 +38,6 @@ public: Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {} protected: - /** - * Denylist handling - */ - bool mustTestImportOf(const char* filename) const override { - // If the testcase is stored in some other format, it's pointless to test. - return OString(filename).endsWith(".docx"); - } - /** * Validation handling */ @@ -87,8 +79,9 @@ CPPUNIT_TEST_FIXTURE(Test, testFooterBodyDistance) // Check for correct header/footer with special first page with TOC inside: // - DECLARE_ODFEXPORT_TEST(testTdf118393, "tdf118393.odt") // - DECLARE_OOXMLEXPORT_TEST(testTdf118393, "tdf118393.odt") -DECLARE_OOXMLEXPORT_TEST(testTdf118393, "tdf118393.odt") +CPPUNIT_TEST_FIXTURE(Test, testTdf118393) { + loadAndReload("tdf118393.odt"); CPPUNIT_ASSERT_EQUAL( 7, getPages() ); // First page has no header/footer @@ -219,8 +212,9 @@ DECLARE_OOXMLEXPORT_TEST(testFirstHeaderFooter, "first-header-footer.docx") CPPUNIT_ASSERT_EQUAL(OUString("Even page footer 2"), parseDump("/root/page[6]/footer/txt/text()")); } -DECLARE_OOXMLEXPORT_TEST(testFirstHeaderFooterB, "first-header-footerB.odt") +CPPUNIT_TEST_FIXTURE(Test, testFirstHeaderFooterB) { + loadAndReload("first-header-footerB.odt"); CPPUNIT_ASSERT_EQUAL( 6, getPages() ); CPPUNIT_ASSERT_EQUAL(OUString("First page header"), parseDump("/root/page[1]/header/txt/text()")); @@ -407,8 +401,9 @@ DECLARE_OOXMLEXPORT_TEST(testNumberingFont, "numbering-font.docx") CPPUNIT_ASSERT_EQUAL(OUString("Verdana"), sOverrideFontName); } -DECLARE_OOXMLEXPORT_TEST(testTdf106541_noinheritChapterNumbering, "tdf106541_noinheritChapterNumbering.odt") +CPPUNIT_TEST_FIXTURE(Test, testTdf106541_noinheritChapterNumbering) { + loadAndReload("tdf106541_noinheritChapterNumbering.odt"); CPPUNIT_ASSERT_EQUAL(1, getPages()); // in LO, it appears that styles based on the Chapter Numbering style explicitly set the // numbering style/outline level to 0 by default, and that LO prevents inheriting directly from "Outline" style. @@ -872,8 +867,9 @@ DECLARE_OOXMLEXPORT_TEST(testEffectExtentMargin, "effectextent-margin.docx") CPPUNIT_ASSERT_EQUAL(oox::drawingml::convertEmuToHmm(114300+95250), getProperty<sal_Int32>(getShape(1), "LeftMargin")); } -DECLARE_OOXMLEXPORT_TEST(testTdf88583, "tdf88583.odt") +CPPUNIT_TEST_FIXTURE(Test, testTdf88583) { + loadAndReload("tdf88583.odt"); CPPUNIT_ASSERT_EQUAL(1, getPages()); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle")); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x00cc00), getProperty<sal_Int32>(getParagraph(1), "FillColor"));