summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2024-06-13 14:53:51 +0900
committerTomaž Vajngerl <quikee@gmail.com>2024-06-14 04:07:28 +0200
commit16f990255128ec32996ea92a726ffc34d9ea2fac (patch)
tree8a836a9771828d4ce3242ae1a5042584cc98fc09 /vcl/qa/cppunit
parent66a68fcb5639c3f0e42385fcdb08f16b9c96f243 (diff)
vcl: convert PDFiumLibraryTest to CPPUNIT_TEST_FIXTURE
Change-Id: I5022bec2622c7dc7ddf1e58b4a370551574281c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168786 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/qa/cppunit')
-rw-r--r--vcl/qa/cppunit/PDFiumLibraryTest.cxx39
1 files changed, 9 insertions, 30 deletions
diff --git a/vcl/qa/cppunit/PDFiumLibraryTest.cxx b/vcl/qa/cppunit/PDFiumLibraryTest.cxx
index 172af6829b45..d11c66bae323 100644
--- a/vcl/qa/cppunit/PDFiumLibraryTest.cxx
+++ b/vcl/qa/cppunit/PDFiumLibraryTest.cxx
@@ -28,33 +28,14 @@
class PDFiumLibraryTest : public test::BootstrapFixtureBase
{
+protected:
OUString getFullUrl(std::u16string_view sFileName)
{
return m_directories.getURLFromSrc(u"/vcl/qa/cppunit/data/") + sFileName;
}
-
- void testDocument();
- void testPages();
- void testPageObjects();
- void testAnnotationsMadeInEvince();
- void testAnnotationsMadeInAcrobat();
- void testAnnotationsDifferentTypes();
- void testTools();
- void testFormFields();
-
- CPPUNIT_TEST_SUITE(PDFiumLibraryTest);
- CPPUNIT_TEST(testDocument);
- CPPUNIT_TEST(testPages);
- CPPUNIT_TEST(testPageObjects);
- CPPUNIT_TEST(testAnnotationsMadeInEvince);
- CPPUNIT_TEST(testAnnotationsMadeInAcrobat);
- CPPUNIT_TEST(testAnnotationsDifferentTypes);
- CPPUNIT_TEST(testTools);
- CPPUNIT_TEST(testFormFields);
- CPPUNIT_TEST_SUITE_END();
};
-void PDFiumLibraryTest::testDocument()
+CPPUNIT_TEST_FIXTURE(PDFiumLibraryTest, testDocument)
{
OUString aURL = getFullUrl(u"Pangram.pdf");
SvFileStream aStream(aURL, StreamMode::READ);
@@ -81,7 +62,7 @@ void PDFiumLibraryTest::testDocument()
CPPUNIT_ASSERT_EQUAL(792.0, aSize.getHeight());
}
-void PDFiumLibraryTest::testPages()
+CPPUNIT_TEST_FIXTURE(PDFiumLibraryTest, testPages)
{
OUString aURL = getFullUrl(u"Pangram.pdf");
SvFileStream aStream(aURL, StreamMode::READ);
@@ -106,7 +87,7 @@ void PDFiumLibraryTest::testPages()
CPPUNIT_ASSERT(pPage);
}
-void PDFiumLibraryTest::testPageObjects()
+CPPUNIT_TEST_FIXTURE(PDFiumLibraryTest, testPageObjects)
{
OUString aURL = getFullUrl(u"Pangram.pdf");
SvFileStream aStream(aURL, StreamMode::READ);
@@ -159,7 +140,7 @@ void PDFiumLibraryTest::testPageObjects()
CPPUNIT_ASSERT_DOUBLES_EQUAL(732.54, pPageObject->getBounds().getMaxY(), 1E-2);
}
-void PDFiumLibraryTest::testAnnotationsMadeInEvince()
+CPPUNIT_TEST_FIXTURE(PDFiumLibraryTest, testAnnotationsMadeInEvince)
{
OUString aURL = getFullUrl(u"PangramWithAnnotations.pdf");
SvFileStream aStream(aURL, StreamMode::READ);
@@ -215,7 +196,7 @@ void PDFiumLibraryTest::testAnnotationsMadeInEvince()
}
}
-void PDFiumLibraryTest::testAnnotationsMadeInAcrobat()
+CPPUNIT_TEST_FIXTURE(PDFiumLibraryTest, testAnnotationsMadeInAcrobat)
{
OUString aURL = getFullUrl(u"PangramAcrobatAnnotations.pdf");
SvFileStream aStream(aURL, StreamMode::READ);
@@ -292,7 +273,7 @@ void PDFiumLibraryTest::testAnnotationsMadeInAcrobat()
}
}
-void PDFiumLibraryTest::testFormFields()
+CPPUNIT_TEST_FIXTURE(PDFiumLibraryTest, testFormFields)
{
// Given a document with a form field that looks like plain text:
OUString aURL = getFullUrl(u"form-fields.pdf");
@@ -327,7 +308,7 @@ void PDFiumLibraryTest::testFormFields()
CPPUNIT_ASSERT_GREATER(static_cast<size_t>(1), aColors.size());
}
-void PDFiumLibraryTest::testAnnotationsDifferentTypes()
+CPPUNIT_TEST_FIXTURE(PDFiumLibraryTest, testAnnotationsDifferentTypes)
{
OUString aURL = getFullUrl(u"PangramWithMultipleTypeOfAnnotations.pdf");
SvFileStream aStream(aURL, StreamMode::READ);
@@ -431,7 +412,7 @@ void PDFiumLibraryTest::testAnnotationsDifferentTypes()
}
}
-void PDFiumLibraryTest::testTools()
+CPPUNIT_TEST_FIXTURE(PDFiumLibraryTest, testTools)
{
OUString sConverted = vcl::pdf::convertPdfDateToISO8601(u"D:20200612201322+02'00");
@@ -447,8 +428,6 @@ void PDFiumLibraryTest::testTools()
CPPUNIT_ASSERT_EQUAL(false, bool(aDateTime.IsUTC));
}
-CPPUNIT_TEST_SUITE_REGISTRATION(PDFiumLibraryTest);
-
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */