[Libreoffice-commits] core.git: sc/qa
Jens Carl
j.carl43 at gmx.de
Wed Jan 31 01:09:18 UTC 2018
sc/qa/extras/sctablevalidationobj.cxx | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
New commits:
commit 2e0f1f6ff0deb65370b8c5491dda6c326edae7e0
Author: Jens Carl <j.carl43 at gmx.de>
Date: Tue Jan 30 22:47:35 2018 +0000
Remove shared mxComponent (test document) in sctablevalidationobj
Change-Id: I94900cd87e61b5ee6618ccb736bee82c349c8cc3
Reviewed-on: https://gerrit.libreoffice.org/48942
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/sctablevalidationobj.cxx b/sc/qa/extras/sctablevalidationobj.cxx
index 03dd18993305..0968b8042893 100644
--- a/sc/qa/extras/sctablevalidationobj.cxx
+++ b/sc/qa/extras/sctablevalidationobj.cxx
@@ -29,8 +29,6 @@ using namespace com::sun::star;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 5
-
class ScTableValidationObj : public CalcUnoApiTest,
public apitest::TableValidation,
public apitest::XSheetCondition
@@ -56,13 +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 ScTableValidationObj::nTest = 0;
-uno::Reference<lang::XComponent> ScTableValidationObj::mxComponent;
-
ScTableValidationObj::ScTableValidationObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -70,10 +64,6 @@ ScTableValidationObj::ScTableValidationObj()
uno::Reference<uno::XInterface> ScTableValidationObj::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());
@@ -93,19 +83,14 @@ uno::Reference<uno::XInterface> ScTableValidationObj::init()
void ScTableValidationObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScTableValidationObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list