vcl/qa/cppunit/GraphicTest.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit dad9b00e8258da13e42211f7509cfb182f18d7fc
Author:     Sebastian Andrzej Siewior <[email protected]>
AuthorDate: Tue Nov 26 22:57:38 2024 +0100
Commit:     David Gilbert <[email protected]>
CommitDate: Wed Dec 25 14:47:03 2024 +0100

    vcl/qa/cppunit/GraphicTest: Don't test for the exact size of the png file.
    
    Building with zlib-ng instead of zlib leads to the following error in the
    testsuite:
    
    | [_RUN_____] testSwappingGraphic_PNG_WithGfxLink::TestBody
    | 
./vcl/qa/cppunit/GraphicTest.cxx:528:testSwappingGraphic_PNG_WithGfxLink::TestBody
    | equality assertion failed
    | - Expected: 319
    | - Actual  : 318
    
    The different implementation of deflate() leads to a different result.
    
    Use an approximation of the expected size instead of the exact value.
    
    Change-Id: I173164bc3b1e6dd37eb48fe42093527069a54075
    Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177440
    Tested-by: Jenkins
    Reviewed-by: David Gilbert <[email protected]>

diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx
index 3821c31dcf8e..f6828ea7d8c7 100644
--- a/vcl/qa/cppunit/GraphicTest.cxx
+++ b/vcl/qa/cppunit/GraphicTest.cxx
@@ -526,7 +526,8 @@ CPPUNIT_TEST_FIXTURE(GraphicTest, 
testSwappingGraphic_PNG_WithGfxLink)
     BitmapChecksum aChecksumBeforeSwapping = aGraphic.GetChecksum();
 
     CPPUNIT_ASSERT_EQUAL(true, aGraphic.IsGfxLink());
-    CPPUNIT_ASSERT_EQUAL(sal_uInt32(319), aGraphic.GetGfxLink().GetDataSize());
+    // Expect the the compressed png is be at least W * H / 2
+    CPPUNIT_ASSERT_LESS(sal_uInt32(120 * 100 / 2), 
aGraphic.GetGfxLink().GetDataSize());
 
     // We loaded the Graphic and made it available
     CPPUNIT_ASSERT_EQUAL(false, aGraphic.ImplGetImpGraphic()->isSwappedOut());

Reply via email to