summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-03-07 11:44:28 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-07 17:42:31 +0200
commit0090eb74645d31b0c36120c4749ab6a9afd07d04 (patch)
treee7acb03bdf44d612e03e044b502287447f3e7813 /xmlsecurity
parent01c64e1624258f1f3ebee9769b38e7b51fdcf99b (diff)
CppunitTest_xmlsecurity_signing: avoid modifying tracked test document
Without this, running the test modified xmlsecurity/qa/unit/signing/data/partial.docx. Change-Id: I3dd5cb6c90037fce0c550be9b1c189959b848ebe (cherry picked from commit 7d7cd95840bd3dec2e1e7e8e5f99c69673767215)
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/qa/unit/signing/signing.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index aa062d039d5c..aa77fa00b1db 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -35,6 +35,7 @@
#include <tools/time.hxx>
#include <sfx2/sfxbasemodel.hxx>
#include <sfx2/objsh.hxx>
+#include <osl/file.hxx>
#include <xmlsecurity/documentsignaturehelper.hxx>
#include <xmlsecurity/xmlsignaturehelper.hxx>
@@ -199,10 +200,14 @@ void SigningTest::testOOXMLDescription()
void SigningTest::testOOXMLAppend()
{
+ // Copy the test document to a temporary file, as it'll be modified.
+ utl::TempFile aTempFile;
+ aTempFile.EnableKillingFile();
+ OUString aURL = aTempFile.GetURL();
+ osl::File::copy(getURLFromSrc(DATA_DIRECTORY) + "partial.docx", aURL);
// Load the test document as a storage and read its single signature.
DocumentSignatureManager aManager(mxComponentContext, SignatureModeDocumentContent);
CPPUNIT_ASSERT(aManager.maSignatureHelper.Init());
- OUString aURL = getURLFromSrc(DATA_DIRECTORY) + "partial.docx";
uno::Reference <embed::XStorage> xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL(ZIP_STORAGE_FORMAT_STRING, aURL, embed::ElementModes::READWRITE);
CPPUNIT_ASSERT(xStorage.is());
aManager.mxStore = xStorage;