summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-11-16 14:26:36 +0100
committerMichael Meeks <michael.meeks@collabora.com>2014-11-16 14:32:12 +0100
commit19866932ccda9b143c1c4cd66cf3dbaac7e607ad (patch)
tree1f0f2d260ba1b4ac5c252a2d50b64a44570dd8cc
parent133c295bbe6f746d4c2fd2fe7560206b890cdf1f (diff)
emfplus: re-work and cleanup unit test
Change-Id: I484331c4dd5feedf8587530912bb65556c1689c0
-rw-r--r--cppcanvas/CppunitTest_cppcanvas_emfplus.mk1
-rw-r--r--cppcanvas/qa/extras/emfplus/emfplus.cxx19
2 files changed, 12 insertions, 8 deletions
diff --git a/cppcanvas/CppunitTest_cppcanvas_emfplus.mk b/cppcanvas/CppunitTest_cppcanvas_emfplus.mk
index 6853cd44032e..32b712f971ed 100644
--- a/cppcanvas/CppunitTest_cppcanvas_emfplus.mk
+++ b/cppcanvas/CppunitTest_cppcanvas_emfplus.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,cppcanvas_emfplus, \
cppuhelper \
sal \
sfx \
+ subsequenttest \
test \
tl \
unotest \
diff --git a/cppcanvas/qa/extras/emfplus/emfplus.cxx b/cppcanvas/qa/extras/emfplus/emfplus.cxx
index ac4a6f2f549d..96bde5643e58 100644
--- a/cppcanvas/qa/extras/emfplus/emfplus.cxx
+++ b/cppcanvas/qa/extras/emfplus/emfplus.cxx
@@ -15,18 +15,17 @@
#include <comphelper/processfactory.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/sfxbasemodel.hxx>
-#include <test/bootstrapfixture.hxx>
+#include <test/unoapi_test.hxx>
#include <unotest/macros_test.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/pngwrite.hxx>
using namespace com::sun::star;
-class Test : public test::BootstrapFixture, public unotest::MacrosTest
+class Test : public UnoApiTest
{
public:
- Test()
- : mpTestDocumentPath("/cppcanvas/qa/extras/emfplus/data/")
+ Test() : UnoApiTest("/cppcanvas/qa/extras/emfplus/data/")
{
}
@@ -36,20 +35,25 @@ public:
virtual void setUp() SAL_OVERRIDE
{
- test::BootstrapFixture::setUp();
+ UnoApiTest::setUp();
mxDesktop.set(frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory())));
};
virtual void tearDown() SAL_OVERRIDE
{
if (mxComponent.is())
+ {
+ closeDocument(mxComponent);
mxComponent->dispose();
- test::BootstrapFixture::tearDown();
+ }
+ UnoApiTest::tearDown();
};
Bitmap load(const char* pName)
{
- mxComponent = loadFromDesktop(getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(pName), "com.sun.star.drawing.DrawingDocument");
+ OUString aFileURL;
+ createFileURL(OUString::createFromAscii(pName), aFileURL);
+ mxComponent = loadFromDesktop(aFileURL, "com.sun.star.drawing.DrawingDocument");
SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
CPPUNIT_ASSERT(pModel);
SfxObjectShell* pShell = pModel->GetObjectShell();
@@ -75,7 +79,6 @@ public:
CPPUNIT_TEST_SUITE_END();
uno::Reference<lang::XComponent> mxComponent;
- const char* mpTestDocumentPath;
};
void Test::testFdo77229()