From 0ff64e31b0c74b9b1e78a1d5ddd7be4302f33df3 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 28 Mar 2018 16:57:02 +0200 Subject: Copy test doc to temp location before opening read/write ...otherwise fails if SRCDIR is a read-only tree Change-Id: I0b81be5ba055dac133e5ee638f21c3c5f4d5736b Reviewed-on: https://gerrit.libreoffice.org/52015 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- xmlsecurity/qa/unit/signing/signing.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xmlsecurity/qa/unit/signing/signing.cxx') diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index b342adeeb80d..9d1f9240caef 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -331,7 +331,12 @@ void SigningTest::testOOXMLRemove() // Load the test document as a storage and read its signatures: purpose1 and purpose2. DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "multi.docx"; + utl::TempFile aTempFile; + aTempFile.EnableKillingFile(); + OUString aURL = aTempFile.GetURL(); + CPPUNIT_ASSERT_EQUAL( + osl::File::RC::E_None, + osl::File::copy(m_directories.getURLFromSrc(DATA_DIRECTORY) + "multi.docx", aURL)); uno::Reference xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL(ZIP_STORAGE_FORMAT_STRING, aURL, embed::ElementModes::READWRITE); CPPUNIT_ASSERT(xStorage.is()); aManager.mxStore = xStorage; -- cgit