sw/qa/extras/globalfilter/globalfilter.cxx | 99 +++++++---------------------- 1 file changed, 24 insertions(+), 75 deletions(-)
New commits: commit 7cf00e1bbbff5c79fa5e08c0a03c892f641f0815 Author: Xisco Fauli <[email protected]> AuthorDate: Sat Feb 14 14:14:35 2026 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Sat Feb 14 17:11:24 2026 +0100 CppunitTest_sw_globalfilter: use CPPUNIT_TEST_FIXTURE in preparation for a follow-up commit Change-Id: I041d13e303f31825889e7b266814d6fed441e162 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199375 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 1023e225ff61..6dccf94376d6 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -55,59 +55,10 @@ class Test : public SwModelTestBase public: Test() : SwModelTestBase(u"/sw/qa/extras/globalfilter/data/"_ustr) {} - void testEmbeddedGraphicRoundtrip(); - void testLinkedGraphicRT(); - void testImageWithSpecialID(); - void testGraphicShape(); - void testMultipleIdenticalGraphics(); - void testCharHighlight(); - void testCharHighlightODF(); - void testCharHighlightBody(); - void testCharStyleHighlight(); - void testMSCharBackgroundEditing(); - void testCharBackgroundToHighlighting(); -#if !defined(_WIN32) - void testSkipImages(); -#endif - void testNestedFieldmark(); - void verifyText13(char const*); - void testODF13(); - void testRedlineFlags(); - void testBulletAsImage(); - void testTextFormField(); - void testCheckBoxFormField(); - void testDropDownFormField(); - void testDateFormField(); - void testDateFormFieldCharacterFormatting(); - void testSvgImageSupport(); - - CPPUNIT_TEST_SUITE(Test); - CPPUNIT_TEST(testEmbeddedGraphicRoundtrip); - CPPUNIT_TEST(testLinkedGraphicRT); - CPPUNIT_TEST(testImageWithSpecialID); - CPPUNIT_TEST(testGraphicShape); - CPPUNIT_TEST(testMultipleIdenticalGraphics); - CPPUNIT_TEST(testCharHighlight); - CPPUNIT_TEST(testCharHighlightODF); - CPPUNIT_TEST(testMSCharBackgroundEditing); - CPPUNIT_TEST(testCharBackgroundToHighlighting); -#if !defined(_WIN32) - CPPUNIT_TEST(testSkipImages); -#endif - CPPUNIT_TEST(testNestedFieldmark); - CPPUNIT_TEST(testODF13); - CPPUNIT_TEST(testRedlineFlags); - CPPUNIT_TEST(testBulletAsImage); - CPPUNIT_TEST(testTextFormField); - CPPUNIT_TEST(testCheckBoxFormField); - CPPUNIT_TEST(testDropDownFormField); - CPPUNIT_TEST(testDateFormField); - CPPUNIT_TEST(testDateFormFieldCharacterFormatting); - CPPUNIT_TEST(testSvgImageSupport); - CPPUNIT_TEST_SUITE_END(); + void verifyText13(char const*const pTestName); }; -void Test::testEmbeddedGraphicRoundtrip() +CPPUNIT_TEST_FIXTURE(Test, testEmbeddedGraphicRoundtrip) { TestFilter aFilterNames[] = { TestFilter::ODT, @@ -163,7 +114,7 @@ void Test::testEmbeddedGraphicRoundtrip() } } -void Test::testLinkedGraphicRT() +CPPUNIT_TEST_FIXTURE(Test, testLinkedGraphicRT) { TestFilter aFilterNames[] = { TestFilter::ODT, @@ -216,7 +167,7 @@ void Test::testLinkedGraphicRT() } } -void Test::testImageWithSpecialID() +CPPUNIT_TEST_FIXTURE(Test, testImageWithSpecialID) { // Check how LO handles when the imported graphic's ID is different from that one // which is generated by LO. @@ -299,7 +250,7 @@ uno::Reference<drawing::XShape> lcl_getShape(const uno::Reference<lang::XCompone return xShape; } -void Test::testGraphicShape() +CPPUNIT_TEST_FIXTURE(Test, testGraphicShape) { // There are two kind of images in Writer: 1) Writer specific handled by SwGrfNode and // 2) graphic shape handled by SdrGrafObj (e.g. after copy&paste from Impress). @@ -386,7 +337,7 @@ std::vector<uno::Reference<graphic::XGraphic>> return aGraphics; } -void Test::testMultipleIdenticalGraphics() +CPPUNIT_TEST_FIXTURE(Test, testMultipleIdenticalGraphics) { // We have multiple identical graphics. When we save them we want // them to be saved de-duplicated and the same should still be true @@ -430,7 +381,7 @@ void Test::testMultipleIdenticalGraphics() } } -void Test::testCharHighlightBody() +CPPUNIT_TEST_FIXTURE(Test, testCharHighlightBody) { // MS Word has two kind of character backgrounds called character shading and highlighting // MS filters handle these attributes separately, but ODF export merges them into one background attribute @@ -514,7 +465,7 @@ void Test::testCharHighlightBody() } } -void Test::testCharStyleHighlight() +CPPUNIT_TEST_FIXTURE(Test, testCharStyleHighlight) { // MS Word has two kind of character backgrounds called character shading and highlighting. // However, their character style can only accept shading. It ignores the highlighting value. @@ -545,7 +496,7 @@ void Test::testCharStyleHighlight() } } -void Test::testCharHighlight() +CPPUNIT_TEST_FIXTURE(Test, testCharHighlight) { { ScopedConfigValue<MSFilterCfg::Export::CharBackgroundToHighlighting> aCfg(false); @@ -560,7 +511,7 @@ void Test::testCharHighlight() } } -void Test::testCharHighlightODF() +CPPUNIT_TEST_FIXTURE(Test, testCharHighlightODF) { createSwDoc("char_background_editing.docx"); @@ -627,7 +578,7 @@ void Test::testCharHighlightODF() } } -void Test::testMSCharBackgroundEditing() +CPPUNIT_TEST_FIXTURE(Test, testMSCharBackgroundEditing) { // Simulate the editing process of imported MSO character background attributes // and check how export behaves. @@ -726,7 +677,7 @@ void Test::testMSCharBackgroundEditing() } } -void Test::testCharBackgroundToHighlighting() +CPPUNIT_TEST_FIXTURE(Test, testCharBackgroundToHighlighting) { // MSO highlighting has less kind of values so let's see how LO character background is converted // to these values @@ -783,7 +734,7 @@ void Test::testCharBackgroundToHighlighting() } #if !defined(_WIN32) -void Test::testSkipImages() +CPPUNIT_TEST_FIXTURE(Test, testSkipImages) { // Check how LO skips image loading (but not texts of textboxes and custom shapes) // during DOC and DOCX import, using the "SkipImages" FilterOptions. @@ -848,7 +799,7 @@ void Test::testSkipImages() } #endif -void Test::testNestedFieldmark() +CPPUNIT_TEST_FIXTURE(Test, testNestedFieldmark) { // experimental config setting ScopedConfigValue<MSFilterCfg::Import::ForceImportWWFieldsAsGenericFields> aCfg(true); @@ -924,7 +875,7 @@ void Test::testNestedFieldmark() } } -auto Test::verifyText13(char const*const pTestName) -> void +void Test::verifyText13(char const*const pTestName) { // OFFICE-3789 style:header-first/style:footer-first uno::Reference<beans::XPropertySet> xPageStyle; @@ -955,7 +906,7 @@ auto Test::verifyText13(char const*const pTestName) -> void } // test ODF 1.3 new text document features -void Test::testODF13() +CPPUNIT_TEST_FIXTURE(Test, testODF13) { comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); @@ -1046,7 +997,7 @@ void Test::testODF13() } } -void Test::testRedlineFlags() +CPPUNIT_TEST_FIXTURE(Test, testRedlineFlags) { TestFilter aFilterNames[] = { TestFilter::ODT, @@ -1089,7 +1040,7 @@ void Test::testRedlineFlags() } } -void Test::testBulletAsImage() +CPPUNIT_TEST_FIXTURE(Test, testBulletAsImage) { TestFilter aFilterNames[] = { TestFilter::ODT, @@ -1808,7 +1759,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143311) CPPUNIT_ASSERT(nArtifacts >= 3); } -void Test::testTextFormField() +CPPUNIT_TEST_FIXTURE(Test, testTextFormField) { TestFilter aFilterNames[] = { TestFilter::ODT, @@ -1858,7 +1809,7 @@ void Test::testTextFormField() } } -void Test::testCheckBoxFormField() +CPPUNIT_TEST_FIXTURE(Test, testCheckBoxFormField) { TestFilter aFilterNames[] = { TestFilter::ODT, @@ -1909,7 +1860,7 @@ void Test::testCheckBoxFormField() } } -void Test::testDropDownFormField() +CPPUNIT_TEST_FIXTURE(Test, testDropDownFormField) { TestFilter aFilterNames[] = { TestFilter::ODT, @@ -1984,7 +1935,7 @@ void Test::testDropDownFormField() } } -void Test::testDateFormField() +CPPUNIT_TEST_FIXTURE(Test, testDateFormField) { TestFilter aFilterNames[] = { TestFilter::ODT, @@ -2164,7 +2115,7 @@ void Test::testDateFormField() } } -void Test::testDateFormFieldCharacterFormatting() +CPPUNIT_TEST_FIXTURE(Test, testDateFormFieldCharacterFormatting) { TestFilter aFilterNames[] = { TestFilter::ODT, @@ -2228,7 +2179,7 @@ void Test::testDateFormFieldCharacterFormatting() } } -void Test::testSvgImageSupport() +CPPUNIT_TEST_FIXTURE(Test, testSvgImageSupport) { TestFilter aFilterNames[] = { TestFilter::ODT, @@ -2273,8 +2224,6 @@ void Test::testSvgImageSupport() } } // end of anonymous namespace -CPPUNIT_TEST_SUITE_REGISTRATION(Test); - CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
