sd/qa/unit/PNGExportTests.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
New commits: commit d83b84e00b33a694a28a6a08ce39d9da03b45ab7 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Sep 8 16:22:30 2022 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu Sep 8 16:34:31 2022 +0200 Fix CppunitTest_sd_png_export_tests on non-default DPI Change-Id: Id969646a82b9a408fff111c794a6096d8e857db8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139678 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx index d38e8826a8c9..a03350d8c882 100644 --- a/sd/qa/unit/PNGExportTests.cxx +++ b/sd/qa/unit/PNGExportTests.cxx @@ -84,8 +84,8 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf105998) // make sure only the shape is exported Size aSize = aBMPEx.GetSizePixel(); const auto[scalingX, scalingY] = getDPIScaling(); - CPPUNIT_ASSERT_DOUBLES_EQUAL(193 * scalingX, aSize.getWidth(), 1.0); - CPPUNIT_ASSERT_DOUBLES_EQUAL(193 * scalingY, aSize.getHeight(), 1.0); + CPPUNIT_ASSERT_DOUBLES_EQUAL(193 * scalingX, aSize.getWidth(), 1.5); + CPPUNIT_ASSERT_DOUBLES_EQUAL(193 * scalingY, aSize.getHeight(), 1.5); if (!IsDefaultDPI()) return; @@ -149,8 +149,10 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319) // make sure only the shape is exported Size aSize = aBMPEx.GetSizePixel(); const auto[scalingX, scalingY] = getDPIScaling(); - CPPUNIT_ASSERT_DOUBLES_EQUAL(295 * scalingX, aSize.getWidth(), 1.0); - CPPUNIT_ASSERT_DOUBLES_EQUAL(134 * scalingY, aSize.getHeight(), 1.0); + CPPUNIT_ASSERT_DOUBLES_EQUAL(295 * scalingX, aSize.getWidth(), 1.5); + CPPUNIT_ASSERT_DOUBLES_EQUAL(134 * scalingY, aSize.getHeight(), 1.5); + if (!IsDefaultDPI()) + return; // Check all borders are red or similar. Ignore the corners Bitmap aBMP = aBMPEx.GetBitmap();