[Libreoffice-commits] core.git: sc/qa
Jens Carl
j.carl43 at gmx.de
Tue Jan 30 20:42:11 UTC 2018
sc/qa/extras/sclabelrangeobj.cxx | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
New commits:
commit 7af7c18c11cfdb781daf6a8c4c7112d247f8c4a0
Author: Jens Carl <j.carl43 at gmx.de>
Date: Tue Jan 30 18:05:05 2018 +0000
Remove shared mxComponent (test document) in sclabelrangeobj
Change-Id: I5d9ab4b1ec384298334399dc2e02c3dcc6b2ca57
Reviewed-on: https://gerrit.libreoffice.org/48919
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/sclabelrangeobj.cxx b/sc/qa/extras/sclabelrangeobj.cxx
index a0f0ed78c8f2..4cbbac83f776 100644
--- a/sc/qa/extras/sclabelrangeobj.cxx
+++ b/sc/qa/extras/sclabelrangeobj.cxx
@@ -26,8 +26,6 @@ using namespace com::sun::star;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 2
-
class ScLabelRangeObj : public CalcUnoApiTest, public apitest::XLabelRange
{
public:
@@ -46,13 +44,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference<lang::XComponent> mxComponent;
+ uno::Reference<lang::XComponent> mxComponent;
};
-sal_Int32 ScLabelRangeObj::nTest = 0;
-uno::Reference<lang::XComponent> ScLabelRangeObj::mxComponent;
-
ScLabelRangeObj::ScLabelRangeObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -60,10 +54,6 @@ ScLabelRangeObj::ScLabelRangeObj()
uno::Reference<uno::XInterface> ScLabelRangeObj::init()
{
- // create a calc document
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
-
uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
@@ -82,19 +72,14 @@ uno::Reference<uno::XInterface> ScLabelRangeObj::init()
void ScLabelRangeObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScLabelRangeObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list