summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-06-29 20:48:25 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-06-30 08:32:35 +0200
commitdbbd4f356487d7d4f68cddd5a06a71f236d358ed (patch)
treeec67b2b0a381ea7b41ddda11dba9f2c9899ae6ca
parent9c15dea0b2192d231b65175291a7655122c2e24c (diff)
sw: rework to avoid DECLARE_SW_IMPORT_TEST() in CppunitTest_sw_txtimport
See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd (CppunitTest_sw_rtfimport: convert one testcase to use CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation. Change-Id: Ic272bbecada260d22fa30e6e39a92be3d503d403 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118133 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sw/qa/extras/txtimport/txtimport.cxx24
1 files changed, 14 insertions, 10 deletions
diff --git a/sw/qa/extras/txtimport/txtimport.cxx b/sw/qa/extras/txtimport/txtimport.cxx
index c14ce8e0ad5b..3a506d42227f 100644
--- a/sw/qa/extras/txtimport/txtimport.cxx
+++ b/sw/qa/extras/txtimport/txtimport.cxx
@@ -47,11 +47,9 @@ public:
}
};
-#define DECLARE_TXTIMPORT_TEST(TestName, filename) \
- DECLARE_SW_IMPORT_TEST(TestName, filename, nullptr, TxtImportTest)
-
-DECLARE_TXTIMPORT_TEST(testTdf112191, "bullets.odt")
+CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf112191)
{
+ load(mpTestDocumentPath, "bullets.odt");
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
@@ -79,8 +77,9 @@ DECLARE_TXTIMPORT_TEST(testTdf112191, "bullets.odt")
assertExportedRange(OUStringToOString(aString, osl_getThreadTextEncoding()), aPaM3);
}
-DECLARE_TXTIMPORT_TEST(testTdf60145_utf8withoutbom, "UTF8WITHOUTBOM.txt")
+CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf8withoutbom)
{
+ load(mpTestDocumentPath, "UTF8WITHOUTBOM.txt");
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
@@ -91,8 +90,9 @@ DECLARE_TXTIMPORT_TEST(testTdf60145_utf8withoutbom, "UTF8WITHOUTBOM.txt")
CPPUNIT_ASSERT_EQUAL(OUString(u"漢a'"), xPara->getString());
}
-DECLARE_TXTIMPORT_TEST(testTdf60145_utf8withbom, "UTF8WITHBOM.txt")
+CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf8withbom)
{
+ load(mpTestDocumentPath, "UTF8WITHBOM.txt");
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
@@ -103,8 +103,9 @@ DECLARE_TXTIMPORT_TEST(testTdf60145_utf8withbom, "UTF8WITHBOM.txt")
CPPUNIT_ASSERT_EQUAL(OUString(u"漢a'"), xPara->getString());
}
-DECLARE_TXTIMPORT_TEST(testTdf60145_utf16lewithoutbom, "UTF16LEWITHOUTBOM.txt")
+CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16lewithoutbom)
{
+ load(mpTestDocumentPath, "UTF16LEWITHOUTBOM.txt");
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
@@ -115,8 +116,9 @@ DECLARE_TXTIMPORT_TEST(testTdf60145_utf16lewithoutbom, "UTF16LEWITHOUTBOM.txt")
CPPUNIT_ASSERT_EQUAL(OUString(u"漢a'"), xPara->getString());
}
-DECLARE_TXTIMPORT_TEST(testTdf60145_utf16lewithbom, "UTF16LEWITHBOM.txt")
+CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16lewithbom)
{
+ load(mpTestDocumentPath, "UTF16LEWITHBOM.txt");
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
@@ -127,8 +129,9 @@ DECLARE_TXTIMPORT_TEST(testTdf60145_utf16lewithbom, "UTF16LEWITHBOM.txt")
CPPUNIT_ASSERT_EQUAL(OUString(u"漢a'"), xPara->getString());
}
-DECLARE_TXTIMPORT_TEST(testTdf60145_utf16bewithoutbom, "UTF16BEWITHOUTBOM.txt")
+CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16bewithoutbom)
{
+ load(mpTestDocumentPath, "UTF16BEWITHOUTBOM.txt");
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
@@ -139,8 +142,9 @@ DECLARE_TXTIMPORT_TEST(testTdf60145_utf16bewithoutbom, "UTF16BEWITHOUTBOM.txt")
CPPUNIT_ASSERT_EQUAL(OUString(u"漢a'"), xPara->getString());
}
-DECLARE_TXTIMPORT_TEST(testTdf60145_utf16bewithbom, "UTF16BEWITHBOM.txt")
+CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf60145_utf16bewithbom)
{
+ load(mpTestDocumentPath, "UTF16BEWITHBOM.txt");
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();