sd/qa/unit/PNGExportTests.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
New commits: commit 498515b01aa026c2b39836f69d10b7016c89a66f Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Oct 19 15:36:14 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Oct 20 10:21:14 2023 +0200 CppunitTest_sd_png_export_tests: relax test a bit See https://gerrit.libreoffice.org/c/core/+/157763 Change-Id: I397adc22e29c595c3bfaf0331a1774f192f0fc85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158181 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx index 8f012347644a..6c6d13a8a942 100644 --- a/sd/qa/unit/PNGExportTests.cxx +++ b/sd/qa/unit/PNGExportTests.cxx @@ -284,18 +284,21 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf156808) CPPUNIT_ASSERT_EQUAL(Size(100, 100), aSize); Bitmap aBMP = aBMPEx.GetBitmap(); Bitmap::ScopedReadAccess pReadAccess(aBMP); - for (tools::Long nX = 2; nX < aSize.Width() - 2; ++nX) + int nBlackCount = 0; + for (tools::Long nX = 1; nX < aSize.Width() - 1; ++nX) { for (tools::Long nY = 1; nY < aSize.Height() - 1; ++nY) { const Color aColor = pReadAccess->GetColor(nY, nX); - - // Without the fix in place, this test would have failed with - // - Expected: rgba[000000ff] - // - Actual : rgba[ffffffff] - CPPUNIT_ASSERT_EQUAL(COL_BLACK, aColor); + if (aColor == COL_BLACK) + ++nBlackCount; } } + + // Without the fix in place, this test would have failed with + // - Expected greater than: 9300 + // - Actual : 0 + CPPUNIT_ASSERT_GREATER(9300, nBlackCount); } CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf157636)