bump product version to 7.2.5.1
[LibreOffice.git] / sfx2 / qa / cppunit / test_controlleritem.cxx
blob75d220536712e89c4adfbee1d00d21203318fea1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <sal/types.h>
11 #include <cppunit/TestAssert.h>
12 #include <cppunit/TestFixture.h>
13 #include <cppunit/extensions/HelperMacros.h>
14 #include <cppunit/plugin/TestPlugIn.h>
16 #include <sfx2/ctrlitem.hxx>
18 namespace {
20 class ControllerItemTest
21 : public ::CppUnit::TestFixture
23 public:
24 void test();
26 CPPUNIT_TEST_SUITE(ControllerItemTest);
27 CPPUNIT_TEST(test);
28 CPPUNIT_TEST_SUITE_END();
30 private:
33 bool bDeleted = false;
35 class FooController : public SfxControllerItem {
36 public:
37 FooController() : SfxControllerItem() {}
38 virtual ~FooController() override { bDeleted = true; }
41 void ControllerItemTest::test()
43 FooController *pController(new FooController());
45 // TESTME: binding, un-binding, re-binding, IsBound, SetId etc.
47 pController->dispose();
48 delete pController;
49 CPPUNIT_ASSERT( bDeleted );
52 CPPUNIT_TEST_SUITE_REGISTRATION(ControllerItemTest);
56 CPPUNIT_PLUGIN_IMPLEMENT();
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */