diff options
author | Alan Conway <aconway@apache.org> | 2007-03-29 22:30:48 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-03-29 22:30:48 +0000 |
commit | 1a23d52070195a9c8de98dd4af6e19f42051f1a5 (patch) | |
tree | a7515a61e0a46defc4ef84bea52424c38bdbba0c /cpp/tests/QueueTest.cpp | |
parent | 45d083f70618d21ae9d138cf0c3d8e44c84f4f93 (diff) | |
download | qpid-python-1a23d52070195a9c8de98dd4af6e19f42051f1a5.tar.gz |
Fixed memory leak: removed Binding and ExchangeBinding.
These classes unbind a deleted queue from any Exchanges.
But Exchanges hold shared_ptr<Queue>, so queues never deleted while
the exchange exists. Moreover queue-binding form a shared_ptr cycle
causing a leak.
Raised QPID-438 for the remaining problem: destroyed queues are never
unbound or deleted
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@523857 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/tests/QueueTest.cpp')
-rw-r--r-- | cpp/tests/QueueTest.cpp | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/cpp/tests/QueueTest.cpp b/cpp/tests/QueueTest.cpp index fa38029de1..e90c9259cf 100644 --- a/cpp/tests/QueueTest.cpp +++ b/cpp/tests/QueueTest.cpp @@ -28,15 +28,6 @@ using namespace qpid::broker; using namespace qpid::sys; -class TestBinding : public virtual Binding{ - bool cancelled; - -public: - TestBinding(); - virtual void cancel(); - bool isCancelled(); -}; - class TestConsumer : public virtual Consumer{ public: Message::shared_ptr last; @@ -49,7 +40,6 @@ class QueueTest : public CppUnit::TestCase { CPPUNIT_TEST_SUITE(QueueTest); CPPUNIT_TEST(testConsumers); - CPPUNIT_TEST(testBinding); CPPUNIT_TEST(testRegistry); CPPUNIT_TEST(testDequeue); CPPUNIT_TEST_SUITE_END(); @@ -93,20 +83,6 @@ class QueueTest : public CppUnit::TestCase CPPUNIT_ASSERT_EQUAL(uint32_t(0), queue->getConsumerCount()); } - void testBinding(){ - Queue::shared_ptr queue(new Queue("my_queue", true)); - //Test bindings: - TestBinding a; - TestBinding b; - queue->bound(&a); - queue->bound(&b); - - queue.reset(); - - CPPUNIT_ASSERT(a.isCancelled()); - CPPUNIT_ASSERT(b.isCancelled()); - } - void testRegistry(){ //Test use of queues in registry: QueueRegistry registry; @@ -165,18 +141,6 @@ class QueueTest : public CppUnit::TestCase CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_TEST_SUITE_REGISTRATION(QueueTest); -//TestBinding -TestBinding::TestBinding() : cancelled(false) {} - -void TestBinding::cancel(){ - CPPUNIT_ASSERT(!cancelled); - cancelled = true; -} - -bool TestBinding::isCancelled(){ - return cancelled; -} - //TestConsumer bool TestConsumer::deliver(Message::shared_ptr& msg){ last = msg; |