summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-10-17 20:15:19 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-10-17 21:09:43 +0200
commiteda9daa97d0573cc3a78ae37396e3cd462f8221f (patch)
tree6102c15101758511e46fc3f34cd8de7293020d47
parent27de384c31d3225e02857db1b5e0215a5c1f3467 (diff)
ScBootstrapFixture: factor out setUp
Change-Id: Ib1549e14b849786abe3a038ac8542c6a8ec1f11b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141473 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sc/qa/unit/SparklineImportExportTest.cxx11
-rw-r--r--sc/qa/unit/SparklineTest.cxx11
-rw-r--r--sc/qa/unit/bugfix-test.cxx13
-rw-r--r--sc/qa/unit/chart2dataprovider.cxx13
-rw-r--r--sc/qa/unit/copy_paste_test.cxx13
-rw-r--r--sc/qa/unit/dataproviders_test.cxx13
-rw-r--r--sc/qa/unit/filters-test.cxx8
-rw-r--r--sc/qa/unit/functions_test.cxx11
-rw-r--r--sc/qa/unit/functions_test.hxx2
-rw-r--r--sc/qa/unit/helper/qahelper.cxx11
-rw-r--r--sc/qa/unit/helper/qahelper.hxx1
-rw-r--r--sc/qa/unit/jumbosheets-test.cxx8
-rw-r--r--sc/qa/unit/opencl-test.cxx12
-rw-r--r--sc/qa/unit/pivottable_filters_test.cxx13
-rw-r--r--sc/qa/unit/subsequent_export_test.cxx13
-rw-r--r--sc/qa/unit/subsequent_export_test2.cxx13
-rw-r--r--sc/qa/unit/subsequent_filters_test.cxx13
-rw-r--r--sc/qa/unit/subsequent_filters_test2.cxx13
18 files changed, 14 insertions, 178 deletions
diff --git a/sc/qa/unit/SparklineImportExportTest.cxx b/sc/qa/unit/SparklineImportExportTest.cxx
index 83c429d07ddd..4ebf4cd627f8 100644
--- a/sc/qa/unit/SparklineImportExportTest.cxx
+++ b/sc/qa/unit/SparklineImportExportTest.cxx
@@ -26,17 +26,6 @@ public:
{
}
- virtual void setUp() override
- {
- test::BootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent = getMultiServiceFactory()->createInstance(
- "com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
- }
-
virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathContextPtr) override
{
XmlTestTools::registerOOXMLNamespaces(pXmlXPathContextPtr);
diff --git a/sc/qa/unit/SparklineTest.cxx b/sc/qa/unit/SparklineTest.cxx
index a45d34eb7a8d..248ed14e8185 100644
--- a/sc/qa/unit/SparklineTest.cxx
+++ b/sc/qa/unit/SparklineTest.cxx
@@ -29,17 +29,6 @@ public:
{
}
- virtual void setUp() override
- {
- test::BootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent = getMultiServiceFactory()->createInstance(
- "com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
- }
-
void testAddSparkline();
void testClearContentSprkline();
void testCopyPasteSparkline();
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index e6bf6264f225..8b28f8e83c45 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -39,8 +39,6 @@ class ScFiltersTest : public ScBootstrapFixture
public:
ScFiltersTest();
- virtual void setUp() override;
-
void testTdf137576_Measureline();
void testTdf137216_HideCol();
void testTdf137044_CoverHiddenRows();
@@ -749,17 +747,6 @@ ScFiltersTest::ScFiltersTest()
{
}
-void ScFiltersTest::setUp()
-{
- test::BootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent =
- getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
-}
-
CPPUNIT_TEST_SUITE_REGISTRATION(ScFiltersTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/qa/unit/chart2dataprovider.cxx b/sc/qa/unit/chart2dataprovider.cxx
index c7ba774c36fa..17e214fc8d37 100644
--- a/sc/qa/unit/chart2dataprovider.cxx
+++ b/sc/qa/unit/chart2dataprovider.cxx
@@ -28,8 +28,6 @@ class ScChart2DataProviderTest : public ScBootstrapFixture
public:
ScChart2DataProviderTest();
- virtual void setUp() override;
-
void testHeaderExpansion();
CPPUNIT_TEST_SUITE(ScChart2DataProviderTest);
@@ -92,17 +90,6 @@ ScChart2DataProviderTest::ScChart2DataProviderTest()
{
}
-void ScChart2DataProviderTest::setUp()
-{
- test::BootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent
- = getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
-}
-
CPPUNIT_TEST_SUITE_REGISTRATION(ScChart2DataProviderTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx
index 93db3020fdfa..207efa140b2d 100644
--- a/sc/qa/unit/copy_paste_test.cxx
+++ b/sc/qa/unit/copy_paste_test.cxx
@@ -37,8 +37,6 @@ class ScCopyPasteTest : public ScBootstrapFixture
public:
ScCopyPasteTest();
- virtual void setUp() override;
-
void testCopyPasteXLS();
void testTdf84411();
void testTdf124565();
@@ -829,17 +827,6 @@ ScCopyPasteTest::ScCopyPasteTest()
{
}
-void ScCopyPasteTest::setUp()
-{
- test::BootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent =
- getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
-}
-
CPPUNIT_TEST_SUITE_REGISTRATION(ScCopyPasteTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/qa/unit/dataproviders_test.cxx b/sc/qa/unit/dataproviders_test.cxx
index 19947bea5923..7537625878b7 100644
--- a/sc/qa/unit/dataproviders_test.cxx
+++ b/sc/qa/unit/dataproviders_test.cxx
@@ -27,8 +27,6 @@ class ScDataProvidersTest : public ScBootstrapFixture
public:
ScDataProvidersTest();
- virtual void setUp() override;
-
void testCSVImport();
void testDataLargerThanDB();
void testHTMLImport();
@@ -241,17 +239,6 @@ ScDataProvidersTest::ScDataProvidersTest()
{
}
-void ScDataProvidersTest::setUp()
-{
- ScBootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent
- = getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
-}
-
CPPUNIT_TEST_SUITE_REGISTRATION(ScDataProvidersTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 1e4e904f79b3..91422c840ca2 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -902,13 +902,7 @@ ScFiltersTest::ScFiltersTest()
void ScFiltersTest::setUp()
{
- test::BootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent =
- getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
+ ScBootstrapFixture::setUp();
// one test sets this configuration option; make sure we remember the
// original value
diff --git a/sc/qa/unit/functions_test.cxx b/sc/qa/unit/functions_test.cxx
index da0290a468ca..02c1cf1da4f4 100644
--- a/sc/qa/unit/functions_test.cxx
+++ b/sc/qa/unit/functions_test.cxx
@@ -18,17 +18,6 @@ FunctionsTest::FunctionsTest(const OUString& rPath):
{
}
-void FunctionsTest::setUp()
-{
- ScBootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent =
- getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
-}
-
bool FunctionsTest::load(const OUString& rFilter, const OUString& rURL,
const OUString& rUserData, SfxFilterFlags nFilterFlags,
SotClipboardFormatId nClipboardID,
diff --git a/sc/qa/unit/functions_test.hxx b/sc/qa/unit/functions_test.hxx
index e33cdec76063..0a57987dfa01 100644
--- a/sc/qa/unit/functions_test.hxx
+++ b/sc/qa/unit/functions_test.hxx
@@ -21,8 +21,6 @@ public:
FunctionsTest(const OUString& rPath);
- virtual void setUp() override;
-
virtual bool load(
const OUString &rFilter,
const OUString &rURL,
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 578e143a2f73..a6249972e801 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -911,6 +911,17 @@ void ScBootstrapFixture::miscRowHeightsTest( TestParam const * aTestValues, unsi
}
}
+void ScBootstrapFixture::setUp()
+{
+ test::BootstrapFixture::setUp();
+
+ // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
+ // which is a private symbol to us, gets called
+ m_xCalcComponent
+ = getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
+ CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
+}
+
void ScBootstrapFixture::tearDown()
{
uno::Reference< lang::XComponent >( m_xCalcComponent, UNO_QUERY_THROW )->dispose();
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index bc99a59953a3..1bc0307b8061 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -231,6 +231,7 @@ public:
void miscRowHeightsTest( TestParam const * aTestValues, unsigned int numElems );
+ virtual void setUp() override;
virtual void tearDown() override;
};
diff --git a/sc/qa/unit/jumbosheets-test.cxx b/sc/qa/unit/jumbosheets-test.cxx
index 216adc6d99c0..388967e9c43c 100644
--- a/sc/qa/unit/jumbosheets-test.cxx
+++ b/sc/qa/unit/jumbosheets-test.cxx
@@ -385,13 +385,7 @@ ScJumboSheetsTest::ScJumboSheetsTest()
void ScJumboSheetsTest::setUp()
{
- test::BootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent
- = getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
+ ScBootstrapFixture::setUp();
ScDefaultsOptions aDefaultsOption = SC_MOD()->GetDefaultsOptions();
aDefaultsOption.SetInitJumboSheets(true);
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index beac92b2ddd5..c1c1c537619a 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -35,7 +35,6 @@ public:
void enableOpenCL();
void disableOpenCL();
- virtual void setUp() override;
virtual void tearDown() override;
void testSystematic();
@@ -4712,17 +4711,6 @@ ScOpenCLTest::ScOpenCLTest()
{
}
-void ScOpenCLTest::setUp()
-{
- test::BootstrapFixture::setUp();
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent =
- getMultiServiceFactory()->
- createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
-}
-
void ScOpenCLTest::tearDown()
{
//close test env
diff --git a/sc/qa/unit/pivottable_filters_test.cxx b/sc/qa/unit/pivottable_filters_test.cxx
index 49aac0d12311..6bbbc39e0a2e 100644
--- a/sc/qa/unit/pivottable_filters_test.cxx
+++ b/sc/qa/unit/pivottable_filters_test.cxx
@@ -44,8 +44,6 @@ protected:
public:
ScPivotTableFiltersTest();
- virtual void setUp() override;
-
// Import
void testPivotTableBasicODS();
void testPivotTableNamedRangeSourceODS();
@@ -162,17 +160,6 @@ ScPivotTableFiltersTest::ScPivotTableFiltersTest()
{
}
-void ScPivotTableFiltersTest::setUp()
-{
- test::BootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent
- = getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
-}
-
void ScPivotTableFiltersTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
{
XmlTestTools::registerOOXMLNamespaces(pXmlXPathCtx);
diff --git a/sc/qa/unit/subsequent_export_test.cxx b/sc/qa/unit/subsequent_export_test.cxx
index 37013c019208..d4f80f1ed103 100644
--- a/sc/qa/unit/subsequent_export_test.cxx
+++ b/sc/qa/unit/subsequent_export_test.cxx
@@ -66,8 +66,6 @@ protected:
public:
ScExportTest();
- virtual void setUp() override;
-
void test();
void testDefaultFontHeight();
void testTdf139167();
@@ -3781,17 +3779,6 @@ ScExportTest::ScExportTest()
{
}
-void ScExportTest::setUp()
-{
- test::BootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent
- = getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
-}
-
void ScExportTest::testSupBookVirtualPathXLS()
{
ScDocShellRef xShell = loadDoc(u"external-ref.", FORMAT_XLS);
diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx
index c7ea867ad32e..5a54ac691f88 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -65,8 +65,6 @@ protected:
public:
ScExportTest2();
- virtual void setUp() override;
-
void testMatrixMultiplicationXLSX();
void testTdf121260();
void testTextDirectionXLSX();
@@ -326,17 +324,6 @@ ScExportTest2::ScExportTest2()
{
}
-void ScExportTest2::setUp()
-{
- test::BootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent
- = getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
-}
-
void ScExportTest2::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
{
XmlTestTools::registerOOXMLNamespaces(pXmlXPathCtx);
diff --git a/sc/qa/unit/subsequent_filters_test.cxx b/sc/qa/unit/subsequent_filters_test.cxx
index 3897b1077cf2..327c39616b04 100644
--- a/sc/qa/unit/subsequent_filters_test.cxx
+++ b/sc/qa/unit/subsequent_filters_test.cxx
@@ -70,8 +70,6 @@ class ScFiltersTest : public ScBootstrapFixture
public:
ScFiltersTest();
- virtual void setUp() override;
-
//ods, xls, xlsx filter tests
void testCondFormatOperatorsSameRangeXLSX();
void testTdf150452();
@@ -3085,17 +3083,6 @@ ScFiltersTest::ScFiltersTest()
{
}
-void ScFiltersTest::setUp()
-{
- test::BootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent =
- getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
-}
-
CPPUNIT_TEST_SUITE_REGISTRATION(ScFiltersTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx
index 5ff13d891d43..e4bf84b2fade 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -69,8 +69,6 @@ class ScFiltersTest2 : public ScBootstrapFixture
public:
ScFiltersTest2();
- virtual void setUp() override;
-
void testMiscRowHeights();
void testOptimalHeightReset();
void testCustomNumFormatHybridCellODS();
@@ -312,17 +310,6 @@ ScFiltersTest2::ScFiltersTest2()
{
}
-void ScFiltersTest2::setUp()
-{
- test::BootstrapFixture::setUp();
-
- // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- // which is a private symbol to us, gets called
- m_xCalcComponent
- = getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
-}
-
void ScFiltersTest2::testMiscRowHeights()
{
// FIXME: the DPI check should be removed when either (1) the test is fixed to work with