diff options
author | Noel Grandin <noel@peralex.com> | 2016-01-25 09:59:54 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-01-25 10:01:39 +0200 |
commit | 11cbce37f5817c506f6d13fdd2d578b7a5480fcf (patch) | |
tree | f7b7a84655b9f0c135affb70736ee00ae246b245 /comphelper/qa/container/comphelper_ifcontainer.cxx | |
parent | 3dc37e975ee79c4fd4215cb14a074f1fb5a35ca4 (diff) |
cleanup OInterfaceContainer2 unit tests
remove unused code and actually hook up the tests
in testifcontainer.cxx
Change-Id: I9694ebe44f1e8eed3d72373d62424345f899c8e6
Diffstat (limited to 'comphelper/qa/container/comphelper_ifcontainer.cxx')
-rw-r--r-- | comphelper/qa/container/comphelper_ifcontainer.cxx | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/comphelper/qa/container/comphelper_ifcontainer.cxx b/comphelper/qa/container/comphelper_ifcontainer.cxx index ba9af495eaf0..733a7e056751 100644 --- a/comphelper/qa/container/comphelper_ifcontainer.cxx +++ b/comphelper/qa/container/comphelper_ifcontainer.cxx @@ -34,8 +34,6 @@ using namespace com::sun::star; using namespace com::sun::star::uno; using namespace com::sun::star::lang; -class ContainerListener; - struct ContainerStats { int m_nAlive; int m_nDisposed; @@ -131,72 +129,6 @@ namespace comphelper_ifcontainer delete pContainer; } - template < typename ContainerType, typename ContainedType > - void doContainerTest(const ContainedType *pTypes) - { - ContainerStats aStats; - ContainerType *pContainer; - pContainer = new ContainerType(m_aGuard); - - int i; - Reference<XEventListener> xRefs[nTests * 2]; - - // add these interfaces - for (i = 0; i < nTests * 2; i++) - { - xRefs[i] = new ContainerListener(&aStats); - pContainer->addInterface(pTypes[i / 2], xRefs[i]); - } - - // check it is all there - for (i = 0; i < nTests; i++) - { - cppu::OInterfaceContainerHelper *pHelper; - - pHelper = pContainer->getContainer(pTypes[i]); - - CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr); - Sequence<Reference< XInterface > > aSeq = pHelper->getElements(); - CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 2); - CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]); - CPPUNIT_ASSERT_MESSAGE("match", aSeq[1] == xRefs[i*2+1]); - } - - // remove every other interface - for (i = 0; i < nTests; i++) - pContainer->removeInterface(pTypes[i], xRefs[i*2+1]); - - // check it is half there - for (i = 0; i < nTests; i++) - { - cppu::OInterfaceContainerHelper *pHelper; - - pHelper = pContainer->getContainer(pTypes[i]); - - CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr); - Sequence<Reference< XInterface > > aSeq = pHelper->getElements(); - CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 1); - CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]); - } - - // remove the 1st half of the rest - for (i = 0; i < nTests / 2; i++) - pContainer->removeInterface(pTypes[i], xRefs[i*2]); - - // check it is half there - for (i = 0; i < nTests / 2; i++) - { - cppu::OInterfaceContainerHelper *pHelper; - - pHelper = pContainer->getContainer(pTypes[i]); - CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr); - Sequence<Reference< XInterface > > aSeq = pHelper->getElements(); - CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 0); - } - - delete pContainer; - } - // Automatic registration code CPPUNIT_TEST_SUITE(IfTest); CPPUNIT_TEST(testCreateDispose); |