[Libreoffice-commits] core.git: sc/qa
Jens Carl
j.carl43 at gmx.de
Sat Jan 27 23:30:36 UTC 2018
sc/qa/extras/scdatabaserangeobj.cxx | 27 +++++++--------------------
1 file changed, 7 insertions(+), 20 deletions(-)
New commits:
commit cbe054d7c58da8ba2a97314ea70e81f5f40870db
Author: Jens Carl <j.carl43 at gmx.de>
Date: Sat Jan 27 19:40:12 2018 +0000
Remove shared mxComponent in scdatabaserangeobj
Change-Id: I46f45eababddc61b90b4883a804f52f97e87e87f
Reviewed-on: https://gerrit.libreoffice.org/48752
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/scdatabaserangeobj.cxx b/sc/qa/extras/scdatabaserangeobj.cxx
index 818fe033ba0e..ba8e8efbf4ef 100644
--- a/sc/qa/extras/scdatabaserangeobj.cxx
+++ b/sc/qa/extras/scdatabaserangeobj.cxx
@@ -21,8 +21,6 @@ using namespace css::uno;
namespace sc_apitest {
-#define NUMBER_OF_TESTS 17
-
class ScDatabaseRangeObj : public CalcUnoApiTest, public apitest::DatabaseRange, public apitest::XDatabaseRange
{
public:
@@ -58,13 +56,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference< lang::XComponent > mxComponent;
+ uno::Reference< lang::XComponent > mxComponent;
};
-sal_Int32 ScDatabaseRangeObj::nTest = 0;
-uno::Reference< lang::XComponent > ScDatabaseRangeObj::mxComponent;
-
ScDatabaseRangeObj::ScDatabaseRangeObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -72,11 +66,6 @@ ScDatabaseRangeObj::ScDatabaseRangeObj()
uno::Reference< uno::XInterface > ScDatabaseRangeObj::init( const OUString& rDBName )
{
- OUString aFileURL;
- createFileURL("ScDatabaseRangeObj.ods", aFileURL);
- if(!mxComponent.is())
- mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
-
uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
@@ -89,19 +78,17 @@ uno::Reference< uno::XInterface > ScDatabaseRangeObj::init( const OUString& rDBN
void ScDatabaseRangeObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+
+ OUString aFileURL;
+ createFileURL("ScDatabaseRangeObj.ods", aFileURL);
+ mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
+
}
void ScDatabaseRangeObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list