sw/qa/extras/rtfexport/rtfexport5.cxx |   23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

New commits:
commit 678af723a6c0c26f20607532eec4e8a8208234bc
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Tue Jan 4 20:34:17 2022 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Jan 5 08:24:28 2022 +0100

    CppunitTest_sw_rtfexport5: rework to avoid mustTestImportOf()
    
    See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd
    (CppunitTest_sw_rtfimport: convert one testcase to use
    CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation.
    
    Change-Id: Id694d789fdf68dbce4e323b74455798f48be53c1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127972
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx 
b/sw/qa/extras/rtfexport/rtfexport5.cxx
index 28daa538f677..923ece73659f 100644
--- a/sw/qa/extras/rtfexport/rtfexport5.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport5.cxx
@@ -69,14 +69,6 @@ public:
     }
 
 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(".rtf");
-    }
-
     AllSettings m_aSavedSettings;
 };
 
@@ -1172,8 +1164,9 @@ DECLARE_RTFEXPORT_TEST(testTdf106950, "tdf106950.rtf")
         static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xPara, 
"ParaAdjust")));
 }
 
-DECLARE_RTFEXPORT_TEST(testTdf116371, "tdf116371.odt")
+CPPUNIT_TEST_FIXTURE(Test, testTdf116371)
 {
+    loadAndReload("tdf116371.odt");
     CPPUNIT_ASSERT_EQUAL(1, getShapes());
     CPPUNIT_ASSERT_EQUAL(1, getPages());
     auto xShape(getShape(1));
@@ -1218,8 +1211,9 @@ DECLARE_RTFEXPORT_TEST(testTdf133437, "tdf133437.rtf")
     }
 }
 
-DECLARE_RTFEXPORT_TEST(testTdf128320, "tdf128320.odt")
+CPPUNIT_TEST_FIXTURE(Test, testTdf128320)
 {
+    loadAndReload("tdf128320.odt");
     CPPUNIT_ASSERT_EQUAL(1, getShapes());
     CPPUNIT_ASSERT_EQUAL(1, getPages());
     // Shape does exist in RTF output
@@ -1264,8 +1258,9 @@ DECLARE_RTFEXPORT_TEST(testTdf138210, "tdf138210.rtf")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
 }
 
-DECLARE_RTFEXPORT_TEST(testTdf137894, "tdf137894.odt")
+CPPUNIT_TEST_FIXTURE(Test, testTdf137894)
 {
+    loadAndReload("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);
@@ -1281,14 +1276,16 @@ DECLARE_RTFEXPORT_TEST(testTdf137894, "tdf137894.odt")
     CPPUNIT_ASSERT_EQUAL(32.f, getProperty<float>(getRun(getParagraph(2), 1), 
"CharHeightComplex"));
 }
 
-DECLARE_RTFEXPORT_TEST(testTdf138779, "tdf138779.docx")
+CPPUNIT_TEST_FIXTURE(Test, testTdf138779)
 {
+    loadAndReload("tdf138779.docx");
     // The text "2. Kozuka Mincho Pro, 8 pt Ruby ..." has font size 11pt ( was 
20pt ).
     CPPUNIT_ASSERT_EQUAL(11.f, getProperty<float>(getRun(getParagraph(2), 14), 
"CharHeight"));
 }
 
-DECLARE_RTFEXPORT_TEST(testTdf144437, "tdf144437.odt")
+CPPUNIT_TEST_FIXTURE(Test, testTdf144437)
 {
+    loadAndReload("tdf144437.odt");
     SvStream* pStream = maTempFile.GetStream(StreamMode::READ);
     CPPUNIT_ASSERT(pStream);
     OString aRtfContent(read_uInt8s_ToOString(*pStream, pStream->TellEnd()));

Reply via email to