[Libreoffice-commits] core.git: 2 commits - sc/qa
Jens Carl
j.carl43 at gmx.de
Sat Jan 27 17:48:48 UTC 2018
sc/qa/extras/sccellrangesobj.cxx | 23 ++++-------------------
sc/qa/extras/scconsolidationdescriptorobj.cxx | 23 ++++-------------------
2 files changed, 8 insertions(+), 38 deletions(-)
New commits:
commit 894b93f5ca03988aaa42b259f0b5a12d5cb3e67c
Author: Jens Carl <j.carl43 at gmx.de>
Date: Sat Jan 27 01:40:45 2018 +0000
Remove shared mxComponent in scconsolidationdescriptorobj
Change-Id: I4b71673fa19459eeb7ea97bb291a62f327d69958
Reviewed-on: https://gerrit.libreoffice.org/48736
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/scconsolidationdescriptorobj.cxx b/sc/qa/extras/scconsolidationdescriptorobj.cxx
index 16c4ea8b820e..a68f5fe0ef5b 100644
--- a/sc/qa/extras/scconsolidationdescriptorobj.cxx
+++ b/sc/qa/extras/scconsolidationdescriptorobj.cxx
@@ -23,8 +23,6 @@ using namespace com::sun::star;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 12
-
class ScConsolidationDescriptorObj : public CalcUnoApiTest, public apitest::XConsolidationDescriptor
{
public:
@@ -53,13 +51,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference<lang::XComponent> mxComponent;
+ uno::Reference<lang::XComponent> mxComponent;
};
-sal_Int32 ScConsolidationDescriptorObj::nTest = 0;
-uno::Reference<lang::XComponent> ScConsolidationDescriptorObj::mxComponent;
-
ScConsolidationDescriptorObj::ScConsolidationDescriptorObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -67,10 +61,6 @@ ScConsolidationDescriptorObj::ScConsolidationDescriptorObj()
uno::Reference<uno::XInterface> ScConsolidationDescriptorObj::init()
{
- // create a calc document
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
-
uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
@@ -80,19 +70,14 @@ uno::Reference<uno::XInterface> ScConsolidationDescriptorObj::init()
void ScConsolidationDescriptorObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScConsolidationDescriptorObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
commit 6a36c66dd18db6507d66bdaed822e513d92e8127
Author: Jens Carl <j.carl43 at gmx.de>
Date: Sat Jan 27 01:35:49 2018 +0000
Remove shared mxComponent in sccellrangesobj
Change-Id: If357e94566440276bb1df88a4b899125beffe148
Reviewed-on: https://gerrit.libreoffice.org/48735
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/sccellrangesobj.cxx b/sc/qa/extras/sccellrangesobj.cxx
index 7ebe5d876842..17dbe4f9b614 100644
--- a/sc/qa/extras/sccellrangesobj.cxx
+++ b/sc/qa/extras/sccellrangesobj.cxx
@@ -27,8 +27,6 @@ using namespace css::uno;
namespace sc_apitest {
-#define NUMBER_OF_TESTS 7
-
class ScCellRangesObj : public CalcUnoApiTest,
public apitest::XSheetCellRangeContainer,
public apitest::XSheetCellRanges,
@@ -60,13 +58,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference< lang::XComponent > mxComponent;
+ uno::Reference< lang::XComponent > mxComponent;
};
-sal_Int32 ScCellRangesObj::nTest = 0;
-uno::Reference< lang::XComponent > ScCellRangesObj::mxComponent;
-
ScCellRangesObj::ScCellRangesObj():
CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -74,10 +68,6 @@ ScCellRangesObj::ScCellRangesObj():
uno::Reference< uno::XInterface > ScCellRangesObj::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());
@@ -109,19 +99,14 @@ uno::Reference< uno::XInterface > ScCellRangesObj::init()
void ScCellRangesObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScCellRangesObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list