diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-03-04 20:45:24 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-03-05 08:55:49 +0100 |
commit | a04dde6b9c6d625ac80acbad1e599dbd8edf3579 (patch) | |
tree | 64ce513ad0ea3a780e13ca838ed2db36d4661e9c | |
parent | dbbda04d52e75858840ce9748a19a61a1c565149 (diff) |
CppunitTest_xmlsecurity_signing: run all tests in the disable-pdfium case
Return early in case pdfium is not available, to avoid the ifdef forest.
Change-Id: Ifdf71eb01437e4257679c9be7a25de9a3133a660
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111978
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | xmlsecurity/qa/unit/signing/signing.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index cfe9c749cff0..5908f9059ffc 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -54,11 +54,6 @@ #include <comphelper/propertyvalue.hxx> #include <vcl/filter/PDFiumLibrary.hxx> -#if HAVE_FEATURE_PDFIUM -#include <fpdf_annot.h> -#include <fpdfview.h> -#endif - using namespace com::sun::star; namespace @@ -619,9 +614,14 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPDFNo) static_cast<int>(pObjectShell->GetDocumentSignatureState())); } -#if HAVE_FEATURE_PDFIUM CPPUNIT_TEST_FIXTURE(SigningTest, testPDFAddVisibleSignature) { + std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get(); + if (!pPDFium) + { + return; + } + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. if (!IsDefaultDPI()) @@ -670,7 +670,6 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPDFAddVisibleSignature) pObjectShell->SignDocumentContentUsingCertificate(aCertificates[0]); // Then: count the # of shapes on the signature widget/annotation. - std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get(); SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ); SvMemoryStream aMemory; aMemory.WriteStream(aFile); @@ -685,7 +684,6 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPDFAddVisibleSignature) // i.e. the signature was there, but it was empty / not visible. CPPUNIT_ASSERT_EQUAL(4, pAnnot->getObjectCount()); } -#endif #endif |