sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 37 ++---
1 file changed, 18 insertions(+), 19 deletions(-)
New commits:
commit de6cd24c4c6de0b05a486b138bf46a1c91f17d50
Author: Miklos Vajna
AuthorDate: Tue May 31 20:18:59 2022 +0200
Commit: Miklos Vajna
CommitDate: Wed Jun 1 08:26:33 2022 +0200
CppunitTest_sw_ooxmlexport13: 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: Ifd4a73bc9f8272ff3f6abdb8d983f9617eb1a959
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135201
Tested-by: Jenkins
Reviewed-by: Miklos Vajna
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index e3525b5991ab..b97b6c241093 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -33,16 +33,6 @@ class Test : public SwModelTestBase
{
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 o3tl::ends_with(filename, ".docx")
-|| filename == std::string_view("ooo39250-1-min.rtf");
-}
};
// TODO: the re-import doesn't work just yet, but that isn't a regression...
@@ -68,8 +58,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf126994_lostPageBreak,
"tdf126994_lostPageBreak.d
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 3, getPages() );
}
-DECLARE_OOXMLEXPORT_TEST(testTdf121374_sectionHF, "tdf121374_sectionHF.odt")
+CPPUNIT_TEST_FIXTURE(Test, testTdf121374_sectionHF)
{
+loadAndReload("tdf121374_sectionHF.odt");
uno::Reference
xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
uno::Reference xFooterText = getProperty<
uno::Reference >(xPageStyle, "FooterText");
CPPUNIT_ASSERT_EQUAL( OUString("footer"), xFooterText->getString() );
@@ -78,8 +69,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121374_sectionHF,
"tdf121374_sectionHF.odt")
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 6, getPages() );
}
-DECLARE_OOXMLEXPORT_TEST(testTdf121374_sectionHF2, "tdf121374_sectionHF2.doc")
+CPPUNIT_TEST_FIXTURE(Test, testTdf121374_sectionHF2)
{
+loadAndReload("tdf121374_sectionHF2.doc");
uno::Reference
xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
uno::Reference xHeaderText = getProperty<
uno::Reference >(xPageStyle, "HeaderText");
CPPUNIT_ASSERT( xHeaderText->getString().startsWith("virkamatka-anomus") );
@@ -343,8 +335,9 @@ DECLARE_OOXMLEXPORT_TEST(testBtlrShape, "btlr-textbox.docx")
rFormats[1]->GetAttrSet().GetFrameDir().GetValue());
}
-DECLARE_OOXMLEXPORT_TEST(testTdf127316_autoEscapement,
"tdf127316_autoEscapement.odt")
+CPPUNIT_TEST_FIXTURE(Test, testTdf127316_autoEscapement)
{
+loadAndReload("tdf127316_autoEscapement.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
// This should be roughly .8*35% of the ORIGINAL(non-reduced) size.
However, during export the
// proportional height has to be changed into direct formatting, which
then changes the relative percent.
@@ -385,8 +378,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99602_charStyleSubscript,
"tdf99602_charStyleSub
CPPUNIT_ASSERT_EQUAL( sal_Int16(DFLT_ESC_PROP),
getProperty(getRun(xPara, 2), "CharEscapementHeight") );
}
-DECLARE_OOXMLEXPORT_TEST(testTdf99602_charStyleSubscript2,
"tdf99602_charStyleSubscript2.odt")
+CPPUNIT_TEST_FIXTURE(Test, testTdf99602_charStyleSubscript2)
{
+loadAndReload("tdf99602_charStyleSubscript2.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
// *_In styles_*, don't let the proportionality/escapement affect the
fontsize - otherwise it starts doubling up,
// so instead just throw away the values and use the default settings
instead - meaning fontsize is unaffected.
@@ -496,8 +490,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle2,
"tdf118947_tableStyle2.docx"
static_cast(getProperty(xPara,
"ParaAdjust")));
}
-DECLARE_OOXMLEXPORT_TEST(tdf123912_protectedForm,
"tdf123912_protectedForm.odt")
+CPPUNIT_TEST_FIXTURE(Test, tdf123912_protectedForm)
{
+loadAndReload("tdf123912_protectedForm.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
@@ -553,8 +548,9 @@ CPPUNIT_TEST_FIXTURE(Test, testDateControl)
CPPUNIT_ASSERT_EQUAL(OUString(""), sCurrentDate);
}
-DECLARE_OOXMLEXPORT_TEST(testTdf121867, "tdf121867.odt")
+CPPUNIT_TEST_FIXTURE(Test, testTdf121867)
{
+loadAndReload("tdf121867.odt");