summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2024-08-27 15:52:27 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2024-08-28 11:31:46 +0200
commitffcd44ce7c109ca6daf9b9a339609af92f163ecf (patch)
tree134287f8d32ed7c1028126352752f09691734bf4 /vcl/qa/cppunit
parenta200d9580b36ab11a4d21285dd5a723db091afac (diff)
vcl: fix testMultiPagePDF with zlib-ng
After upgrading to Fedora 40, which replaced zlib with zlib-ng, this test fails on different compressed stream sizes, but the uncompressed content of the stream is the same as before (only checked first one). vcl/qa/cppunit/pdfexport/pdfexport2.cxx:808:(anonymous namespace)::testMultiPagePDF::TestBody equality assertion failed - Expected: 230 - Actual : 228 Change-Id: I27a6d4ac47691258793e18442fb1b59ac1b581c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172471 Reviewed-by: David Gilbert <freedesktop@treblig.org> Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'vcl/qa/cppunit')
-rw-r--r--vcl/qa/cppunit/pdfexport/pdfexport2.cxx28
1 files changed, 23 insertions, 5 deletions
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
index c3660e5a9c13..43e3e16ec034 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
@@ -804,8 +804,14 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testMultiPagePDF)
SvMemoryStream& rObjectStream = pStream->GetMemory();
rObjectStream.Seek(STREAM_SEEK_TO_BEGIN);
+ SvMemoryStream aUncompressed;
+ ZCodec aZCodec;
+ aZCodec.BeginCompression();
+ aZCodec.Decompress(rObjectStream, aUncompressed);
+ CPPUNIT_ASSERT(aZCodec.EndCompression());
+
// Just check that the size of the page stream is what is expected.
- CPPUNIT_ASSERT_EQUAL(sal_uInt64(230), rObjectStream.remainingSize());
+ CPPUNIT_ASSERT_EQUAL(sal_uInt64(1236), aUncompressed.Tell());
}
{ // embedded PDF page 2
@@ -833,8 +839,14 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testMultiPagePDF)
SvMemoryStream& rObjectStream = pStream->GetMemory();
rObjectStream.Seek(STREAM_SEEK_TO_BEGIN);
- // Just check that the size of the page stream is what is expected
- CPPUNIT_ASSERT_EQUAL(sal_uInt64(309), rObjectStream.remainingSize());
+ SvMemoryStream aUncompressed;
+ ZCodec aZCodec;
+ aZCodec.BeginCompression();
+ aZCodec.Decompress(rObjectStream, aUncompressed);
+ CPPUNIT_ASSERT(aZCodec.EndCompression());
+
+ // Just check that the size of the page stream is what is expected.
+ CPPUNIT_ASSERT_EQUAL(sal_uInt64(3911), aUncompressed.Tell());
}
{ // embedded PDF page 3
@@ -862,8 +874,14 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testMultiPagePDF)
SvMemoryStream& rObjectStream = pStream->GetMemory();
rObjectStream.Seek(STREAM_SEEK_TO_BEGIN);
- // Just check that the size of the page stream is what is expected
- CPPUNIT_ASSERT_EQUAL(sal_uInt64(193), rObjectStream.remainingSize());
+ SvMemoryStream aUncompressed;
+ ZCodec aZCodec;
+ aZCodec.BeginCompression();
+ aZCodec.Decompress(rObjectStream, aUncompressed);
+ CPPUNIT_ASSERT(aZCodec.EndCompression());
+
+ // Just check that the size of the page stream is what is expected.
+ CPPUNIT_ASSERT_EQUAL(sal_uInt64(373), aUncompressed.Tell());
}
#endif
}