summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-04-27 15:32:19 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-04-28 00:24:48 -0400
commitd0af33e87db753d6d171548f75c2e242cde00497 (patch)
treeee6bde2d2707378d741c77bf992ee6e41fb05204 /sc/qa
parent08f4273d7513e92f3dafa40b888467aaaf3c4b9f (diff)
Initial skeleton for API test on ScEditFieldObj.
ScEditFieldObj was formerly ScCellFieldObj and ScHeaderFieldObj merged into one. Change-Id: I600188d7ee22bb7c7c18735f570460ce50083c6a
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/extras/sceditfieldobj.cxx89
1 files changed, 89 insertions, 0 deletions
diff --git a/sc/qa/extras/sceditfieldobj.cxx b/sc/qa/extras/sceditfieldobj.cxx
new file mode 100644
index 000000000000..a065a3fe50cc
--- /dev/null
+++ b/sc/qa/extras/sceditfieldobj.cxx
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Kohei Yoshida <kohei.yoshida@suse.com>
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <test/unoapi_test.hxx>
+#include <test/text/xtextfield.hxx>
+
+#include <com/sun/star/text/XTextField.hpp>
+
+#define NUMBER_OF_TESTS 1
+
+namespace sc_apitest {
+
+class ScEditFieldObj : public UnoApiTest, apitest::XTextField
+{
+public:
+ ScEditFieldObj();
+
+ virtual void setUp();
+ virtual void tearDown();
+ virtual uno::Reference<uno::XInterface> init();
+
+ CPPUNIT_TEST_SUITE(ScEditFieldObj);
+ CPPUNIT_TEST(testGetPresentation);
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+ static sal_Int32 nTest;
+ static uno::Reference<lang::XComponent> mxComponent;
+};
+
+sal_Int32 ScEditFieldObj::nTest = 0;
+uno::Reference<lang::XComponent> ScEditFieldObj::mxComponent;
+
+ScEditFieldObj::ScEditFieldObj() {}
+
+void ScEditFieldObj::setUp()
+{
+ ++nTest;
+ UnoApiTest::setUp();
+}
+
+void ScEditFieldObj::tearDown()
+{
+ if (nTest == NUMBER_OF_TESTS)
+ closeDocument(mxComponent);
+
+ UnoApiTest::tearDown();
+}
+
+uno::Reference<uno::XInterface> ScEditFieldObj::init()
+{
+ if (!mxComponent.is())
+ mxComponent = loadFromDesktop("private:factory/scalc");
+
+ return mxComponent;
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ScEditFieldObj);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */