[Libreoffice-commits] core.git: svtools/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Mar 7 08:39:37 UTC 2019


 svtools/qa/unit/testHtmlReader.cxx |   15 ++-----------
 svtools/qa/unit/testHtmlWriter.cxx |   40 ++++++++-----------------------------
 2 files changed, 12 insertions(+), 43 deletions(-)

New commits:
commit 6d5fe4dca30452b8c64834aaf175d10497b75f71
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Mar 6 21:36:12 2019 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Mar 7 09:39:13 2019 +0100

    CppunitTest_svtools_html: use CPPUNIT_TEST_FIXTURE()
    
    Change-Id: Icf4d3a649c5e6a53035c2a1573a8dd7154db2edd
    Reviewed-on: https://gerrit.libreoffice.org/68831
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

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 <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
+#include <unotest/bootstrapfixturebase.hxx>
 #include <svtools/parhtml.hxx>
 #include <tools/ref.hxx>
 #include <tools/stream.hxx>
@@ -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("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<html>hello</html>");
@@ -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<br></br>bbb");
@@ -84,8 +77,6 @@ void Test::testLineBreak()
     // This was 2, <br></br> 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 <cppunit/extensions/HelperMacros.h>
 #include <cppunit/plugin/TestPlugIn.h>
 
+#include <unotest/bootstrapfixturebase.hxx>
 #include <tools/stream.hxx>
 #include <svtools/HtmlWriter.hxx>
 
@@ -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("<abc/>"), aString);
 }
 
-void Test::testSingleElementWithContentAndAttributes()
+CPPUNIT_TEST_FIXTURE(Test, testSingleElementWithContentAndAttributes)
 {
     SvMemoryStream aStream;
 
@@ -145,7 +124,7 @@ void Test::testSingleElementWithContentAndAttributes()
     CPPUNIT_ASSERT_EQUAL(OString("<abc x=\"y\" q=\"w\"/>"), aString);
 }
 
-void Test::testNested()
+CPPUNIT_TEST_FIXTURE(Test, testNested)
 {
     SvMemoryStream aStream;
 
@@ -161,7 +140,7 @@ void Test::testNested()
     CPPUNIT_ASSERT_EQUAL(OString("<abc><xyz/></abc>"), aString);
 }
 
-void Test::testNamespace()
+CPPUNIT_TEST_FIXTURE(Test, testNamespace)
 {
     SvMemoryStream aStream;
 
@@ -175,7 +154,7 @@ void Test::testNamespace()
     CPPUNIT_ASSERT_EQUAL(OString("<reqif-xhtml:br/>"), aString);
 }
 
-void Test::testAttributeValues()
+CPPUNIT_TEST_FIXTURE(Test, testAttributeValues)
 {
     SvMemoryStream aStream;
 
@@ -192,7 +171,7 @@ void Test::testAttributeValues()
     CPPUNIT_ASSERT_EQUAL(OString("<abc one=\"one\" two=\"two\" three=\"12\"/>"), aString);
 }
 
-void Test::testCharacters()
+CPPUNIT_TEST_FIXTURE(Test, testCharacters)
 {
     SvMemoryStream aStream;
 
@@ -207,7 +186,6 @@ void Test::testCharacters()
     CPPUNIT_ASSERT_EQUAL(OString("<abc>hello</abc>"), aString);
 }
 
-CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list