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

Remove shared mxComponent (test document) in scoutlineobj

Change-Id: I054de2c9f421e13069314146f972e95ab9ae322b
Reviewed-on: https://gerrit.libreoffice.org/48924Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst e0acc74c
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <test/calc_unoapi_test.hxx> #include <test/calc_unoapi_test.hxx>
#include <test/sheet/xsheetoutline.hxx> #include <test/sheet/xsheetoutline.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp> #include <com/sun/star/sheet/XSpreadsheet.hpp>
...@@ -18,8 +19,6 @@ using namespace css::uno; ...@@ -18,8 +19,6 @@ using namespace css::uno;
namespace sc_apitest { namespace sc_apitest {
#define NUMBER_OF_TESTS 6
class ScOutlineObj : public CalcUnoApiTest, public apitest::XSheetOutline class ScOutlineObj : public CalcUnoApiTest, public apitest::XSheetOutline
{ {
public: public:
...@@ -31,23 +30,22 @@ public: ...@@ -31,23 +30,22 @@ public:
virtual uno::Reference< uno::XInterface > init() override; virtual uno::Reference< uno::XInterface > init() override;
CPPUNIT_TEST_SUITE(ScOutlineObj); CPPUNIT_TEST_SUITE(ScOutlineObj);
// XSheetOutline
CPPUNIT_TEST(testHideDetail); CPPUNIT_TEST(testHideDetail);
CPPUNIT_TEST(testShowDetail); CPPUNIT_TEST(testShowDetail);
CPPUNIT_TEST(testShowLevel); CPPUNIT_TEST(testShowLevel);
CPPUNIT_TEST(testUngroup); CPPUNIT_TEST(testUngroup);
CPPUNIT_TEST(testGroup); CPPUNIT_TEST(testGroup);
// CPPUNIT_TEST(testAutoOutline); //CPPUNIT_TEST(testAutoOutline);
CPPUNIT_TEST(testClearOutline); CPPUNIT_TEST(testClearOutline);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private:
static sal_Int32 nTest; private:
static uno::Reference< lang::XComponent > mxComponent; uno::Reference< lang::XComponent > mxComponent;
}; };
sal_Int32 ScOutlineObj::nTest = 0;
uno::Reference< lang::XComponent > ScOutlineObj::mxComponent;
ScOutlineObj::ScOutlineObj() ScOutlineObj::ScOutlineObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments") : CalcUnoApiTest("/sc/qa/extras/testdocuments")
{ {
...@@ -55,13 +53,6 @@ ScOutlineObj::ScOutlineObj() ...@@ -55,13 +53,6 @@ ScOutlineObj::ScOutlineObj()
uno::Reference< uno::XInterface > ScOutlineObj::init() uno::Reference< uno::XInterface > ScOutlineObj::init()
{ {
// get the test file
OUString aFileURL;
createFileURL("ScOutlineObj.ods", aFileURL);
if(!mxComponent.is())
mxComponent = loadFromDesktop(aFileURL);
CPPUNIT_ASSERT_MESSAGE("Component not loaded", mxComponent.is());
// get the first sheet // get the first sheet
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());
...@@ -74,19 +65,16 @@ uno::Reference< uno::XInterface > ScOutlineObj::init() ...@@ -74,19 +65,16 @@ uno::Reference< uno::XInterface > ScOutlineObj::init()
void ScOutlineObj::setUp() void ScOutlineObj::setUp()
{ {
nTest++;
CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp(); CalcUnoApiTest::setUp();
// create a calc document
OUString aFileURL;
createFileURL("ScOutlineObj.ods", aFileURL);
mxComponent = loadFromDesktop(aFileURL);
} }
void ScOutlineObj::tearDown() void ScOutlineObj::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