diff options
author | Jens Carl <j.carl43@gmx.de> | 2018-01-30 18:10:47 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2018-01-30 23:25:08 +0100 |
commit | 4f24c1919be05eef757d0b4ae89349f3601c77ee (patch) | |
tree | 4b8a54623090bb9497b03f29e4d29ce8e0d8c6c3 /sc/qa | |
parent | b0a391d62c1df7525069a02913a52af940d92ecc (diff) |
Remove shared mxComponent (test document) in scmodelobj
Change-Id: I2937c85f3e86d76838c17b7e881a1d9f7cddd68d
Reviewed-on: https://gerrit.libreoffice.org/48921
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/extras/scmodelobj.cxx | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/sc/qa/extras/scmodelobj.cxx b/sc/qa/extras/scmodelobj.cxx index 418a23e98e09..0b1e9c8118b3 100644 --- a/sc/qa/extras/scmodelobj.cxx +++ b/sc/qa/extras/scmodelobj.cxx @@ -21,8 +21,6 @@ using namespace css::uno; namespace sc_apitest { -#define NUMBER_OF_TESTS 3 - class ScModelObj : public UnoApiTest, public apitest::XConsolidatable, public apitest::XGoalSeek { @@ -46,8 +44,7 @@ public: CPPUNIT_TEST_SUITE_END(); private: - static sal_Int32 nTest; - static uno::Reference< lang::XComponent > mxComponent; + uno::Reference< lang::XComponent > mxComponent; }; ScModelObj::ScModelObj() @@ -55,15 +52,8 @@ ScModelObj::ScModelObj() { } -sal_Int32 ScModelObj::nTest = 0; -uno::Reference< lang::XComponent > ScModelObj::mxComponent; - uno::Reference< uno::XInterface > ScModelObj::init() { - OUString aFileURL; - createFileURL("ScModelObj.ods", aFileURL); - if(!mxComponent.is()) - mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument"); CPPUNIT_ASSERT_MESSAGE("no component loaded", mxComponent.is()); return mxComponent; @@ -71,19 +61,16 @@ uno::Reference< uno::XInterface > ScModelObj::init() void ScModelObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); UnoApiTest::setUp(); + // create a calc document + OUString aFileURL; + createFileURL("ScModelObj.ods", aFileURL); + mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument"); } void ScModelObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); UnoApiTest::tearDown(); } |