summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorAleksas Pantechovskis <alex.pantec@gmail.com>2016-03-05 23:56:35 +0200
committerMichael Stahl <mstahl@redhat.com>2016-03-07 20:27:03 +0000
commit123b41c3870810d61fde5e17c74a352e3fd2a694 (patch)
tree6a62e4e31eda9fdef5d7b38d5e04fc90d3f13cc8 /sw/qa
parentc7ca0718f721c6551ebf5514c58a2f517ee2c6e8 (diff)
tdf#65219 Fix temp files clean up in sw unit tests
Change-Id: I57f4dc90bc2ad8488af8cd42515b195f4320a9d9 Reviewed-on: https://gerrit.libreoffice.org/22939 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/core/macros-test.cxx5
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx2
2 files changed, 7 insertions, 0 deletions
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index ab9203e0faae..44ac68f0a9fd 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -45,6 +45,7 @@
#include <sfx2/sfxmodelfactory.hxx>
#include <svl/intitem.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/scopeguard.hxx>
#include <basic/sbxdef.hxx>
#include <unotools/tempfile.hxx>
@@ -483,6 +484,10 @@ void SwMacrosTest::testFindReplace()
// we need a full document with view and layout etc. because ::GetNode()
Reference<lang::XComponent> const xComponent =
loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
+
+ const ::comphelper::ScopeGuard xComponentScopeGuard(
+ [&xComponent]() { xComponent->dispose(); } );
+
SwXTextDocument *const pTextDoc = dynamic_cast<SwXTextDocument *>(xComponent.get());
CPPUNIT_ASSERT(pTextDoc);
SwDoc *const pDoc = pTextDoc->GetDocShell()->GetDoc();
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 78878741cc13..a7e925370552 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -1004,6 +1004,8 @@ void SwUiWriterTest::testMergeDoc()
getParagraph(5, "Para Six: One Three Four Five");
getParagraph(6, "");
getParagraph(7, "");
+
+ xDoc2Component->dispose();
}
void SwUiWriterTest::testCreatePortions()