diff options
author | Justin Luth <justin.luth@collabora.com> | 2023-12-19 09:16:00 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-12-21 23:41:00 +0100 |
commit | a7bd33955fa52380cf9b04da265646bc93d5c217 (patch) | |
tree | 5bc24a523cd0c52ffd000b57973a2d7dc09cf016 | |
parent | a2cd681369061574974517b1aabf78613f5601b7 (diff) |
address nit: put unit tests in anonymouse namespace
https://gerrit.libreoffice.org/c/core/+/160655/5/sw/qa/extras/rtfexport/rtfexport8.cxx
Miklos "nitted" me that I didn't wrap this test
in an anonymous namespace. Obviously anything I do
is simply copy/paste, so lets make sure that at
least the latest and greatest versions of each
series of unit tests are done "correctly".
Change-Id: I699c8d70e4f587373918e27f08304a0fe815bff4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160991
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
35 files changed, 119 insertions, 29 deletions
diff --git a/sw/qa/extras/docbookexport/docbookexport.cxx b/sw/qa/extras/docbookexport/docbookexport.cxx index 10568528b10b..0c9ce2392223 100644 --- a/sw/qa/extras/docbookexport/docbookexport.cxx +++ b/sw/qa/extras/docbookexport/docbookexport.cxx @@ -9,6 +9,8 @@ #include <swmodeltestbase.hxx> +namespace +{ class DocbookExportTest : public SwModelTestBase { public: @@ -34,7 +36,7 @@ DECLARE_DOCBOOKEXPORT_TEST(testtdf91095, "tdf91095.docx") CPPUNIT_ASSERT(pDoc); } - +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/fodfexport/fodfexport.cxx b/sw/qa/extras/fodfexport/fodfexport.cxx index 2cf5bf42a7c9..4d4ff5f0b047 100644 --- a/sw/qa/extras/fodfexport/fodfexport.cxx +++ b/sw/qa/extras/fodfexport/fodfexport.cxx @@ -11,6 +11,8 @@ #include <o3tl/string_view.hxx> #include <vcl/graph.hxx> +namespace +{ class Test : public SwModelTestBase { public: @@ -74,6 +76,7 @@ DECLARE_FODFEXPORT_TEST(testSvgImageRoundtrip, "SvgImageTest.fodt") CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Svg, pVectorGraphicData->getType()); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 7442de87f6d3..a877c778d3ca 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -39,6 +39,8 @@ #include <com/sun/star/awt/FontWeight.hpp> #include <unotools/mediadescriptor.hxx> +namespace +{ class Test : public SwModelTestBase { public: @@ -262,7 +264,7 @@ void Test::testImageWithSpecialID() } /// Gives the first embedded or linked image in a document. -static uno::Reference<drawing::XShape> lcl_getShape(const uno::Reference<lang::XComponent>& xComponent, bool bEmbedded) +uno::Reference<drawing::XShape> lcl_getShape(const uno::Reference<lang::XComponent>& xComponent, bool bEmbedded) { uno::Reference<drawing::XShape> xShape; @@ -354,9 +356,6 @@ void Test::testGraphicShape() } } -namespace -{ - std::vector<uno::Reference<graphic::XGraphic>> lcl_getGraphics(const uno::Reference<lang::XComponent>& xComponent) { @@ -378,8 +377,6 @@ std::vector<uno::Reference<graphic::XGraphic>> return aGraphics; } -} - void Test::testMultipleIdenticalGraphics() { // We have multiple identical graphics. When we save them we want @@ -841,7 +838,7 @@ void Test::testSkipImages() } #endif -static auto verifyNestedFieldmark(OUString const& rTestName, +auto verifyNestedFieldmark(OUString const& rTestName, uno::Reference<lang::XComponent> const& xComponent) -> void { SwDoc const*const pDoc(dynamic_cast<SwXTextDocument&>(*xComponent).GetDocShell()->GetDoc()); @@ -2260,6 +2257,7 @@ void Test::testSvgImageSupport() } } +} // end of anonymous namespace CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 96bdfab66b60..f86e1380d20a 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -185,7 +185,6 @@ OLE1Reader::OLE1Reader(SvStream& rStream) rStream.ReadUInt32(nData); // PresentationDataSize m_nPresentationDataSize = nData; } -} /// Covers sw/source/filter/html/wrthtml.cxx and related fixes. class HtmlExportTest : public SwModelTestBase, public HtmlTestTools @@ -3032,6 +3031,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_NoBrClearForImageWrap) 0); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/htmlexport/xhtmlexport.cxx b/sw/qa/extras/htmlexport/xhtmlexport.cxx index 86026dbd70bd..8527e66e024c 100644 --- a/sw/qa/extras/htmlexport/xhtmlexport.cxx +++ b/sw/qa/extras/htmlexport/xhtmlexport.cxx @@ -12,6 +12,8 @@ #include <test/htmltesttools.hxx> +namespace +{ class XHtmlExportTest : public SwModelTestBase, public HtmlTestTools { public: @@ -182,6 +184,7 @@ CPPUNIT_TEST_FIXTURE(XHtmlExportTest, testTdf66305) != -1); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx index 125143d6f581..dd27b2d24988 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -32,6 +32,8 @@ #include <frameformats.hxx> #include <unotxdoc.hxx> +namespace +{ class HtmlImportTest : public SwModelTestBase { public: @@ -611,6 +613,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf155011) // Must not crash / fail asserts } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/indexing/IndexingExportTest.cxx b/sw/qa/extras/indexing/IndexingExportTest.cxx index ac32db4fb8b1..ecd32e424a9a 100644 --- a/sw/qa/extras/indexing/IndexingExportTest.cxx +++ b/sw/qa/extras/indexing/IndexingExportTest.cxx @@ -13,6 +13,8 @@ #include <IndexingExport.hxx> +namespace +{ class IndexingExportTest : public SwModelTestBase { public: @@ -312,6 +314,7 @@ void IndexingExportTest::testIndexingExport_Header_Footer() assertXPathContent(pXmlDoc, "/indexing/paragraph[4]"_ostr, "Paragraph 2"); } +} // end of anonymous namespace CPPUNIT_TEST_SUITE_REGISTRATION(IndexingExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/indexing/SearchResultLocatorTest.cxx b/sw/qa/extras/indexing/SearchResultLocatorTest.cxx index 3772456c1d4c..2cf29bfeb6e7 100644 --- a/sw/qa/extras/indexing/SearchResultLocatorTest.cxx +++ b/sw/qa/extras/indexing/SearchResultLocatorTest.cxx @@ -13,6 +13,8 @@ #include <SearchResultLocator.hxx> +namespace +{ class SearchResultLocatorTest : public SwModelTestBase { public: @@ -179,6 +181,7 @@ void SearchResultLocatorTest::testSearchResultLocatorForSdrObjectsUsingJsonPaylo #endif } +} // end of anonymous namespace CPPUNIT_TEST_SUITE_REGISTRATION(SearchResultLocatorTest); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index ec7d740cf74f..5af5c7e1b073 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -42,6 +42,8 @@ #include <dcontact.hxx> #include <frameformats.hxx> +namespace +{ /// Test to assert layout / rendering result of Writer. class SwLayoutWriter3 : public SwModelTestBase { @@ -127,7 +129,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf120287) assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout"_ostr, 1); } -static auto getXPathIntAttributeValue(xmlXPathContextPtr pXmlXpathCtx, char const* const pXPath) +auto getXPathIntAttributeValue(xmlXPathContextPtr pXmlXpathCtx, char const* const pXPath) -> sal_Int32 { xmlXPathObjectPtr pXmlXpathObj = xmlXPathEvalExpression(BAD_CAST(pXPath), pXmlXpathCtx); @@ -1743,7 +1745,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testWriterImageNoCapture) CPPUNIT_ASSERT_LESS(nPageLeft, nImageLeft); } -static SwRect lcl_getVisibleFlyObjRect(SwWrtShell* pWrtShell) +SwRect lcl_getVisibleFlyObjRect(SwWrtShell* pWrtShell) { SwRootFrame* pRoot = pWrtShell->GetLayout(); SwPageFrame* pPage = static_cast<SwPageFrame*>(pRoot->GetLower()); @@ -2123,6 +2125,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf152307) CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(), nTabBottom < nFooterTop); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 921680d382f1..2d90237d5df9 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -36,11 +36,13 @@ #include <IDocumentLayoutAccess.hxx> #include <rootfrm.hxx> +namespace +{ /** * Maps database URIs to the registered database names for quick lookups */ typedef std::map<OUString, OUString> DBuriMap; -static DBuriMap aDBuriMap; +DBuriMap aDBuriMap; class MMTest : public SwModelTestBase { @@ -740,8 +742,6 @@ DECLARE_SHELL_MAILMERGE_TEST(testTdf118113, "tdf118113.odt", "tdf118113.ods", "t } -namespace -{ constexpr char const* const EmptyValuesLegacyData[][8] = { { "Heading", "Title: ", "First Name: firstname1", "Last Name: lastname1", "Title: First Name: firstname1", "First Name: firstname1 Last Name: lastname1", @@ -771,7 +771,7 @@ constexpr char const* const EmptyValuesNewData[][8] "Title: First Name: Last Name: lastname4", "Trailing text" }, { "Heading", "Title: title5", "Title: title5 First Name: ", "Title: title5 First Name: Last Name: ", "Trailing text" } }; -} + // The following four tests (testEmptyValuesLegacyODT, testEmptyValuesNewODT, (testEmptyValuesLegacyFODT, testEmptyValuesNewFODT) // check that for native documents without "EmptyDbFieldHidesPara" compatibility option, all paragraphs are exported visible, @@ -946,6 +946,6 @@ DECLARE_SHELL_MAILMERGE_TEST(testTdf62364, "tdf62364.odt", "10-testing-addresses } } - +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/mailmerge/mailmerge2.cxx b/sw/qa/extras/mailmerge/mailmerge2.cxx index 4a58d07b4f01..905f4b03e252 100644 --- a/sw/qa/extras/mailmerge/mailmerge2.cxx +++ b/sw/qa/extras/mailmerge/mailmerge2.cxx @@ -43,11 +43,13 @@ #include <IDocumentLayoutAccess.hxx> #include <rootfrm.hxx> +namespace +{ /** * Maps database URIs to the registered database names for quick lookups */ typedef std::map<OUString, OUString> DBuriMap; -static DBuriMap aDBuriMap; +DBuriMap aDBuriMap; class MMTest2 : public SwModelTestBase { @@ -723,6 +725,7 @@ DECLARE_MAILMERGE_TEST(testGrabBag, "grabbagtest.docx", "onecell.xlsx", "Sheet1" CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xParaA1, "CharFontName")); } +} // end of anonymous namespace namespace com::sun::star::table { static std::ostream& operator<<(std::ostream& rStream, table::BorderLine const& rLine) diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 51cfa15b7bcc..dbebd8b8b755 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -66,6 +66,8 @@ #include <rootfrm.hxx> #include <o3tl/string_view.hxx> +namespace +{ class Test : public SwModelTestBase { public: @@ -118,7 +120,7 @@ DECLARE_ODFEXPORT_TEST(testTdf144319, "tdf144319.odt") CPPUNIT_ASSERT_EQUAL(OUString("{ y ^ 2 { nitalic m p } = left ( { x ^ 3 + 7 } right ) { nitalic m p } }"), formula5); } -static void testTdf43569_CheckIfFieldParse() +void testTdf43569_CheckIfFieldParse() { { OUString paramCondition; @@ -2703,6 +2705,6 @@ CPPUNIT_TEST_FIXTURE(Test, testImageMimetype) assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p/draw:frame/draw:image[@draw:mime-type='image/svg+xml']"_ostr); } - +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx index 6db396c40dee..b64811866a10 100644 --- a/sw/qa/extras/odfexport/odfexport2.cxx +++ b/sw/qa/extras/odfexport/odfexport2.cxx @@ -34,6 +34,8 @@ #include <unotxdoc.hxx> #include <docsh.hxx> +namespace +{ class Test : public SwModelTestBase { public: @@ -1128,6 +1130,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf150408_IsLegal) "is-legal"_ostr, "true"); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/odfimport/odffeatures.cxx b/sw/qa/extras/odfimport/odffeatures.cxx index 22a11b4176bf..f35fdfd87a71 100644 --- a/sw/qa/extras/odfimport/odffeatures.cxx +++ b/sw/qa/extras/odfimport/odffeatures.cxx @@ -11,6 +11,8 @@ #include <config_features.h> +namespace +{ class Test : public SwModelTestBase { public: @@ -26,5 +28,6 @@ CPPUNIT_TEST_FIXTURE(Test, testFeatureTextBold) { createSwDoc("feature_text_bold CPPUNIT_TEST_FIXTURE(Test, testFeatureTextItalic) { createSwDoc("feature_text_italic.odt"); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 6ccc8cce3bc5..753551240ca3 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -67,6 +67,8 @@ #include <urlmon.h> #endif +namespace +{ typedef std::map<OUString, css::uno::Sequence< css::table::BorderLine> > AllBordersMap; typedef std::pair<OUString, css::uno::Sequence< css::table::BorderLine> > StringSequencePair; @@ -666,7 +668,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo55814) CPPUNIT_ASSERT_EQUAL(OUString("Hide==\"Yes\""), getProperty<OUString>(xSections->getByIndex(0), "Condition")); } -static void lcl_CheckShape( +void lcl_CheckShape( uno::Reference<drawing::XShape> const& xShape, OUString const& rExpected) { uno::Reference<container::XNamed> const xNamed(xShape, uno::UNO_QUERY); @@ -1394,7 +1396,7 @@ CPPUNIT_TEST_FIXTURE(Test, testForcepoint108) #ifdef _WIN32 template <class T> -static void runWindowsFileZoneTests(css::uno::Reference<css::frame::XDesktop2> const & aDesktop, +void runWindowsFileZoneTests(css::uno::Reference<css::frame::XDesktop2> const & aDesktop, const OUString& sFileName, sal_Int32 configValue, sal_Int32 zoneId, bool expectedResult) { @@ -1534,5 +1536,6 @@ CPPUNIT_TEST_FIXTURE(Test, testEmptyTrailingSpans) CPPUNIT_ASSERT_DOUBLES_EQUAL(184, height2, 1); // allow a bit of room for rounding just in case } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx index 191497cce760..0cf1c6c4f709 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx @@ -18,6 +18,8 @@ #include <unotxdoc.hxx> #include <docsh.hxx> +namespace +{ class Test : public SwModelTestBase { public: @@ -1040,6 +1042,7 @@ CPPUNIT_TEST_FIXTURE(Test, testtdf158044) assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r[4]/w:rPr[1]/w:shadow[1]"_ostr); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 5d5661f0fa0f..4e0b0f80be57 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -66,6 +66,8 @@ #include <vcl/TypeSerializer.hxx> #include <comphelper/scopeguard.hxx> +namespace +{ class Test : public SwModelTestBase { public: @@ -766,7 +768,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGroupshapeSdt) CPPUNIT_ASSERT_EQUAL(sal_Int32(20), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xShape->getText()), 1), "CharKerning")); } -static void lcl_countTextFrames(const css::uno::Reference< lang::XComponent >& xComponent, +void lcl_countTextFrames(const css::uno::Reference< lang::XComponent >& xComponent, sal_Int32 nExpected ) { uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(xComponent, uno::UNO_QUERY); @@ -1238,7 +1240,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloatingTableSectionColumns) CPPUNIT_ASSERT( tableWidth.toInt32() > 10000 ); } -static OString dateTimeToString( const util::DateTime& dt ) +OString dateTimeToString( const util::DateTime& dt ) { return DateTimeToOString( DateTime( Date( dt.Day, dt.Month, dt.Year ), tools::Time( dt.Hours, dt.Minutes, dt.Seconds ))); } @@ -1879,6 +1881,7 @@ CPPUNIT_TEST_FIXTURE(Test, testGroupShapeTextHighlight) // tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index ccd62f5041b6..d86a6bffe861 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -45,6 +45,8 @@ #include <flyfrms.hxx> #include <tabfrm.hxx> +namespace +{ class Test : public SwModelTestBase { public: @@ -1267,6 +1269,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154370) } // tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/pdf/HybridPdfTest.cxx b/sw/qa/extras/pdf/HybridPdfTest.cxx index fda2b409fbaa..ded679324ae5 100644 --- a/sw/qa/extras/pdf/HybridPdfTest.cxx +++ b/sw/qa/extras/pdf/HybridPdfTest.cxx @@ -11,6 +11,8 @@ #include <docsh.hxx> #include <unotxdoc.hxx> +namespace +{ class HybridPdfTest : public SwModelTestBase { public: @@ -69,6 +71,7 @@ void HybridPdfTest::testHybridWithAdditionalStreamsAndAttachedFile() getParagraph(1)->getString()); } +} // end of anonymous namespace CPPUNIT_TEST_SUITE_REGISTRATION(HybridPdfTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 629b32d73acd..972206b9ff75 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -35,6 +35,8 @@ using namespace css; +namespace +{ class Test : public SwModelTestBase { public: @@ -827,6 +829,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo32613) getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType")); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx index c718dfffd7e7..fdf584e942aa 100644 --- a/sw/qa/extras/rtfexport/rtfexport2.cxx +++ b/sw/qa/extras/rtfexport/rtfexport2.cxx @@ -34,6 +34,8 @@ #include <bordertest.hxx> +namespace +{ class Test : public SwModelTestBase { public: @@ -956,6 +958,7 @@ DECLARE_RTFEXPORT_TEST(testFdo51916, "fdo51916.rtf") // Complex nested table caused a crash. } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 435242308a0e..0c7365260b56 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -36,6 +36,8 @@ using namespace css; +namespace +{ class Test : public SwModelTestBase { public: @@ -707,6 +709,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableOverlapNeverRTFExport) CPPUNIT_ASSERT(!pFly->GetAttrSet().GetWrapInfluenceOnObjPos().GetAllowOverlap()); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 2a470f3c9682..25f5394b6ae5 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -35,6 +35,8 @@ using namespace css; Split these tests into their own file because they are really really slow */ +namespace +{ class Test : public SwModelTestBase { public: @@ -833,6 +835,7 @@ DECLARE_RTFEXPORT_TEST(testTdf148515, "tdf148515.rtf") CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(getRun(getParagraph(2), 1), "CharHeight")); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index 529e3c73cfb8..c78f8f8ced3d 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -29,6 +29,8 @@ using namespace css; +namespace +{ class Test : public SwModelTestBase { public: @@ -779,6 +781,7 @@ DECLARE_RTFEXPORT_TEST(testFdo83204, "fdo83204.rtf") getProperty<OUString>(getParagraph(1), "ParaStyleName")); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfexport/rtfexport6.cxx b/sw/qa/extras/rtfexport/rtfexport6.cxx index ff331caa7307..590ad23452f0 100644 --- a/sw/qa/extras/rtfexport/rtfexport6.cxx +++ b/sw/qa/extras/rtfexport/rtfexport6.cxx @@ -36,6 +36,8 @@ using namespace css; +namespace +{ class Test : public SwModelTestBase { public: @@ -751,6 +753,7 @@ DECLARE_RTFEXPORT_TEST(testTdf153681, "tdf153681.odt") CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getColumns()->getCount()); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfexport/rtfexport7.cxx b/sw/qa/extras/rtfexport/rtfexport7.cxx index 4a0a4ac27c39..431cb92b38bc 100644 --- a/sw/qa/extras/rtfexport/rtfexport7.cxx +++ b/sw/qa/extras/rtfexport/rtfexport7.cxx @@ -32,6 +32,8 @@ using namespace css; +namespace +{ class Test : public SwModelTestBase { public: @@ -780,6 +782,8 @@ DECLARE_RTFEXPORT_TEST(testTdf158762, "tdf158762.rtf") CPPUNIT_ASSERT(xLevels.is()); } } + +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfexport/rtfexport8.cxx b/sw/qa/extras/rtfexport/rtfexport8.cxx index f8d800380cba..3023e51dcb21 100644 --- a/sw/qa/extras/rtfexport/rtfexport8.cxx +++ b/sw/qa/extras/rtfexport/rtfexport8.cxx @@ -36,6 +36,8 @@ using namespace css; +namespace +{ class Test : public SwModelTestBase { public: @@ -84,6 +86,7 @@ DECLARE_RTFEXPORT_TEST(testTdf158586_lostFrame, "tdf158586_lostFrame.rtf") // CPPUNIT_ASSERT_EQUAL(2, getPages()); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 11bd8ab39484..629f75c97f0f 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -61,6 +61,8 @@ #include <ndtxt.hxx> #include <fmtautofmt.hxx> +namespace +{ class Test : public SwModelTestBase { public: @@ -1819,6 +1821,7 @@ CPPUNIT_TEST_FIXTURE(Test, test158044Tdf) } // tests should only be added to rtfIMPORT *if* they fail round-tripping in rtfEXPORT +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/txtencexport/txtencexport.cxx b/sw/qa/extras/txtencexport/txtencexport.cxx index 7db93ba3a140..0ce191cc2cde 100644 --- a/sw/qa/extras/txtencexport/txtencexport.cxx +++ b/sw/qa/extras/txtencexport/txtencexport.cxx @@ -9,6 +9,8 @@ #include <swmodeltestbase.hxx> +namespace +{ class TxtEncExportTest : public SwModelTestBase { public: @@ -94,6 +96,7 @@ DECLARE_TXTENCEXPORT_TEST(testBulletsHidden, "bullets.odt", "UTF8,,,,,false", Tx CPPUNIT_ASSERT_EQUAL(aExpected, aData); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/txtexport/txtexport.cxx b/sw/qa/extras/txtexport/txtexport.cxx index 3d3154f34c91..fb0ac453dff2 100644 --- a/sw/qa/extras/txtexport/txtexport.cxx +++ b/sw/qa/extras/txtexport/txtexport.cxx @@ -17,6 +17,8 @@ #include <formatlinebreak.hxx> +namespace +{ class TxtExportTest : public SwModelTestBase { public: @@ -139,6 +141,7 @@ CPPUNIT_TEST_FIXTURE(TxtExportTest, testClearingBreakExport) CPPUNIT_ASSERT_EQUAL("foo\nbar" SAL_NEWLINE_STRING ""_ostr, aActual); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/txtimport/txtimport.cxx b/sw/qa/extras/txtimport/txtimport.cxx index bf9c45de2d35..a68484a138d5 100644 --- a/sw/qa/extras/txtimport/txtimport.cxx +++ b/sw/qa/extras/txtimport/txtimport.cxx @@ -17,6 +17,8 @@ #include <wrtsh.hxx> #include <rtl/ustrbuf.hxx> +namespace +{ class TxtImportTest : public SwModelTestBase { public: @@ -231,6 +233,7 @@ CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf70423) CPPUNIT_ASSERT_EQUAL(aResStr, aPara); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index 9aaafa1e6967..2cfcc2066c41 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -40,6 +40,8 @@ #include <itabenum.hxx> #include <officecfg/Office/Common.hxx> +namespace +{ /// 8th set of tests asserting the behavior of Writer user interface shells. class SwUiWriterTest8 : public SwModelTestBase { @@ -2859,6 +2861,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf158703) CPPUNIT_ASSERT_EQUAL(u"Foo\u00A0:"_ustr, getParagraph(1)->getString()); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx index 8bcadbaf4227..c4bcbb7f5dd6 100644 --- a/sw/qa/extras/unowriter/unowriter.cxx +++ b/sw/qa/extras/unowriter/unowriter.cxx @@ -99,7 +99,6 @@ uno::Reference<text::XTextContent>& PasteListener::GetTextGraphicObject() { return m_xTextGraphicObject; } -} /// Test to assert UNO API call results of Writer. class SwUnoWriter : public SwModelTestBase @@ -282,8 +281,8 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testGraphicDescriptorURLBitmap) CPPUNIT_ASSERT(xGraphic.is()); } -static bool ensureAutoTextExistsByTitle(const uno::Reference<text::XAutoTextGroup>& autoTextGroup, - std::u16string_view autoTextName) +bool ensureAutoTextExistsByTitle(const uno::Reference<text::XAutoTextGroup>& autoTextGroup, + std::u16string_view autoTextName) { const uno::Sequence<OUString> aTitles(autoTextGroup->getTitles()); for (const auto& rTitle : aTitles) @@ -294,8 +293,8 @@ static bool ensureAutoTextExistsByTitle(const uno::Reference<text::XAutoTextGrou return false; } -static bool ensureAutoTextExistsByName(const uno::Reference<text::XAutoTextGroup>& autoTextGroup, - std::u16string_view autoTextName) +bool ensureAutoTextExistsByName(const uno::Reference<text::XAutoTextGroup>& autoTextGroup, + std::u16string_view autoTextName) { const uno::Sequence<OUString> aTitles(autoTextGroup->getElementNames()); for (const auto& rTitle : aTitles) @@ -1201,6 +1200,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTdf129841) CPPUNIT_ASSERT_EQUAL(aRefColor, aColor); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx index d47c934d9dd6..92023fb7a36e 100644 --- a/sw/qa/extras/ww8export/ww8export4.cxx +++ b/sw/qa/extras/ww8export/ww8export4.cxx @@ -33,6 +33,8 @@ #include <formatflysplit.hxx> #include <fmtwrapinfluenceonobjpos.hxx> +namespace +{ class Test : public SwModelTestBase { public: @@ -194,7 +196,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFloattableOverlapNeverDOCExport) CPPUNIT_ASSERT(!pFly->GetAttrSet().GetWrapInfluenceOnObjPos().GetAllowOverlap()); } -static bool IsFirstLine(const SwTextNode* pTextNode) +bool IsFirstLine(const SwTextNode* pTextNode) { const SfxPoolItem* pItem = pTextNode->GetNoCondAttr(RES_MARGIN_FIRSTLINE, false); return !!pItem; @@ -258,6 +260,7 @@ DECLARE_WW8EXPORT_TEST(testTdf104704_mangledFooter, "tdf104704_mangledFooter.odt CPPUNIT_ASSERT_EQUAL(2, getPages()); } +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 58c2bcfbf138..d522a429d6d2 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -29,6 +29,8 @@ // tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT +namespace +{ class Test : public SwModelTestBase { public: @@ -277,6 +279,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142003) // tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT +} // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |