sc/qa/extras/scviewpaneobj.cxx | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-)
New commits: commit 96a47c604df8187ab5c68d9941d71e8f07acce6d Author: Jens Carl <j.car...@gmx.de> Date: Tue Jan 30 23:02:41 2018 +0000 Remove shared mxComponent (test document) in scviewpaneobj Change-Id: I8bf7adb11e49d926a5910a4bd8279e16cf34833f Reviewed-on: https://gerrit.libreoffice.org/48943 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Jens Carl <j.car...@gmx.de> diff --git a/sc/qa/extras/scviewpaneobj.cxx b/sc/qa/extras/scviewpaneobj.cxx index 02ceb63824e0..6e74fa8a4434 100644 --- a/sc/qa/extras/scviewpaneobj.cxx +++ b/sc/qa/extras/scviewpaneobj.cxx @@ -23,8 +23,6 @@ using namespace css::uno; namespace sc_apitest { -#define NUMBER_OF_TESTS 3 - class ScViewPaneObj : public CalcUnoApiTest, public apitest::XViewPane { public: @@ -35,32 +33,25 @@ public: virtual void tearDown() override; CPPUNIT_TEST_SUITE(ScViewPaneObj); + + // XViewPane CPPUNIT_TEST(testFirstVisibleColumn); CPPUNIT_TEST(testFirstVisibleRow); CPPUNIT_TEST(testVisibleRange); + CPPUNIT_TEST_SUITE_END(); private: - - static sal_Int32 nTest; - static uno::Reference<lang::XComponent> mxComponent; - + uno::Reference<lang::XComponent> mxComponent; }; -sal_Int32 ScViewPaneObj::nTest = 0; -uno::Reference< lang::XComponent > ScViewPaneObj::mxComponent; - ScViewPaneObj::ScViewPaneObj() - : CalcUnoApiTest("/sc/qa/extras/testdocuments") + : CalcUnoApiTest("/sc/qa/extras/testdocuments") { } uno::Reference< uno::XInterface > ScViewPaneObj::init() { - // create a calc document - if (!mxComponent.is()) - mxComponent = loadFromDesktop("private:factory/scalc"); - uno::Reference< sheet::XSpreadsheetDocument > xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("no calc document!", xSheetDoc.is()); @@ -73,19 +64,14 @@ uno::Reference< uno::XInterface > ScViewPaneObj::init() void ScViewPaneObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + // create a calc document + mxComponent = loadFromDesktop("private:factory/scalc"); } void ScViewPaneObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits