diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2014-11-16 14:26:36 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2014-11-16 14:32:12 +0100 |
commit | 19866932ccda9b143c1c4cd66cf3dbaac7e607ad (patch) | |
tree | 1f0f2d260ba1b4ac5c252a2d50b64a44570dd8cc /cppcanvas/qa | |
parent | 133c295bbe6f746d4c2fd2fe7560206b890cdf1f (diff) |
emfplus: re-work and cleanup unit test
Change-Id: I484331c4dd5feedf8587530912bb65556c1689c0
Diffstat (limited to 'cppcanvas/qa')
-rw-r--r-- | cppcanvas/qa/extras/emfplus/emfplus.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
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() |