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-03-07 15:00:14 +0100
commit7d7cd95840bd3dec2e1e7e8e5f99c69673767215 (patch)
tree40cb3eecba0494e3a006e40605f1f59f212d48ea /xmlsecurity
parente60abe659d7448ae6f839740dcfe87fd8b1520d7 (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
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;