Kaydet (Commit) ef52c5bf authored tarafından Jens Carl's avatar Jens Carl

Remove shared mxComponent (test document) in screcentfunctionsobj

Change-Id: Id0d9e3f86f9e48333f415b4eb2a05b3211473b67
Reviewed-on: https://gerrit.libreoffice.org/48925Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst 1a43f636
...@@ -24,8 +24,6 @@ using namespace com::sun::star; ...@@ -24,8 +24,6 @@ using namespace com::sun::star;
namespace sc_apitest namespace sc_apitest
{ {
#define NUMBER_OF_TESTS 3
class ScRecentFunctionsObj : public CalcUnoApiTest, public apitest::XRecentFunctions class ScRecentFunctionsObj : public CalcUnoApiTest, public apitest::XRecentFunctions
{ {
public: public:
...@@ -45,13 +43,9 @@ public: ...@@ -45,13 +43,9 @@ public:
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
static sal_Int32 nTest; uno::Reference<lang::XComponent> mxComponent;
static uno::Reference<lang::XComponent> mxComponent;
}; };
sal_Int32 ScRecentFunctionsObj::nTest = 0;
uno::Reference<lang::XComponent> ScRecentFunctionsObj::mxComponent;
ScRecentFunctionsObj::ScRecentFunctionsObj() ScRecentFunctionsObj::ScRecentFunctionsObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments") : CalcUnoApiTest("/sc/qa/extras/testdocuments")
{ {
...@@ -59,10 +53,6 @@ ScRecentFunctionsObj::ScRecentFunctionsObj() ...@@ -59,10 +53,6 @@ ScRecentFunctionsObj::ScRecentFunctionsObj()
uno::Reference<uno::XInterface> ScRecentFunctionsObj::init() uno::Reference<uno::XInterface> ScRecentFunctionsObj::init()
{ {
// create a calc document
if (!mxComponent.is())
mxComponent = loadFromDesktop("private:factory/scalc");
uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW); uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
...@@ -72,19 +62,14 @@ uno::Reference<uno::XInterface> ScRecentFunctionsObj::init() ...@@ -72,19 +62,14 @@ uno::Reference<uno::XInterface> ScRecentFunctionsObj::init()
void ScRecentFunctionsObj::setUp() void ScRecentFunctionsObj::setUp()
{ {
nTest++;
CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp(); CalcUnoApiTest::setUp();
// create a calc document
mxComponent = loadFromDesktop("private:factory/scalc");
} }
void ScRecentFunctionsObj::tearDown() void ScRecentFunctionsObj::tearDown()
{ {
if (nTest == NUMBER_OF_TESTS) closeDocument(mxComponent);
{
closeDocument(mxComponent);
mxComponent.clear();
}
CalcUnoApiTest::tearDown(); CalcUnoApiTest::tearDown();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment