nss: upgrade to release 3.73
[LibreOffice.git] / sc / qa / extras / scindexenumeration_functiondescriptionenumeration.cxx
blob33572aa2d7ffca8cffb3ab8fcc17a2190d30ec62
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <test/calc_unoapi_test.hxx>
11 #include <test/container/xenumeration.hxx>
13 #include <com/sun/star/container/XEnumerationAccess.hpp>
14 #include <com/sun/star/lang/XComponent.hpp>
15 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
16 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
17 #include <com/sun/star/uno/XInterface.hpp>
19 #include <com/sun/star/uno/Reference.hxx>
21 using namespace css;
22 using namespace css::uno;
24 namespace sc_apitest
26 class ScIndexEnumeration_FunctionDescriptionEnumeration : public CalcUnoApiTest,
27 public apitest::XEnumeration
29 public:
30 ScIndexEnumeration_FunctionDescriptionEnumeration();
32 virtual uno::Reference<uno::XInterface> init() override;
33 virtual void setUp() override;
34 virtual void tearDown() override;
36 CPPUNIT_TEST_SUITE(ScIndexEnumeration_FunctionDescriptionEnumeration);
38 // XEnumeration
39 CPPUNIT_TEST(testHasMoreElements);
40 CPPUNIT_TEST(testNextElement);
42 CPPUNIT_TEST_SUITE_END();
44 private:
45 uno::Reference<lang::XComponent> m_xComponent;
48 ScIndexEnumeration_FunctionDescriptionEnumeration::
49 ScIndexEnumeration_FunctionDescriptionEnumeration()
50 : CalcUnoApiTest("/sc/qa/extras/testdocuments")
54 uno::Reference<uno::XInterface> ScIndexEnumeration_FunctionDescriptionEnumeration::init()
56 uno::Reference<sheet::XSpreadsheetDocument> xDoc(m_xComponent, uno::UNO_QUERY_THROW);
57 CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
59 uno::Reference<lang::XMultiServiceFactory> xMSF(xDoc, uno::UNO_QUERY_THROW);
60 uno::Reference<container::XEnumerationAccess> xEA(
61 xMSF->createInstance("com.sun.star.sheet.FunctionDescriptions"), uno::UNO_QUERY_THROW);
63 return xEA->createEnumeration();
66 void ScIndexEnumeration_FunctionDescriptionEnumeration::setUp()
68 CalcUnoApiTest::setUp();
69 m_xComponent = loadFromDesktop("private:factory/scalc");
70 CPPUNIT_ASSERT_MESSAGE("no component", m_xComponent.is());
73 void ScIndexEnumeration_FunctionDescriptionEnumeration::tearDown()
75 closeDocument(m_xComponent);
76 CalcUnoApiTest::tearDown();
79 CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_FunctionDescriptionEnumeration);
81 } // namespace sc_apitest
83 CPPUNIT_PLUGIN_IMPLEMENT();
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */