[Libreoffice-commits] core.git: sc/qa
Jens Carl
j.carl43 at gmx.de
Wed Jan 31 00:11:58 UTC 2018
sc/qa/extras/screcentfunctionsobj.cxx | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
New commits:
commit ef52c5bf90713bb4751e36b6849e236a768f0aa4
Author: Jens Carl <j.carl43 at gmx.de>
Date: Tue Jan 30 18:29:40 2018 +0000
Remove shared mxComponent (test document) in screcentfunctionsobj
Change-Id: Id0d9e3f86f9e48333f415b4eb2a05b3211473b67
Reviewed-on: https://gerrit.libreoffice.org/48925
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/screcentfunctionsobj.cxx b/sc/qa/extras/screcentfunctionsobj.cxx
index 289c87479cb0..4dc32b67b0bd 100644
--- a/sc/qa/extras/screcentfunctionsobj.cxx
+++ b/sc/qa/extras/screcentfunctionsobj.cxx
@@ -24,8 +24,6 @@ using namespace com::sun::star;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 3
-
class ScRecentFunctionsObj : public CalcUnoApiTest, public apitest::XRecentFunctions
{
public:
@@ -45,13 +43,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference<lang::XComponent> mxComponent;
+ uno::Reference<lang::XComponent> mxComponent;
};
-sal_Int32 ScRecentFunctionsObj::nTest = 0;
-uno::Reference<lang::XComponent> ScRecentFunctionsObj::mxComponent;
-
ScRecentFunctionsObj::ScRecentFunctionsObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -59,10 +53,6 @@ ScRecentFunctionsObj::ScRecentFunctionsObj()
uno::Reference<uno::XInterface> ScRecentFunctionsObj::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());
@@ -72,19 +62,14 @@ uno::Reference<uno::XInterface> ScRecentFunctionsObj::init()
void ScRecentFunctionsObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScRecentFunctionsObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list