You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2007/03/30 01:08:09 UTC

svn commit: r523869 - in /incubator/qpid/trunk/qpid/cpp/tests: .vg-supp BrokerChannelTest.cpp

Author: aconway
Date: Thu Mar 29 16:08:08 2007
New Revision: 523869

URL: http://svn.apache.org/viewvc?view=rev&rev=523869
Log:

 * tests/BrokerChannelTest.cpp: fixed leak in test code.
 * tests/.vg-supp: Updated supressions

Modified:
    incubator/qpid/trunk/qpid/cpp/tests/.vg-supp
    incubator/qpid/trunk/qpid/cpp/tests/BrokerChannelTest.cpp

Modified: incubator/qpid/trunk/qpid/cpp/tests/.vg-supp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/tests/.vg-supp?view=diff&rev=523869&r1=523868&r2=523869
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/.vg-supp (original)
+++ incubator/qpid/trunk/qpid/cpp/tests/.vg-supp Thu Mar 29 16:08:08 2007
@@ -2,27 +2,6 @@
    <insert a suppression name here>
    Memcheck:Leak
    fun:_Znwj
-   fun:_ZN4qpid7framing14ChannelAdapter4sendEN5boost10shared_ptrINS0_7AMQBodyEEE
-   fun:_ZN4qpid7framing14ChannelAdapter4sendEPNS0_7AMQBodyE
-   fun:_ZN4qpid7framing16AMQP_ClientProxy10Connection5startEhhRKNS0_10FieldTableERKSsS7_
-   fun:_ZN4qpid6broker10Connection9initiatedERKNS_7framing18ProtocolInitiationE
-   fun:_ZN17BrokerChannelTestC1Ev
-   fun:_ZN7CppUnit25ConcretTestFixtureFactoryI17BrokerChannelTestE11makeFixtureEv
-   fun:_ZNK7CppUnit27TestSuiteBuilderContextBase15makeTestFixtureEv
-   fun:_ZNK7CppUnit23TestSuiteBuilderContextI17BrokerChannelTestE11makeFixtureEv
-   fun:_ZN17BrokerChannelTest15addTestsToSuiteERN7CppUnit27TestSuiteBuilderContextBaseE
-   fun:_ZN17BrokerChannelTest5suiteEv
-   fun:_ZN7CppUnit16TestSuiteFactoryI17BrokerChannelTestE8makeTestEv
-   fun:_ZN7CppUnit19TestFactoryRegistry14addTestToSuiteEPNS_9TestSuiteE
-   fun:_ZN7CppUnit19TestFactoryRegistry8makeTestEv
-   obj:/usr/bin/DllPlugInTester
-   obj:/usr/bin/DllPlugInTester
-   fun:(below main)
-}
-{
-   <insert a suppression name here>
-   Memcheck:Leak
-   fun:_Znwj
    fun:_ZN4qpid6broker17ReferenceRegistry4openERKSs
    fun:_ZN13ReferenceTestC1Ev
    fun:_ZN7CppUnit25ConcretTestFixtureFactoryI13ReferenceTestE11makeFixtureEv

Modified: incubator/qpid/trunk/qpid/cpp/tests/BrokerChannelTest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/tests/BrokerChannelTest.cpp?view=diff&rev=523869&r1=523868&r2=523869
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/BrokerChannelTest.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/tests/BrokerChannelTest.cpp Thu Mar 29 16:08:08 2007
@@ -31,6 +31,7 @@
 #include "MockChannel.h"
 #include "broker/Connection.h"
 #include "ProtocolInitiation.h"
+#include <boost/ptr_container/ptr_vector.hpp>
 
 using namespace boost;
 using namespace qpid::broker;
@@ -40,7 +41,7 @@
 using std::queue;
 
 struct MockHandler : ConnectionOutputHandler{
-    std::vector<AMQFrame*> frames; 
+    boost::ptr_vector<AMQFrame> frames; 
 
     void send(AMQFrame* frame){ frames.push_back(frame); }
 
@@ -190,18 +191,18 @@
 
         queue->deliver(msg);
         CPPUNIT_ASSERT_EQUAL((size_t) 4, handler.frames.size());
-        CPPUNIT_ASSERT_EQUAL(ChannelId(0), handler.frames[0]->getChannel());
-        CPPUNIT_ASSERT_EQUAL(ChannelId(7), handler.frames[1]->getChannel());
-        CPPUNIT_ASSERT_EQUAL(ChannelId(7), handler.frames[2]->getChannel());
-        CPPUNIT_ASSERT_EQUAL(ChannelId(7), handler.frames[3]->getChannel());
+        CPPUNIT_ASSERT_EQUAL(ChannelId(0), handler.frames[0].getChannel());
+        CPPUNIT_ASSERT_EQUAL(ChannelId(7), handler.frames[1].getChannel());
+        CPPUNIT_ASSERT_EQUAL(ChannelId(7), handler.frames[2].getChannel());
+        CPPUNIT_ASSERT_EQUAL(ChannelId(7), handler.frames[3].getChannel());
         CPPUNIT_ASSERT(dynamic_cast<ConnectionStartBody*>(
-                           handler.frames[0]->getBody().get()));
+                           handler.frames[0].getBody().get()));
         CPPUNIT_ASSERT(dynamic_cast<BasicDeliverBody*>(
-                           handler.frames[1]->getBody().get()));
+                           handler.frames[1].getBody().get()));
         CPPUNIT_ASSERT(dynamic_cast<AMQHeaderBody*>(
-                           handler.frames[2]->getBody().get()));
+                           handler.frames[2].getBody().get()));
         AMQContentBody* contentBody = dynamic_cast<AMQContentBody*>(
-            handler.frames[3]->getBody().get());
+            handler.frames[3].getBody().get());
         CPPUNIT_ASSERT(contentBody);
         CPPUNIT_ASSERT_EQUAL(data, contentBody->getData());
     }
@@ -221,18 +222,18 @@
 
         queue->deliver(msg);
         CPPUNIT_ASSERT_EQUAL((size_t) 4, handler.frames.size());
-        CPPUNIT_ASSERT_EQUAL(ChannelId(0), handler.frames[0]->getChannel());
-        CPPUNIT_ASSERT_EQUAL(ChannelId(7), handler.frames[1]->getChannel());
-        CPPUNIT_ASSERT_EQUAL(ChannelId(7), handler.frames[2]->getChannel());
-        CPPUNIT_ASSERT_EQUAL(ChannelId(7), handler.frames[3]->getChannel());
+        CPPUNIT_ASSERT_EQUAL(ChannelId(0), handler.frames[0].getChannel());
+        CPPUNIT_ASSERT_EQUAL(ChannelId(7), handler.frames[1].getChannel());
+        CPPUNIT_ASSERT_EQUAL(ChannelId(7), handler.frames[2].getChannel());
+        CPPUNIT_ASSERT_EQUAL(ChannelId(7), handler.frames[3].getChannel());
         CPPUNIT_ASSERT(dynamic_cast<ConnectionStartBody*>(
-                           handler.frames[0]->getBody().get()));
+                           handler.frames[0].getBody().get()));
         CPPUNIT_ASSERT(dynamic_cast<BasicDeliverBody*>(
-                           handler.frames[1]->getBody().get()));
+                           handler.frames[1].getBody().get()));
         CPPUNIT_ASSERT(dynamic_cast<AMQHeaderBody*>(
-                           handler.frames[2]->getBody().get()));
+                           handler.frames[2].getBody().get()));
         AMQContentBody* contentBody = dynamic_cast<AMQContentBody*>(
-            handler.frames[3]->getBody().get());
+            handler.frames[3].getBody().get());
         CPPUNIT_ASSERT(contentBody);
         CPPUNIT_ASSERT_EQUAL(data, contentBody->getData());
     }