[Libreoffice-commits] core.git: vcl/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 30 21:57:08 UTC 2019


 vcl/qa/cppunit/pdfexport/pdfexport.cxx |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 14b9e0bf94caf0ad679a52c43c0b9501aef6b0d7
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Jan 30 17:25:16 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Jan 30 22:56:42 2019 +0100

    Consistently skip "Import the bugdoc and print to PDF" tests
    
    At least some local Linux x86 32-bit build of mine with --disable-cups (which
    might or might not be relevant) kept failing the
    
      CPPUNIT_ASSERT(pPdfDocument);
    
    in the recently added PdfExportTest::testSofthyphenPos, apparently because the
    generated temp file (maTempFile) was empty.
    
    But PdfExportTest::testTdf107868 is an older test that already gets skipped if
    !pPdfDocument, so make PdfExportTest::testSofthyphenPos be consistently skipped
    in the same way (instead of trying to find out why exactly it failed for me).
    
    Change-Id: Ifc1c507fbfb00e32ed3bf94d8d520f9c60d5c4fe
    Reviewed-on: https://gerrit.libreoffice.org/67163
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    Tested-by: Jenkins

diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 92f1bf0cd89e..98e4c20a33b3 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -626,14 +626,13 @@ void PdfExportTest::testSofthyphenPos()
     SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
     SvMemoryStream aMemory;
     aMemory.WriteStream(aFile);
-    if (aFile.bad())
+    DocumentHolder pPdfDocument(FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr));
+    if (!pPdfDocument.get())
     {
         // 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