[Libreoffice-commits] core.git: sc/qa
Jens Carl
j.carl43 at gmx.de
Tue Jan 30 23:12:40 UTC 2018
sc/qa/extras/scsubtotaldescriptorbaseobj.cxx | 24 ++++--------------------
1 file changed, 4 insertions(+), 20 deletions(-)
New commits:
commit e0acc74c57a71985ded8f410bd8b44c89b933007
Author: Jens Carl <j.carl43 at gmx.de>
Date: Tue Jan 30 20:39:19 2018 +0000
Remove shared mxComponent (test document) in scsubtotaldescriptorbaseobj
Change-Id: Ia97f3e7b637c2b14a9c07c521dcd5b8ff1ff0686
Reviewed-on: https://gerrit.libreoffice.org/48935
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/scsubtotaldescriptorbaseobj.cxx b/sc/qa/extras/scsubtotaldescriptorbaseobj.cxx
index 946722ed6116..519bb78ee4ea 100644
--- a/sc/qa/extras/scsubtotaldescriptorbaseobj.cxx
+++ b/sc/qa/extras/scsubtotaldescriptorbaseobj.cxx
@@ -31,8 +31,6 @@ using namespace com::sun::star;
namespace sc_apitest {
-#define NUMBER_OF_TESTS 3
-
class ScSubTotalDescriptorBaseObj : public CalcUnoApiTest,
public apitest::SubTotalDescriptor,
public apitest::XSubTotalDescriptor
@@ -56,14 +54,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference< lang::XComponent > mxComponent;
-
+ uno::Reference< lang::XComponent > mxComponent;
};
-sal_Int32 ScSubTotalDescriptorBaseObj::nTest = 0;
-uno::Reference< lang::XComponent > ScSubTotalDescriptorBaseObj::mxComponent;
-
ScSubTotalDescriptorBaseObj::ScSubTotalDescriptorBaseObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -71,10 +64,6 @@ ScSubTotalDescriptorBaseObj::ScSubTotalDescriptorBaseObj()
uno::Reference< uno::XInterface > ScSubTotalDescriptorBaseObj::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());
@@ -95,19 +84,14 @@ uno::Reference< uno::XInterface > ScSubTotalDescriptorBaseObj::init()
void ScSubTotalDescriptorBaseObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScSubTotalDescriptorBaseObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list