diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-07-04 12:39:07 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-07-04 15:16:04 +0200 |
commit | 0c9e09af8ab85122e56bf0a40e1056248565ed75 (patch) | |
tree | cd42626d28e030f1fb9f6ea2c606e0f87ddd7664 /vcl/qa/cppunit/GraphicTest.cxx | |
parent | cf40ee4a162da5f357793463e5707492030eb5df (diff) |
CppunitTest_vcl_graphic_test: use CPPUNIT_TEST_FIXTURE()
Avoiding the declaration/registration/definition of each
test manually saves a lot of space.
Change-Id: I8a310a6aca3e575f93737cc50e0614592a7ffc8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153958
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'vcl/qa/cppunit/GraphicTest.cxx')
-rw-r--r-- | vcl/qa/cppunit/GraphicTest.cxx | 233 |
1 files changed, 70 insertions, 163 deletions
diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx index d9ba3b875486..3cbbcbecf112 100644 --- a/vcl/qa/cppunit/GraphicTest.cxx +++ b/vcl/qa/cppunit/GraphicTest.cxx @@ -41,103 +41,10 @@ using namespace css; -namespace -{ class GraphicTest : public test::BootstrapFixture { public: ~GraphicTest(); - -private: - void testUnloadedGraphic(); - void testUnloadedGraphicLoadingPng(); - void testUnloadedGraphicLoadingGif(); - void testUnloadedGraphicLoadingJpg(); - void testUnloadedGraphicLoadingTif(); - void testUnloadedGraphicLoadingWebp(); - void testUnloadedGraphicWmf(); - void testUnloadedGraphicAlpha(); - void testUnloadedGraphicSizeUnit(); - - void testWMFRoundtrip(); - void testWMFWithEmfPlusRoundtrip(); - void testEmfToWmfConversion(); - - void testSwappingGraphic_PNG_WithGfxLink(); - void testSwappingGraphic_PNG_WithoutGfxLink(); - void testSwappingGraphicProperties_PNG_WithGfxLink(); - void testSwappingGraphicProperties_PNG_WithoutGfxLink(); - - void testSwappingVectorGraphic_SVG_WithGfxLink(); - void testSwappingVectorGraphic_SVG_WithoutGfxLink(); - void testSwappingGraphicProperties_SVG_WithGfxLink(); - void testSwappingGraphicProperties_SVG_WithoutGfxLink(); - - void testSwappingVectorGraphic_PDF_WithGfxLink(); - void testSwappingVectorGraphic_PDF_WithoutGfxLink(); - - void testSwappingAnimationGraphic_GIF_WithGfxLink(); - void testSwappingAnimationGraphic_GIF_WithoutGfxLink(); - - void testLoadMET(); - void testLoadBMP(); - void testLoadPSD(); - void testLoadTGA(); - void testLoadXBM(); - void testLoadXPM(); - void testLoadPCX(); - void testLoadEPS(); - void testLoadWEBP(); - void testLoadSVGZ(); - - void testAvailableThreaded(); - void testColorChangeToTransparent(); - - CPPUNIT_TEST_SUITE(GraphicTest); - CPPUNIT_TEST(testUnloadedGraphic); - CPPUNIT_TEST(testUnloadedGraphicLoadingPng); - CPPUNIT_TEST(testUnloadedGraphicLoadingGif); - CPPUNIT_TEST(testUnloadedGraphicLoadingJpg); - CPPUNIT_TEST(testUnloadedGraphicLoadingTif); - CPPUNIT_TEST(testUnloadedGraphicLoadingWebp); - CPPUNIT_TEST(testUnloadedGraphicWmf); - CPPUNIT_TEST(testUnloadedGraphicAlpha); - CPPUNIT_TEST(testUnloadedGraphicSizeUnit); - CPPUNIT_TEST(testWMFRoundtrip); - CPPUNIT_TEST(testWMFWithEmfPlusRoundtrip); - CPPUNIT_TEST(testEmfToWmfConversion); - - CPPUNIT_TEST(testSwappingGraphic_PNG_WithGfxLink); - CPPUNIT_TEST(testSwappingGraphic_PNG_WithoutGfxLink); - CPPUNIT_TEST(testSwappingGraphicProperties_PNG_WithGfxLink); - CPPUNIT_TEST(testSwappingGraphicProperties_PNG_WithoutGfxLink); - - CPPUNIT_TEST(testSwappingVectorGraphic_SVG_WithGfxLink); - CPPUNIT_TEST(testSwappingVectorGraphic_SVG_WithoutGfxLink); - CPPUNIT_TEST(testSwappingGraphicProperties_SVG_WithGfxLink); - CPPUNIT_TEST(testSwappingGraphicProperties_SVG_WithoutGfxLink); - - CPPUNIT_TEST(testSwappingVectorGraphic_PDF_WithGfxLink); - CPPUNIT_TEST(testSwappingVectorGraphic_PDF_WithoutGfxLink); - - CPPUNIT_TEST(testSwappingAnimationGraphic_GIF_WithGfxLink); - CPPUNIT_TEST(testSwappingAnimationGraphic_GIF_WithoutGfxLink); - - CPPUNIT_TEST(testLoadMET); - CPPUNIT_TEST(testLoadBMP); - CPPUNIT_TEST(testLoadPSD); - CPPUNIT_TEST(testLoadTGA); - CPPUNIT_TEST(testLoadXBM); - CPPUNIT_TEST(testLoadXPM); - CPPUNIT_TEST(testLoadPCX); - CPPUNIT_TEST(testLoadEPS); - CPPUNIT_TEST(testLoadWEBP); - CPPUNIT_TEST(testLoadSVGZ); - - CPPUNIT_TEST(testAvailableThreaded); - CPPUNIT_TEST(testColorChangeToTransparent); - - CPPUNIT_TEST_SUITE_END(); }; GraphicTest::~GraphicTest() @@ -147,6 +54,8 @@ GraphicTest::~GraphicTest() #endif } +namespace +{ BitmapEx createBitmap(bool alpha = false) { Bitmap aBitmap(Size(120, 100), vcl::PixelFormat::N24_BPP); @@ -262,7 +171,39 @@ Graphic importUnloadedGraphic(std::u16string_view const& rFilename) return rGraphicFilter.ImportUnloadedGraphic(aFileStream); } -void GraphicTest::testUnloadedGraphic() +int getEmfPlusActionsCount(const Graphic& graphic) +{ + const GDIMetaFile& metafile = graphic.GetGDIMetaFile(); + int emfPlusCount = 0; + for (size_t i = 0; i < metafile.GetActionSize(); ++i) + { + MetaAction* action = metafile.GetAction(i); + if (action->GetType() == MetaActionType::COMMENT) + { + const MetaCommentAction* commentAction = static_cast<const MetaCommentAction*>(action); + if (commentAction->GetComment() == "EMF_PLUS") + ++emfPlusCount; + } + } + return emfPlusCount; +} + +int getPolygonActionsCount(const Graphic& graphic) +{ + const GDIMetaFile& metafile = graphic.GetGDIMetaFile(); + int polygonCount = 0; + for (size_t i = 0; i < metafile.GetActionSize(); ++i) + { + MetaAction* action = metafile.GetAction(i); + if (action->GetType() == MetaActionType::POLYGON) + ++polygonCount; + } + return polygonCount; +} + +} //namespace + +CPPUNIT_TEST_FIXTURE(GraphicTest, testUnloadedGraphic) { // make unloaded test graphic Graphic aGraphic = makeUnloadedGraphic(u"png"); @@ -302,7 +243,7 @@ void GraphicTest::testUnloadedGraphic() CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); } -void GraphicTest::testUnloadedGraphicLoadingPng() +CPPUNIT_TEST_FIXTURE(GraphicTest, testUnloadedGraphicLoadingPng) { Graphic aGraphic = makeUnloadedGraphic(u"png"); @@ -317,7 +258,7 @@ void GraphicTest::testUnloadedGraphicLoadingPng() CPPUNIT_ASSERT_EQUAL(true, checkBitmap(aGraphic)); } -void GraphicTest::testUnloadedGraphicLoadingGif() +CPPUNIT_TEST_FIXTURE(GraphicTest, testUnloadedGraphicLoadingGif) { Graphic aGraphic = makeUnloadedGraphic(u"gif"); @@ -332,7 +273,7 @@ void GraphicTest::testUnloadedGraphicLoadingGif() CPPUNIT_ASSERT_EQUAL(true, checkBitmap(aGraphic)); } -void GraphicTest::testUnloadedGraphicLoadingJpg() +CPPUNIT_TEST_FIXTURE(GraphicTest, testUnloadedGraphicLoadingJpg) { Graphic aGraphic = makeUnloadedGraphic(u"jpg"); @@ -347,7 +288,7 @@ void GraphicTest::testUnloadedGraphicLoadingJpg() CPPUNIT_ASSERT_EQUAL(false, checkBitmap(aGraphic)); } -void GraphicTest::testUnloadedGraphicLoadingTif() +CPPUNIT_TEST_FIXTURE(GraphicTest, testUnloadedGraphicLoadingTif) { Graphic aGraphic = makeUnloadedGraphic(u"tif"); @@ -362,7 +303,7 @@ void GraphicTest::testUnloadedGraphicLoadingTif() CPPUNIT_ASSERT_EQUAL(true, checkBitmap(aGraphic)); } -void GraphicTest::testUnloadedGraphicLoadingWebp() +CPPUNIT_TEST_FIXTURE(GraphicTest, testUnloadedGraphicLoadingWebp) { Graphic aGraphic = makeUnloadedGraphic(u"webp"); @@ -377,7 +318,7 @@ void GraphicTest::testUnloadedGraphicLoadingWebp() CPPUNIT_ASSERT_EQUAL(true, checkBitmap(aGraphic)); } -void GraphicTest::testUnloadedGraphicWmf() +CPPUNIT_TEST_FIXTURE(GraphicTest, testUnloadedGraphicWmf) { // Create some in-memory WMF data, set its own preferred size to 99x99. BitmapEx aBitmapEx = createBitmap(); @@ -402,7 +343,7 @@ void GraphicTest::testUnloadedGraphicWmf() CPPUNIT_ASSERT_EQUAL(Size(42, 42), aGraphic.GetPrefSize()); } -void GraphicTest::testUnloadedGraphicAlpha() +CPPUNIT_TEST_FIXTURE(GraphicTest, testUnloadedGraphicAlpha) { // make unloaded test graphic with alpha Graphic aGraphic = makeUnloadedGraphic(u"png", true); @@ -419,7 +360,7 @@ void GraphicTest::testUnloadedGraphicAlpha() CPPUNIT_ASSERT_EQUAL(false, aGraphic.isAvailable()); } -void GraphicTest::testUnloadedGraphicSizeUnit() +CPPUNIT_TEST_FIXTURE(GraphicTest, testUnloadedGraphicSizeUnit) { GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); test::Directories aDirectories; @@ -440,7 +381,7 @@ void GraphicTest::testUnloadedGraphicSizeUnit() CPPUNIT_ASSERT_EQUAL(Size(400, 363), aGraphic.GetPrefSize()); } -void GraphicTest::testWMFRoundtrip() +CPPUNIT_TEST_FIXTURE(GraphicTest, testWMFRoundtrip) { // Load a WMF file. test::Directories aDirectories; @@ -467,37 +408,7 @@ void GraphicTest::testWMFRoundtrip() CPPUNIT_ASSERT_EQUAL(nExpectedSize, nActualSize); } -int getEmfPlusActionsCount(const Graphic& graphic) -{ - const GDIMetaFile& metafile = graphic.GetGDIMetaFile(); - int emfPlusCount = 0; - for (size_t i = 0; i < metafile.GetActionSize(); ++i) - { - MetaAction* action = metafile.GetAction(i); - if (action->GetType() == MetaActionType::COMMENT) - { - const MetaCommentAction* commentAction = static_cast<const MetaCommentAction*>(action); - if (commentAction->GetComment() == "EMF_PLUS") - ++emfPlusCount; - } - } - return emfPlusCount; -} - -int getPolygonActionsCount(const Graphic& graphic) -{ - const GDIMetaFile& metafile = graphic.GetGDIMetaFile(); - int polygonCount = 0; - for (size_t i = 0; i < metafile.GetActionSize(); ++i) - { - MetaAction* action = metafile.GetAction(i); - if (action->GetType() == MetaActionType::POLYGON) - ++polygonCount; - } - return polygonCount; -} - -void GraphicTest::testWMFWithEmfPlusRoundtrip() +CPPUNIT_TEST_FIXTURE(GraphicTest, testWMFWithEmfPlusRoundtrip) { // Load a WMF file. test::Directories aDirectories; @@ -541,7 +452,7 @@ void GraphicTest::testWMFWithEmfPlusRoundtrip() } } -void GraphicTest::testEmfToWmfConversion() +CPPUNIT_TEST_FIXTURE(GraphicTest, testEmfToWmfConversion) { // Load EMF data. GraphicFilter aGraphicFilter; @@ -599,7 +510,7 @@ void GraphicTest::testEmfToWmfConversion() CPPUNIT_ASSERT_LESSEQUAL(4, nCommentCount); } -void GraphicTest::testSwappingGraphic_PNG_WithGfxLink() +CPPUNIT_TEST_FIXTURE(GraphicTest, testSwappingGraphic_PNG_WithGfxLink) { // Prepare Graphic from a PNG image first Graphic aGraphic = makeUnloadedGraphic(u"png"); @@ -649,7 +560,7 @@ void GraphicTest::testSwappingGraphic_PNG_WithGfxLink() CPPUNIT_ASSERT_EQUAL(true, checkBitmap(aGraphic)); } -void GraphicTest::testSwappingGraphic_PNG_WithoutGfxLink() +CPPUNIT_TEST_FIXTURE(GraphicTest, testSwappingGraphic_PNG_WithoutGfxLink) { // Prepare Graphic from a PNG image first @@ -717,7 +628,7 @@ void GraphicTest::testSwappingGraphic_PNG_WithoutGfxLink() CPPUNIT_ASSERT_EQUAL(true, checkBitmap(aGraphic)); } -void GraphicTest::testSwappingGraphicProperties_PNG_WithGfxLink() +CPPUNIT_TEST_FIXTURE(GraphicTest, testSwappingGraphicProperties_PNG_WithGfxLink) { // Prepare Graphic from a PNG image Graphic aGraphic = makeUnloadedGraphic(u"png"); @@ -767,7 +678,7 @@ void GraphicTest::testSwappingGraphicProperties_PNG_WithGfxLink() CPPUNIT_ASSERT_EQUAL(tools::Long(100), aGraphic.GetPrefSize().Height()); } -void GraphicTest::testSwappingGraphicProperties_PNG_WithoutGfxLink() +CPPUNIT_TEST_FIXTURE(GraphicTest, testSwappingGraphicProperties_PNG_WithoutGfxLink) { // Prepare Graphic from a PNG image Graphic aGraphic(makeUnloadedGraphic(u"png").GetBitmapEx()); @@ -817,7 +728,7 @@ void GraphicTest::testSwappingGraphicProperties_PNG_WithoutGfxLink() CPPUNIT_ASSERT_EQUAL(tools::Long(100), aGraphic.GetPrefSize().Height()); } -void GraphicTest::testSwappingVectorGraphic_SVG_WithGfxLink() +CPPUNIT_TEST_FIXTURE(GraphicTest, testSwappingVectorGraphic_SVG_WithGfxLink) { test::Directories aDirectories; OUString aURL = aDirectories.getURLFromSrc(DATA_DIRECTORY) + "SimpleExample.svg"; @@ -877,7 +788,7 @@ void GraphicTest::testSwappingVectorGraphic_SVG_WithGfxLink() CPPUNIT_ASSERT_EQUAL(rByteSize, aGraphic.GetSizeBytes()); } -void GraphicTest::testSwappingVectorGraphic_SVG_WithoutGfxLink() +CPPUNIT_TEST_FIXTURE(GraphicTest, testSwappingVectorGraphic_SVG_WithoutGfxLink) { test::Directories aDirectories; OUString aURL = aDirectories.getURLFromSrc(DATA_DIRECTORY) + "SimpleExample.svg"; @@ -956,7 +867,7 @@ void GraphicTest::testSwappingVectorGraphic_SVG_WithoutGfxLink() aGraphic.ImplGetImpGraphic()->getSwapFileStream()); } -void GraphicTest::testSwappingGraphicProperties_SVG_WithGfxLink() +CPPUNIT_TEST_FIXTURE(GraphicTest, testSwappingGraphicProperties_SVG_WithGfxLink) { // FIXME: the DPI check should be removed when either (1) the test is fixed to work with // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. @@ -1020,7 +931,7 @@ void GraphicTest::testSwappingGraphicProperties_SVG_WithGfxLink() CPPUNIT_ASSERT_EQUAL(tools::Long(51), aGraphic.GetSizePixel().Height()); } -void GraphicTest::testSwappingGraphicProperties_SVG_WithoutGfxLink() +CPPUNIT_TEST_FIXTURE(GraphicTest, testSwappingGraphicProperties_SVG_WithoutGfxLink) { // FIXME: the DPI check should be removed when either (1) the test is fixed to work with // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. @@ -1087,7 +998,7 @@ void GraphicTest::testSwappingGraphicProperties_SVG_WithoutGfxLink() CPPUNIT_ASSERT_EQUAL(tools::Long(51), aGraphic.GetSizePixel().Height()); } -void GraphicTest::testSwappingVectorGraphic_PDF_WithGfxLink() +CPPUNIT_TEST_FIXTURE(GraphicTest, testSwappingVectorGraphic_PDF_WithGfxLink) { test::Directories aDirectories; OUString aURL = aDirectories.getURLFromSrc(PDFEXPORT_DATA_DIRECTORY) + "SimpleMultiPagePDF.pdf"; @@ -1126,7 +1037,7 @@ void GraphicTest::testSwappingVectorGraphic_PDF_WithGfxLink() CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aGraphic.getVectorGraphicData()->getPageIndex()); } -void GraphicTest::testSwappingVectorGraphic_PDF_WithoutGfxLink() +CPPUNIT_TEST_FIXTURE(GraphicTest, testSwappingVectorGraphic_PDF_WithoutGfxLink) { test::Directories aDirectories; OUString aURL = aDirectories.getURLFromSrc(PDFEXPORT_DATA_DIRECTORY) + "SimpleMultiPagePDF.pdf"; @@ -1166,7 +1077,7 @@ void GraphicTest::testSwappingVectorGraphic_PDF_WithoutGfxLink() CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aGraphic.getVectorGraphicData()->getPageIndex()); } -void GraphicTest::testSwappingAnimationGraphic_GIF_WithGfxLink() +CPPUNIT_TEST_FIXTURE(GraphicTest, testSwappingAnimationGraphic_GIF_WithGfxLink) { test::Directories aDirectories; OUString aURL = aDirectories.getURLFromSrc(DATA_DIRECTORY) + "123_Numbers.gif"; @@ -1226,7 +1137,7 @@ void GraphicTest::testSwappingAnimationGraphic_GIF_WithGfxLink() CPPUNIT_ASSERT_EQUAL(rByteSize, aGraphic.GetSizeBytes()); } -void GraphicTest::testSwappingAnimationGraphic_GIF_WithoutGfxLink() +CPPUNIT_TEST_FIXTURE(GraphicTest, testSwappingAnimationGraphic_GIF_WithoutGfxLink) { test::Directories aDirectories; OUString aURL = aDirectories.getURLFromSrc(DATA_DIRECTORY) + "123_Numbers.gif"; @@ -1294,13 +1205,13 @@ void GraphicTest::testSwappingAnimationGraphic_GIF_WithoutGfxLink() CPPUNIT_ASSERT_EQUAL(rByteSize, aGraphic.GetSizeBytes()); } -void GraphicTest::testLoadMET() +CPPUNIT_TEST_FIXTURE(GraphicTest, testLoadMET) { Graphic aGraphic = loadGraphic(u"TypeDetectionExample.met"); CPPUNIT_ASSERT_EQUAL(GraphicType::GdiMetafile, aGraphic.GetType()); } -void GraphicTest::testLoadBMP() +CPPUNIT_TEST_FIXTURE(GraphicTest, testLoadBMP) { Graphic aGraphic = loadGraphic(u"TypeDetectionExample.bmp"); CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); @@ -1308,7 +1219,7 @@ void GraphicTest::testLoadBMP() CPPUNIT_ASSERT_EQUAL(tools::Long(10), aGraphic.GetSizePixel().Height()); } -void GraphicTest::testLoadPSD() +CPPUNIT_TEST_FIXTURE(GraphicTest, testLoadPSD) { Graphic aGraphic = loadGraphic(u"TypeDetectionExample.psd"); CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); @@ -1316,7 +1227,7 @@ void GraphicTest::testLoadPSD() CPPUNIT_ASSERT_EQUAL(tools::Long(10), aGraphic.GetSizePixel().Height()); } -void GraphicTest::testLoadTGA() +CPPUNIT_TEST_FIXTURE(GraphicTest, testLoadTGA) { Graphic aGraphic = loadGraphic(u"TypeDetectionExample.tga"); CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); @@ -1324,7 +1235,7 @@ void GraphicTest::testLoadTGA() CPPUNIT_ASSERT_EQUAL(tools::Long(10), aGraphic.GetSizePixel().Height()); } -void GraphicTest::testLoadXBM() +CPPUNIT_TEST_FIXTURE(GraphicTest, testLoadXBM) { Graphic aGraphic = loadGraphic(u"TypeDetectionExample.xbm"); CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); @@ -1332,7 +1243,7 @@ void GraphicTest::testLoadXBM() CPPUNIT_ASSERT_EQUAL(tools::Long(10), aGraphic.GetSizePixel().Height()); } -void GraphicTest::testLoadXPM() +CPPUNIT_TEST_FIXTURE(GraphicTest, testLoadXPM) { Graphic aGraphic = loadGraphic(u"TypeDetectionExample.xpm"); CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); @@ -1340,7 +1251,7 @@ void GraphicTest::testLoadXPM() CPPUNIT_ASSERT_EQUAL(tools::Long(10), aGraphic.GetSizePixel().Height()); } -void GraphicTest::testLoadPCX() +CPPUNIT_TEST_FIXTURE(GraphicTest, testLoadPCX) { Graphic aGraphic = loadGraphic(u"TypeDetectionExample.pcx"); CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); @@ -1348,13 +1259,13 @@ void GraphicTest::testLoadPCX() CPPUNIT_ASSERT_EQUAL(tools::Long(10), aGraphic.GetSizePixel().Height()); } -void GraphicTest::testLoadEPS() +CPPUNIT_TEST_FIXTURE(GraphicTest, testLoadEPS) { Graphic aGraphic = loadGraphic(u"TypeDetectionExample.eps"); CPPUNIT_ASSERT_EQUAL(GraphicType::GdiMetafile, aGraphic.GetType()); } -void GraphicTest::testLoadWEBP() +CPPUNIT_TEST_FIXTURE(GraphicTest, testLoadWEBP) { Graphic aGraphic = loadGraphic(u"TypeDetectionExample.webp"); CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); @@ -1362,7 +1273,7 @@ void GraphicTest::testLoadWEBP() CPPUNIT_ASSERT_EQUAL(tools::Long(10), aGraphic.GetSizePixel().Height()); } -void GraphicTest::testLoadSVGZ() +CPPUNIT_TEST_FIXTURE(GraphicTest, testLoadSVGZ) { Graphic aGraphic = loadGraphic(u"TypeDetectionExample.svgz"); CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); @@ -1371,7 +1282,7 @@ void GraphicTest::testLoadSVGZ() CPPUNIT_ASSERT_EQUAL(tools::Long(100 * scalingY), aGraphic.GetSizePixel().Height()); } -void GraphicTest::testAvailableThreaded() +CPPUNIT_TEST_FIXTURE(GraphicTest, testAvailableThreaded) { Graphic jpgGraphic1 = importUnloadedGraphic(u"TypeDetectionExample.jpg"); Graphic jpgGraphic2 = importUnloadedGraphic(u"Exif1.jpg"); @@ -1395,7 +1306,7 @@ void GraphicTest::testAvailableThreaded() } } -void GraphicTest::testColorChangeToTransparent() +CPPUNIT_TEST_FIXTURE(GraphicTest, testColorChangeToTransparent) { Graphic aGraphic = importUnloadedGraphic(u"testColorChange-red-linear-gradient.png"); @@ -1424,10 +1335,6 @@ void GraphicTest::testColorChangeToTransparent() rBitmapAfter.GetPixelColor(410, 140)); } -} // namespace - -CPPUNIT_TEST_SUITE_REGISTRATION(GraphicTest); - CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |