sc/qa/extras/scmodelobj.cxx | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-)
New commits: commit 4f24c1919be05eef757d0b4ae89349f3601c77ee Author: Jens Carl <j.car...@gmx.de> Date: Tue Jan 30 18:10:47 2018 +0000 Remove shared mxComponent (test document) in scmodelobj Change-Id: I2937c85f3e86d76838c17b7e881a1d9f7cddd68d Reviewed-on: https://gerrit.libreoffice.org/48921 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Jens Carl <j.car...@gmx.de> 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(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits