diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-10-19 15:36:14 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-10-20 10:21:14 +0200 |
commit | 498515b01aa026c2b39836f69d10b7016c89a66f (patch) | |
tree | 28a8d55975b12be70791613cca9243870d8b1290 /sd/qa | |
parent | 46ed432cf4b1111f31f61d7a2c7974288710fb1f (diff) |
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/PNGExportTests.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
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) |