diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-12-04 12:58:20 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-12-04 15:56:45 +0100 |
commit | 30c54afbf5bf03da27db7f90b518817cd05e8ccd (patch) | |
tree | 3b87af6279ed2dc6e395f608e42c3d85cf3215e3 /xmlsecurity | |
parent | b760e1f28840ae5ecce0c00201fa058c17334203 (diff) |
disable tests that don't work without pdfium
we're probably past the end of the road on --disable-pdfium
Change-Id: Id91ea6c77bbdb3ecf609a7ffd16a278eb3b17e91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107222
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx index 283223b9c409..f6bdfce9c050 100644 --- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx +++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx @@ -8,6 +8,7 @@ */ #include <sal/config.h> +#include <config_features.h> #include <string_view> @@ -85,7 +86,12 @@ std::vector<SignatureInformation> PDFSigningTest::verify(const OUString& rURL, s SvFileStream aStream(rURL, StreamMode::READ); PDFSignatureHelper aHelper; CPPUNIT_ASSERT(aHelper.ReadAndVerifySignatureSvStream(aStream)); + +#if HAVE_FEATURE_PDFIUM CPPUNIT_ASSERT_EQUAL(nCount, aHelper.GetSignatureInformations().size()); +#else + (void)nCount; +#endif for (size_t i = 0; i < aHelper.GetSignatureInformations().size(); ++i) { const SignatureInformation& rInfo = aHelper.GetSignatureInformations()[i]; @@ -161,6 +167,7 @@ bool PDFSigningTest::sign(const OUString& rInURL, const OUString& rOutURL, return bSignSuccessful; } +#if HAVE_FEATURE_PDFIUM /// Test adding a new signature to a previously unsigned file. CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDFAdd) { @@ -184,6 +191,7 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDFAdd) CPPUNIT_ASSERT_EQUAL(xml::crypto::DigestID::SHA256, aInfos[0].nDigestID); } } +#endif /// Test signing a previously unsigned file twice. CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDFAdd2) @@ -205,6 +213,7 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDFAdd2) sign(aInURL, aOutURL, 1); } +#if HAVE_FEATURE_PDFIUM /// Test removing a signature from a previously signed file. CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDFRemove) { @@ -283,6 +292,8 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDFRemoveAll) CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(0), rInformations.size()); } +#endif + CPPUNIT_TEST_FIXTURE(PDFSigningTest, testTdf107782) { uno::Reference<xml::crypto::XSEInitializer> xSEInitializer @@ -305,6 +316,7 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testTdf107782) aManager.getSecurityEnvironment()); } +#if HAVE_FEATURE_PDFIUM /// Test a PDF 1.4 document, signed by Adobe. CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDF14Adobe) { @@ -316,6 +328,7 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDF14Adobe) // This was 0, out-of-PKCS#7 signature date wasn't read. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2016), aInfos[1].stDateTime.Year); } +#endif /// Test a PDF 1.6 document, signed by Adobe. CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDF16Adobe) @@ -359,6 +372,7 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDF14LOWin) verify(m_directories.getURLFromSrc(DATA_DIRECTORY) + "pdf14lowin.pdf", 1); } +#if HAVE_FEATURE_PDFIUM /// Test a PAdES document, signed by LO on Linux. CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDFPAdESGood) { @@ -458,6 +472,7 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testGood) static_cast<int>(rInformation.nStatus)); } } +#endif /// Test that we don't crash / loop while tokenizing these files. CPPUNIT_TEST_FIXTURE(PDFSigningTest, testTokenize) @@ -490,6 +505,7 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testTokenize) CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aDocument.GetPages().size()); } } +#if HAVE_FEATURE_PDFIUM /// Test handling of unknown SubFilter values. CPPUNIT_TEST_FIXTURE(PDFSigningTest, testUnknownSubFilter) @@ -533,6 +549,7 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testGoodCustomMagic) std::vector<SignatureInformation>& rInformations = aManager.getCurrentSignatureInformations(); CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(1), rInformations.size()); } +#endif CPPUNIT_PLUGIN_IMPLEMENT(); |