From 6d5fe4dca30452b8c64834aaf175d10497b75f71 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 6 Mar 2019 21:36:12 +0100 Subject: CppunitTest_svtools_html: use CPPUNIT_TEST_FIXTURE() Change-Id: Icf4d3a649c5e6a53035c2a1573a8dd7154db2edd Reviewed-on: https://gerrit.libreoffice.org/68831 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- svtools/qa/unit/testHtmlReader.cxx | 15 +++----------- svtools/qa/unit/testHtmlWriter.cxx | 40 +++++++++----------------------------- 2 files changed, 12 insertions(+), 43 deletions(-) (limited to 'svtools/qa/unit') diff --git a/svtools/qa/unit/testHtmlReader.cxx b/svtools/qa/unit/testHtmlReader.cxx index 6df6b5541c2d..abda6f2725fc 100644 --- a/svtools/qa/unit/testHtmlReader.cxx +++ b/svtools/qa/unit/testHtmlReader.cxx @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -45,17 +46,9 @@ void TestHTMLParser::NextToken(HtmlTokenId nToken) /// Tests HTMLParser. class Test : public CppUnit::TestFixture { -public: - void testTdf114428(); - void testLineBreak(); - - CPPUNIT_TEST_SUITE(Test); - CPPUNIT_TEST(testTdf114428); - CPPUNIT_TEST(testLineBreak); - CPPUNIT_TEST_SUITE_END(); }; -void Test::testTdf114428() +CPPUNIT_TEST_FIXTURE(Test, testTdf114428) { SvMemoryStream aStream; OString aDocument("\nhello"); @@ -70,7 +63,7 @@ void Test::testTdf114428() CPPUNIT_ASSERT_EQUAL(OUString("hello"), xParser->m_aDocument.trim()); } -void Test::testLineBreak() +CPPUNIT_TEST_FIXTURE(Test, testLineBreak) { SvMemoryStream aStream; OString aDocument("aaa

bbb"); @@ -84,8 +77,6 @@ void Test::testLineBreak() // This was 2,

was interpreted as 2 line breaks in XHTML mode. CPPUNIT_ASSERT_EQUAL(1, xParser->m_nLineBreakCount); } - -CPPUNIT_TEST_SUITE_REGISTRATION(Test); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/qa/unit/testHtmlWriter.cxx b/svtools/qa/unit/testHtmlWriter.cxx index ef207049c32c..86da936b8ce8 100644 --- a/svtools/qa/unit/testHtmlWriter.cxx +++ b/svtools/qa/unit/testHtmlWriter.cxx @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -32,31 +33,9 @@ OString extractFromStream(SvMemoryStream& rStream) class Test: public CppUnit::TestFixture { - -public: - void testSingleElement(); - void testSingleElementWithAttributes(); - void testSingleElementWithContent(); - void testSingleElementWithContentAndAttributes(); - void testNested(); - void testNamespace(); - void testAttributeValues(); - void testCharacters(); - - CPPUNIT_TEST_SUITE(Test); - CPPUNIT_TEST(testSingleElement); - CPPUNIT_TEST(testSingleElementWithAttributes); - CPPUNIT_TEST(testSingleElementWithContent); - CPPUNIT_TEST(testSingleElementWithContentAndAttributes); - CPPUNIT_TEST(testNested); - CPPUNIT_TEST(testNamespace); - CPPUNIT_TEST(testAttributeValues); - CPPUNIT_TEST(testCharacters); - - CPPUNIT_TEST_SUITE_END(); }; -void Test::testSingleElement() +CPPUNIT_TEST_FIXTURE(Test, testSingleElement) { { SvMemoryStream aStream; @@ -83,7 +62,7 @@ void Test::testSingleElement() } } -void Test::testSingleElementWithAttributes() +CPPUNIT_TEST_FIXTURE(Test, testSingleElementWithAttributes) { { SvMemoryStream aStream; @@ -115,7 +94,7 @@ void Test::testSingleElementWithAttributes() } } -void Test::testSingleElementWithContent() +CPPUNIT_TEST_FIXTURE(Test, testSingleElementWithContent) { SvMemoryStream aStream; @@ -129,7 +108,7 @@ void Test::testSingleElementWithContent() CPPUNIT_ASSERT_EQUAL(OString(""), aString); } -void Test::testSingleElementWithContentAndAttributes() +CPPUNIT_TEST_FIXTURE(Test, testSingleElementWithContentAndAttributes) { SvMemoryStream aStream; @@ -145,7 +124,7 @@ void Test::testSingleElementWithContentAndAttributes() CPPUNIT_ASSERT_EQUAL(OString(""), aString); } -void Test::testNested() +CPPUNIT_TEST_FIXTURE(Test, testNested) { SvMemoryStream aStream; @@ -161,7 +140,7 @@ void Test::testNested() CPPUNIT_ASSERT_EQUAL(OString(""), aString); } -void Test::testNamespace() +CPPUNIT_TEST_FIXTURE(Test, testNamespace) { SvMemoryStream aStream; @@ -175,7 +154,7 @@ void Test::testNamespace() CPPUNIT_ASSERT_EQUAL(OString(""), aString); } -void Test::testAttributeValues() +CPPUNIT_TEST_FIXTURE(Test, testAttributeValues) { SvMemoryStream aStream; @@ -192,7 +171,7 @@ void Test::testAttributeValues() CPPUNIT_ASSERT_EQUAL(OString(""), aString); } -void Test::testCharacters() +CPPUNIT_TEST_FIXTURE(Test, testCharacters) { SvMemoryStream aStream; @@ -207,7 +186,6 @@ void Test::testCharacters() CPPUNIT_ASSERT_EQUAL(OString("hello"), aString); } -CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit