vcl/qa/cppunit/GraphicTest.cxx                |   10 ++++++++++
 vcl/qa/cppunit/data/TypeDetectionExample.svgz |binary
 2 files changed, 10 insertions(+)

New commits:
commit 845fa950ac635ea57dd860fb96fadcfb75e97f2b
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu Sep 8 13:37:35 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Sep 8 17:35:37 2022 +0200

    tdf#150808: vcl_graphic_test: Add unittest
    
    Change-Id: Icc0f323606d5702abe03e1537e42fbd78dc6b297
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139651
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx
index 97ef23eac15d..09bf18782708 100644
--- a/vcl/qa/cppunit/GraphicTest.cxx
+++ b/vcl/qa/cppunit/GraphicTest.cxx
@@ -84,6 +84,7 @@ private:
     void testLoadPCX();
     void testLoadEPS();
     void testLoadWEBP();
+    void testLoadSVGZ();
 
     void testAvailableThreaded();
     void testColorChangeToTransparent();
@@ -123,6 +124,7 @@ private:
     CPPUNIT_TEST(testLoadPCX);
     CPPUNIT_TEST(testLoadEPS);
     CPPUNIT_TEST(testLoadWEBP);
+    CPPUNIT_TEST(testLoadSVGZ);
 
     CPPUNIT_TEST(testAvailableThreaded);
     CPPUNIT_TEST(testColorChangeToTransparent);
@@ -1325,6 +1327,14 @@ void GraphicTest::testLoadWEBP()
     CPPUNIT_ASSERT_EQUAL(tools::Long(10), aGraphic.GetSizePixel().Height());
 }
 
+void GraphicTest::testLoadSVGZ()
+{
+    Graphic aGraphic = loadGraphic(u"TypeDetectionExample.svgz");
+    CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType());
+    CPPUNIT_ASSERT_EQUAL(tools::Long(100), aGraphic.GetSizePixel().Width());
+    CPPUNIT_ASSERT_EQUAL(tools::Long(100), aGraphic.GetSizePixel().Height());
+}
+
 void GraphicTest::testAvailableThreaded()
 {
     Graphic jpgGraphic1 = importUnloadedGraphic(u"TypeDetectionExample.jpg");
diff --git a/vcl/qa/cppunit/data/TypeDetectionExample.svgz 
b/vcl/qa/cppunit/data/TypeDetectionExample.svgz
index 17c1bcc3c7f1..ef04021fd029 100644
Binary files a/vcl/qa/cppunit/data/TypeDetectionExample.svgz and 
b/vcl/qa/cppunit/data/TypeDetectionExample.svgz differ

Reply via email to