diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-07-04 13:01:36 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-07-04 17:32:54 +0200 |
commit | e6cf27e46a48580892ecd0d82f8e55ff9aed465d (patch) | |
tree | 6b0ec7f8e2950dea665c0ab69e8b9508271971d9 /vcl/qa/cppunit/GraphicTest.cxx | |
parent | 2559baf56eed67dd97183d8852360866b5fe9d4e (diff) |
tdf#156016: vcl_graphic_test: Add unittest
Change-Id: I0b8a9c8d8440e5084f1cce6e666e20d4508cc691
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153963
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 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx index 3cbbcbecf112..606936c65f9e 100644 --- a/vcl/qa/cppunit/GraphicTest.cxx +++ b/vcl/qa/cppunit/GraphicTest.cxx @@ -1282,6 +1282,18 @@ CPPUNIT_TEST_FIXTURE(GraphicTest, testLoadSVGZ) CPPUNIT_ASSERT_EQUAL(tools::Long(100 * scalingY), aGraphic.GetSizePixel().Height()); } +CPPUNIT_TEST_FIXTURE(GraphicTest, testTdf156016) +{ + // Without the fix in place, this test would have failed with + // - Expected: 0x0(Error Area:Io Class:NONE Code:0) + // - Actual : 0x8203(Error Area:Vcl Class:General Code:3) + Graphic aGraphic = loadGraphic(u"tdf156016.svg"); + CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType()); + const auto[scalingX, scalingY] = getDPIScaling(); + CPPUNIT_ASSERT_EQUAL(tools::Long(100 * scalingX), aGraphic.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(tools::Long(100 * scalingY), aGraphic.GetSizePixel().Height()); +} + CPPUNIT_TEST_FIXTURE(GraphicTest, testAvailableThreaded) { Graphic jpgGraphic1 = importUnloadedGraphic(u"TypeDetectionExample.jpg"); |