testListLabelPDFExport segfaulting
Dan Horák
dan at danny.cz
Fri Sep 15 10:57:05 UTC 2023
On Thu, 14 Sep 2023 10:50:35 +0200
Stephan Bergmann <sbergman at redhat.com> wrote:
> On 9/14/23 09:44, Dan Horák wrote:
> > On Thu, 14 Sep 2023 09:16:38 +0200
> > Stephan Bergmann <sbergman at redhat.com> wrote:
> >> I'd suggest to rather make execution of the test dependent on
> >> $(ENABLE_PDFIUM), or on PDFIUM in $(BUILD_TYPE) (cf. configure.ac).
> >> (Otherwise, you would silently hide errors when parsePDFExport()
> >> erroneously returns null.)
> >
> > if I read
> > https://opengrok.libreoffice.org/xref/core/test/source/unoapi_test.cxx?r=58ab2f00#213
> > right, then parsePDFExport() can return NULL only when built without
> > pdfium. There is an assert checking NULL value returned from
> > pPDFium->openDocument(). Thus we shouldn't be hiding anything, I
> > believe.
>
> Yeah, it can only return null when vcl::pdf::PDFiumLibrary::get()
> returns null. Which in turn can only happen when that uses
> vcl/source/pdf/DummyPDFiumLibrary.cxx rather than
> vcl/source/pdf/PDFiumLibrary.cxx. A bit of an indirection, so I guess I
> would still use the explicit $(ENABLE_PDFIUM) way, but of course leave
> it up to you.
I went with the runtime check [1], using the $(ENABLE_PDFIUM) on the
Makefile level we would lose the whole CppunitTest_sw_globalfilter and
there is not HAVE_PDFIUM define to exclude the testListLabelPDFExport.
[1] https://gerrit.libreoffice.org/c/core/+/156940
Dan
More information about the LibreOffice
mailing list