[Libreoffice-commits] core.git: vcl/qa
Ashod Nakashian (via logerrit)
logerrit at kemper.freedesktop.org
Sun Dec 8 17:57:21 UTC 2019
vcl/qa/cppunit/pdfexport/pdfexport.cxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 0dad19175d65af7ea858b4e4e24ef7f7e772b6bb
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Wed Sep 4 11:02:25 2019 -0400
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Dec 8 18:56:36 2019 +0100
pdfexport: improved detection of failure to print with --disable-gui
PDF printing tests cannot run when we don't have the proper
support enabled, so we need to detect those cases and
avoid failing the test unnecessarily.
Change-Id: Ia602dbb5c3d16c082a8ff6e707db90501bb5453c
Reviewed-on: https://gerrit.libreoffice.org/78610
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/82168
Tested-by: Jenkins
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 02e597c76dd5..d6ab844e5bdb 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -651,13 +651,14 @@ void PdfExportTest::testSofthyphenPos()
SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
SvMemoryStream aMemory;
aMemory.WriteStream(aFile);
- DocumentHolder pPdfDocument(FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr));
- if (!pPdfDocument.get())
+ if (aFile.bad() || !aMemory.GetSize())
{
// Printing to PDF failed in a non-interesting way, e.g. CUPS is not
// running, there is no printer defined, etc.
return;
}
+ DocumentHolder pPdfDocument(FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr));
+ CPPUNIT_ASSERT(pPdfDocument);
// The document has one page.
CPPUNIT_ASSERT_EQUAL(1, FPDF_GetPageCount(pPdfDocument.get()));
More information about the Libreoffice-commits
mailing list