summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-09-04 11:02:25 -0400
committerAndras Timar <andras.timar@collabora.com>2019-12-08 18:56:36 +0100
commit0dad19175d65af7ea858b4e4e24ef7f7e772b6bb (patch)
treebc551fb8b3a48fda03cc5beabe4a36bac344c9dc /vcl/qa
parente4ec5a3ee048c530cffab7f43380ee7a7c2a7d07 (diff)
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@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/82168 Tested-by: Jenkins
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/pdfexport/pdfexport.cxx5
1 files changed, 3 insertions, 2 deletions
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()));