summaryrefslogtreecommitdiff
path: root/comphelper/qa/container/comphelper_ifcontainer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'comphelper/qa/container/comphelper_ifcontainer.cxx')
-rw-r--r--comphelper/qa/container/comphelper_ifcontainer.cxx68
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);