From 1aaa14a63a2678397a2b34abdf0d9c896fd5c760 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 11 Mar 2021 19:50:57 +0000 Subject: explicitly assert that xSignatureInfo shouldn't be empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4cd1be8b4c0b7ecb727e6a997679a9b74c03bc15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112362 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- xmlsecurity/qa/unit/signing/signing.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xmlsecurity') diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index 5908f9059ffc..d9661d348138 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -918,6 +918,8 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testSignatureLineOOXML) = xSignatures->verifyScriptingContentSignatures(xStorage, uno::Reference()); + CPPUNIT_ASSERT(xSignatureInfo.getLength()); + // The signature should have a valid signature, and signature line with two valid images CPPUNIT_ASSERT(xSignatureInfo[0].SignatureIsValid); CPPUNIT_ASSERT_EQUAL(OUString("{DEE0514B-13E8-4674-A831-46E3CDB18BB4}"), @@ -937,6 +939,8 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testSignatureLineODF) uno::Sequence xSignatureInfo = pObjectShell->GetDocumentSignatureInformation(false); + CPPUNIT_ASSERT(xSignatureInfo.getLength()); + CPPUNIT_ASSERT(xSignatureInfo[0].SignatureIsValid); CPPUNIT_ASSERT_EQUAL(OUString("{41CF56EE-331B-4125-97D8-2F5669DD3AAC}"), xSignatureInfo[0].SignatureLineId); -- cgit