From bc937347728a669d9baeee75c6ad5eea9d8d2710 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 10 Jun 2022 11:23:24 +0200 Subject: [PATCH] tdf#114256: vcl_pdfexport: Add unittest Change-Id: Iaaeb0b248f84709855d9e83d34cecf22f1169769 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135581 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- vcl/qa/cppunit/pdfexport/data/tdf114256.ods | Bin 0 -> 7716 bytes vcl/qa/cppunit/pdfexport/pdfexport.cxx | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 vcl/qa/cppunit/pdfexport/data/tdf114256.ods diff --git a/vcl/qa/cppunit/pdfexport/data/tdf114256.ods b/vcl/qa/cppunit/pdfexport/data/tdf114256.ods new file mode 100644 index 0000000000000000000000000000000000000000..1e30a7e31ff6a88965d1da0e334eab44a2d18d92 GIT binary patch literal 7716 zcmdT}bzD?iyB@kjQV{7zLIjjsf0(OH&06oeTiL1^`5rdVvA9!q0dB0KnCO zyalj>+CdPm4iK<|gDunyjDXt1c%5P9JoaEX6wYJs0D+m?n>pD*UdTIB3YeNA5u8!+SOrVvMohb|qwT1H{{wne~z$`;F)$bGFQsW~3LZGB5r;R)} zAdgFIG~{-HPit#yySuv=7Z+FHmzT7HWpn@l3ZIgk zG|**gik*BKL|3f>q@5i$<_;QE-1?VO+ivT5gb-7|06W>1@9vd6`kC*A{ zm%j`jS%5!jD z{*Hy3uFhzv@}ZIN}D z*o4h#2joC=e}q^rH~82A=iG=jVckn%O;Fp&)+xAw@9T-Ef@4b-AXb4hs7gP{cXL7* zb(pS%>U58U%UcsjG?aerj{2mxBXicb+_R@1rRPnup0|i=RH)o?nRk4ekJhT;$7y-VCtx#y{8(9P36rA_5ed{oTPpj!!U_9s69)G67`X@baqrBT1c1x%gdu<*<0o- z*hQc(+V8llljral^i>+U3b0aiiTOn;6{+vR5B4LB#y(M?ybn(D#;Y#KXT;_=an;Z- z08#tl)Q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without the fix in place, this test would have failed with + // - Expected: 13 + // - Actual : 0 + CPPUNIT_ASSERT_EQUAL(13, pPdfPage->getObjectCount()); +} + CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf147027) { // Load the Calc document.