summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-10-14 00:24:59 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-10-14 14:42:25 +0200
commit48c0b19205af6e8d0ddee31afa011890e54b46e5 (patch)
tree140cd231a2c62deb7a4fcf0bdc086d175c3b4697
parent6ca3ac3f3b3007d25c5ea68f67536c5e63fbb4e9 (diff)
sc: inherit from CalcUnoApiTest instead of UnoApiTest
like the rest of tests in sc Change-Id: I15979c6279cf9af6953f661ed8dd2f5a60f1b988 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141349 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sc/qa/extras/macros-test.cxx8
-rw-r--r--sc/qa/extras/recordchanges-test.cxx29
-rw-r--r--sc/qa/extras/scmodelobj.cxx10
-rw-r--r--sc/qa/extras/vba-macro-test.cxx8
4 files changed, 31 insertions, 24 deletions
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index cad73b5ea95f..7b0d5873976a 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -8,7 +8,7 @@
*/
#include <sal/config.h>
-#include <test/unoapi_test.hxx>
+#include <test/calc_unoapi_test.hxx>
#include <sal/log.hxx>
#include <unotools/tempfile.hxx>
#include <svx/svdpage.hxx>
@@ -35,7 +35,7 @@ using namespace ::com::sun::star::uno;
/* Implementation of Macros test */
-class ScMacrosTest : public UnoApiTest, public XmlTestTools
+class ScMacrosTest : public CalcUnoApiTest, public XmlTestTools
{
protected:
void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override;
@@ -138,7 +138,7 @@ void ScMacrosTest::saveAndReload(const OUString& rFilter)
void ScMacrosTest::tearDown()
{
closeDocument(mxComponent);
- UnoApiTest::tearDown();
+ CalcUnoApiTest::tearDown();
}
// I suppose you could say this test doesn't really belong here, OTOH
@@ -1260,7 +1260,7 @@ void ScMacrosTest::testFunctionAccessIndirect()
}
ScMacrosTest::ScMacrosTest()
- : UnoApiTest("/sc/qa/extras/testdocuments")
+ : CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
}
diff --git a/sc/qa/extras/recordchanges-test.cxx b/sc/qa/extras/recordchanges-test.cxx
index 9eb0e6ffbcae..b8f77b4dd5aa 100644
--- a/sc/qa/extras/recordchanges-test.cxx
+++ b/sc/qa/extras/recordchanges-test.cxx
@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <test/unoapi_test.hxx>
+#include <test/calc_unoapi_test.hxx>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -19,11 +19,13 @@ using namespace ::com::sun::star::uno;
/* Implementation of calc Record Changes test */
-class ScRecordChangesTest : public UnoApiTest
+class ScRecordChangesTest : public CalcUnoApiTest
{
public:
ScRecordChangesTest();
+ virtual void tearDown() override;
+
void testSetRecordChanges();
void testCheckRecordChangesProtection();
@@ -31,13 +33,22 @@ public:
CPPUNIT_TEST(testSetRecordChanges);
CPPUNIT_TEST(testCheckRecordChangesProtection);
CPPUNIT_TEST_SUITE_END();
+
+private:
+ uno::Reference<lang::XComponent> mxComponent;
};
+void ScRecordChangesTest::tearDown()
+{
+ closeDocument(mxComponent);
+ CalcUnoApiTest::tearDown();
+}
+
void ScRecordChangesTest::testSetRecordChanges()
{
- uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop("private:factory/scalc");
+ mxComponent = loadFromDesktop("private:factory/scalc");
- uno::Reference<sheet::XSpreadsheetDocument> xDoc(xComponent, UNO_QUERY_THROW);
+ uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xDocSettingsPropSet(xDoc, UNO_QUERY_THROW);
bool recordChangesValue = true;
@@ -57,8 +68,6 @@ void ScRecordChangesTest::testSetRecordChanges()
CPPUNIT_ASSERT(xDocSettingsPropSet->getPropertyValue("RecordChanges") >>= recordChangesValue);
CPPUNIT_ASSERT_MESSAGE("the document should record changes", recordChangesValue);
-
- closeDocument(xComponent);
}
void ScRecordChangesTest::testCheckRecordChangesProtection()
@@ -66,9 +75,9 @@ void ScRecordChangesTest::testCheckRecordChangesProtection()
// test with protected changes
OUString aFileName;
createFileURL(u"RecordChangesProtected.ods", aFileName);
- uno::Reference<css::lang::XComponent> xComponent = loadFromDesktop(aFileName);
+ mxComponent = loadFromDesktop(aFileName);
- uno::Reference<sheet::XSpreadsheetDocument> xDoc(xComponent, UNO_QUERY_THROW);
+ uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xDocSettingsPropSet(xDoc, UNO_QUERY_THROW);
bool recordChangesValue = false;
@@ -93,12 +102,10 @@ void ScRecordChangesTest::testCheckRecordChangesProtection()
// this document should still record changes as protection is set
CPPUNIT_ASSERT_MESSAGE("the document should still be recording changes", recordChangesValue);
CPPUNIT_ASSERT_MESSAGE("the protection should still be active", protectionValue);
-
- closeDocument(xComponent);
}
ScRecordChangesTest::ScRecordChangesTest()
- : UnoApiTest("/sc/qa/extras/testdocuments")
+ : CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
}
diff --git a/sc/qa/extras/scmodelobj.cxx b/sc/qa/extras/scmodelobj.cxx
index 1a5dcd013b3a..6a876fe2c0f1 100644
--- a/sc/qa/extras/scmodelobj.cxx
+++ b/sc/qa/extras/scmodelobj.cxx
@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <test/unoapi_test.hxx>
+#include <test/calc_unoapi_test.hxx>
#include <test/document/xlinktargetsupplier.hxx>
#include <test/sheet/spreadsheetdocumentsettings.hxx>
#include <test/sheet/xcalculatable.hxx>
@@ -30,7 +30,7 @@ using namespace css::uno;
namespace sc_apitest
{
-class ScModelObj : public UnoApiTest,
+class ScModelObj : public CalcUnoApiTest,
public apitest::SpreadsheetDocumentSettings,
public apitest::XCalculatable,
public apitest::XConsolidatable,
@@ -79,7 +79,7 @@ private:
};
ScModelObj::ScModelObj()
- : UnoApiTest("/sc/qa/extras/testdocuments")
+ : CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
}
@@ -108,7 +108,7 @@ uno::Sequence<uno::Reference<table::XCell>> ScModelObj::getXCells() { return m_x
void ScModelObj::setUp()
{
- UnoApiTest::setUp();
+ CalcUnoApiTest::setUp();
// create a calc document
OUString aFileURL;
createFileURL(u"ScModelObj.ods", aFileURL);
@@ -118,7 +118,7 @@ void ScModelObj::setUp()
void ScModelObj::tearDown()
{
closeDocument(mxComponent);
- UnoApiTest::tearDown();
+ CalcUnoApiTest::tearDown();
}
CPPUNIT_TEST_SUITE_REGISTRATION(ScModelObj);
diff --git a/sc/qa/extras/vba-macro-test.cxx b/sc/qa/extras/vba-macro-test.cxx
index 083951e9a7e0..a08377616887 100644
--- a/sc/qa/extras/vba-macro-test.cxx
+++ b/sc/qa/extras/vba-macro-test.cxx
@@ -8,7 +8,7 @@
*/
#include <sal/config.h>
-#include <test/unoapi_test.hxx>
+#include <test/calc_unoapi_test.hxx>
#include <osl/file.hxx>
#include <sal/log.hxx>
#include <vcl/scheduler.hxx>
@@ -34,11 +34,11 @@
using namespace css;
using namespace ooo::vba;
-class VBAMacroTest : public UnoApiTest
+class VBAMacroTest : public CalcUnoApiTest
{
public:
VBAMacroTest()
- : UnoApiTest("/sc/qa/extras/testdocuments")
+ : CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
}
@@ -95,7 +95,7 @@ private:
void VBAMacroTest::tearDown()
{
closeDocument(mxComponent);
- UnoApiTest::tearDown();
+ CalcUnoApiTest::tearDown();
}
void VBAMacroTest::testSimpleCopyAndPaste()