summaryrefslogtreecommitdiff
path: root/sc/qa/extras
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-09-25 02:40:39 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-09-25 15:11:34 +0200
commitce6f47a4588e2c6e115fcc4980f575d3002ca603 (patch)
treeadf81474d76c2b6aa180bb388da04b2d66d3c72f /sc/qa/extras
parentedaa6ac16800be64e86e1a022a6b4a9fff82649a (diff)
move XGoalSeek api test to c++
Change-Id: I689be9776c4d1fe7d931446d62ea8b1fd733de92
Diffstat (limited to 'sc/qa/extras')
-rw-r--r--sc/qa/extras/scmodelobj.cxx69
-rw-r--r--sc/qa/extras/testdocuments/ScModelObj.odsbin0 -> 7599 bytes
2 files changed, 69 insertions, 0 deletions
diff --git a/sc/qa/extras/scmodelobj.cxx b/sc/qa/extras/scmodelobj.cxx
new file mode 100644
index 000000000000..93bb0ca1d442
--- /dev/null
+++ b/sc/qa/extras/scmodelobj.cxx
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <test/unoapi_test.hxx>
+#include <test/sheet/xgoalseek.hxx>
+
+namespace sc_apitest {
+
+#define NUMBER_OF_TESTS 1
+
+class ScModelObj : public UnoApiTest, apitest::XGoalSeek
+{
+public:
+ virtual void setUp();
+ virtual void tearDown();
+
+ virtual uno::Reference< uno::XInterface > init();
+
+ CPPUNIT_TEST_SUITE(ScModelObj);
+ CPPUNIT_TEST(testSeekGoal);
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+ static sal_Int32 nTest;
+ static uno::Reference< lang::XComponent > mxComponent;
+};
+
+
+sal_Int32 ScModelObj::nTest = 0;
+uno::Reference< lang::XComponent > ScModelObj::mxComponent;
+
+uno::Reference< uno::XInterface > ScModelObj::init()
+{
+ rtl::OUString aFileURL;
+ createFileURL(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScModelObj.ods")), aFileURL);
+ if(!mxComponent.is())
+ mxComponent = loadFromDesktop(aFileURL);
+ CPPUNIT_ASSERT(mxComponent.is());
+
+ return mxComponent;
+}
+
+void ScModelObj::setUp()
+{
+ nTest++;
+ UnoApiTest::setUp();
+}
+
+void ScModelObj::tearDown()
+{
+ if (nTest == NUMBER_OF_TESTS)
+ closeDocument(mxComponent);
+
+ UnoApiTest::tearDown();
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ScModelObj);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/extras/testdocuments/ScModelObj.ods b/sc/qa/extras/testdocuments/ScModelObj.ods
new file mode 100644
index 000000000000..56a25329cb7c
--- /dev/null
+++ b/sc/qa/extras/testdocuments/ScModelObj.ods
Binary files differ