[Libreoffice-commits] core.git: 2 commits - sc/qa
Jens Carl
j.carl43 at gmx.de
Tue Jan 30 22:55:34 UTC 2018
sc/qa/extras/scscenariosobj.cxx | 23 ++++-------------------
sc/qa/extras/scspreadsheetsettingsobj.cxx | 23 ++++-------------------
2 files changed, 8 insertions(+), 38 deletions(-)
New commits:
commit 8b521b2535ca1e80758f57abf1656fc3eb21a47c
Author: Jens Carl <j.carl43 at gmx.de>
Date: Tue Jan 30 20:04:19 2018 +0000
Remove shared mxComponent (test document) in scspreadsheetsettingsobj
Change-Id: I6c96bf694ec64fec2ddae66a42cf8cc2a8fc0e7a
Reviewed-on: https://gerrit.libreoffice.org/48931
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/scspreadsheetsettingsobj.cxx b/sc/qa/extras/scspreadsheetsettingsobj.cxx
index 7cb3e22a6f90..34edd4cc916f 100644
--- a/sc/qa/extras/scspreadsheetsettingsobj.cxx
+++ b/sc/qa/extras/scspreadsheetsettingsobj.cxx
@@ -23,8 +23,6 @@ using namespace com::sun::star;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 1
-
class ScSpreadsheetSettingsObj : public CalcUnoApiTest, public apitest::GlobalSheetSettings
{
public:
@@ -42,13 +40,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference<lang::XComponent> mxComponent;
+ uno::Reference<lang::XComponent> mxComponent;
};
-sal_Int32 ScSpreadsheetSettingsObj::nTest = 0;
-uno::Reference<lang::XComponent> ScSpreadsheetSettingsObj::mxComponent;
-
ScSpreadsheetSettingsObj::ScSpreadsheetSettingsObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -56,10 +50,6 @@ ScSpreadsheetSettingsObj::ScSpreadsheetSettingsObj()
uno::Reference<uno::XInterface> ScSpreadsheetSettingsObj::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());
@@ -69,19 +59,14 @@ uno::Reference<uno::XInterface> ScSpreadsheetSettingsObj::init()
void ScSpreadsheetSettingsObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScSpreadsheetSettingsObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
commit 3e32f5530b1292a9edc5fed5997a52d0fa554420
Author: Jens Carl <j.carl43 at gmx.de>
Date: Tue Jan 30 19:55:33 2018 +0000
Remove shared mxComponent (test document) in scscenariosobj
Change-Id: If37b9fa10fd935c5273a817acbf7d2d2f7eeedb8
Reviewed-on: https://gerrit.libreoffice.org/48930
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/scscenariosobj.cxx b/sc/qa/extras/scscenariosobj.cxx
index 5f3533785103..27524fda7083 100644
--- a/sc/qa/extras/scscenariosobj.cxx
+++ b/sc/qa/extras/scscenariosobj.cxx
@@ -32,8 +32,6 @@ using namespace com::sun::star;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 2
-
class ScScenariosObj : public CalcUnoApiTest, public apitest::XScenarios
{
public:
@@ -52,13 +50,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference<lang::XComponent> mxComponent;
+ uno::Reference<lang::XComponent> mxComponent;
};
-sal_Int32 ScScenariosObj::nTest = 0;
-uno::Reference<lang::XComponent> ScScenariosObj::mxComponent;
-
ScScenariosObj::ScScenariosObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -66,10 +60,6 @@ ScScenariosObj::ScScenariosObj()
uno::Reference<uno::XInterface> ScScenariosObj::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 +85,14 @@ uno::Reference<uno::XInterface> ScScenariosObj::init()
void ScScenariosObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScScenariosObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list