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:20:47 UTC
svn commit: r523870 - in /incubator/qpid/trunk/qpid/cpp/tests: .vg-supp
InMemoryContentTest.cpp LazyLoadedContentTest.cpp MessageTest.cpp
MockChannel.h
Author: aconway
Date: Thu Mar 29 16:20:45 2007
New Revision: 523870
URL: http://svn.apache.org/viewvc?view=rev&rev=523870
Log:
Fixed more test memory leaks.
Modified:
incubator/qpid/trunk/qpid/cpp/tests/.vg-supp
incubator/qpid/trunk/qpid/cpp/tests/InMemoryContentTest.cpp
incubator/qpid/trunk/qpid/cpp/tests/LazyLoadedContentTest.cpp
incubator/qpid/trunk/qpid/cpp/tests/MessageTest.cpp
incubator/qpid/trunk/qpid/cpp/tests/MockChannel.h
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=523870&r1=523869&r2=523870
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/.vg-supp (original)
+++ incubator/qpid/trunk/qpid/cpp/tests/.vg-supp Thu Mar 29 16:20:45 2007
@@ -16,57 +16,3 @@
obj:/usr/bin/DllPlugInTester
fun:(below main)
}
-{
- <insert a suppression name here>
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker12BasicMessage7deliverERNS_7framing14ChannelAdapterERKSsyj
- fun:_ZN4qpid6broker7Channel7deliverERN5boost10shared_ptrINS0_7MessageEEERKSsRNS3_INS0_5QueueEEEb
- fun:_ZN4qpid6broker7Channel12ConsumerImpl7deliverERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker5Queue8dispatchERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker5Queue7processERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker5Queue7deliverERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN17BrokerChannelTest23testDeliveryAndRecoveryEv
- fun:_ZN7CppUnit10TestCallerI17BrokerChannelTestE7runTestEv
- fun:_ZNK7CppUnit21TestCaseMethodFunctorclEv
- fun:_ZN7CppUnit16DefaultProtector7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZNK7CppUnit14ProtectorChain14ProtectFunctorclEv
- fun:_ZN7CppUnit14ProtectorChain7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZN7CppUnit10TestResult7protectERKNS_7FunctorEPNS_4TestERKSs
- fun:_ZN7CppUnit8TestCase3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestRunner13WrappingSuite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestResult7runTestEPNS_4TestE
- fun:_ZN7CppUnit10TestRunner3runERNS_10TestResultERKSs
- obj:/usr/bin/DllPlugInTester
- obj:/usr/bin/DllPlugInTester
-}
-{
- <insert a suppression name here>
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSs4_Rep9_S_createEjjRKSaIcE
- obj:/usr/lib/libstdc++.so.6.0.8
- fun:_ZNSsC1EPKcRKSaIcE
- fun:_ZN17BrokerChannelTest23testDeliveryAndRecoveryEv
- fun:_ZN7CppUnit10TestCallerI17BrokerChannelTestE7runTestEv
- fun:_ZNK7CppUnit21TestCaseMethodFunctorclEv
- fun:_ZN7CppUnit16DefaultProtector7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZNK7CppUnit14ProtectorChain14ProtectFunctorclEv
- fun:_ZN7CppUnit14ProtectorChain7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZN7CppUnit10TestResult7protectERKNS_7FunctorEPNS_4TestERKSs
- fun:_ZN7CppUnit8TestCase3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestRunner13WrappingSuite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestResult7runTestEPNS_4TestE
- fun:_ZN7CppUnit10TestRunner3runERNS_10TestResultERKSs
- obj:/usr/bin/DllPlugInTester
- obj:/usr/bin/DllPlugInTester
- fun:(below main)
-}
Modified: incubator/qpid/trunk/qpid/cpp/tests/InMemoryContentTest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/tests/InMemoryContentTest.cpp?view=diff&rev=523870&r1=523869&r2=523870
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/InMemoryContentTest.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/tests/InMemoryContentTest.cpp Thu Mar 29 16:20:45 2007
@@ -67,11 +67,11 @@
for (unsigned int i = 0; i < outCount; i++) {
AMQContentBody::shared_ptr chunk(
dynamic_pointer_cast<AMQContentBody>(
- channel.out.frames[i]->getBody()));
+ channel.out.frames[i].getBody()));
CPPUNIT_ASSERT(chunk);
CPPUNIT_ASSERT_EQUAL(out[i], chunk->getData());
CPPUNIT_ASSERT_EQUAL(
- ChannelId(3), channel.out.frames[i]->getChannel());
+ ChannelId(3), channel.out.frames[i].getChannel());
}
}
Modified: incubator/qpid/trunk/qpid/cpp/tests/LazyLoadedContentTest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/tests/LazyLoadedContentTest.cpp?view=diff&rev=523870&r1=523869&r2=523870
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/LazyLoadedContentTest.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/tests/LazyLoadedContentTest.cpp Thu Mar 29 16:20:45 2007
@@ -97,11 +97,11 @@
CPPUNIT_ASSERT_EQUAL(outCount, channel.out.frames.size());
for (unsigned int i = 0; i < outCount; i++) {
- AMQContentBody::shared_ptr chunk(dynamic_pointer_cast<AMQContentBody, AMQBody>(channel.out.frames[i]->getBody()));
+ AMQContentBody::shared_ptr chunk(dynamic_pointer_cast<AMQContentBody, AMQBody>(channel.out.frames[i].getBody()));
CPPUNIT_ASSERT(chunk);
CPPUNIT_ASSERT_EQUAL(out[i], chunk->getData());
CPPUNIT_ASSERT_EQUAL(
- ChannelId(3), channel.out.frames[i]->getChannel());
+ ChannelId(3), channel.out.frames[i].getChannel());
}
}
};
Modified: incubator/qpid/trunk/qpid/cpp/tests/MessageTest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/tests/MessageTest.cpp?view=diff&rev=523870&r1=523869&r2=523870
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/MessageTest.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/tests/MessageTest.cpp Thu Mar 29 16:20:45 2007
@@ -76,7 +76,7 @@
MockChannel channel(1);
msg->deliver(channel, "ignore", 0, 100);
CPPUNIT_ASSERT_EQUAL((size_t) 3, channel.out.frames.size());
- AMQContentBody::shared_ptr contentBody(dynamic_pointer_cast<AMQContentBody, AMQBody>(channel.out.frames[2]->getBody()));
+ AMQContentBody::shared_ptr contentBody(dynamic_pointer_cast<AMQContentBody, AMQBody>(channel.out.frames[2].getBody()));
CPPUNIT_ASSERT(contentBody);
CPPUNIT_ASSERT_EQUAL(data1 + data2, contentBody->getData());
}
Modified: incubator/qpid/trunk/qpid/cpp/tests/MockChannel.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/tests/MockChannel.h?view=diff&rev=523870&r1=523869&r2=523870
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/MockChannel.h (original)
+++ incubator/qpid/trunk/qpid/cpp/tests/MockChannel.h Thu Mar 29 16:20:45 2007
@@ -19,16 +19,17 @@
*
*/
-#include <boost/shared_ptr.hpp>
#include "framing/MethodContext.h"
#include "framing/ChannelAdapter.h"
#include "framing/OutputHandler.h"
#include "framing/AMQFrame.h"
#include "BasicGetBody.h"
+#include <boost/shared_ptr.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
/** Mock output handler to collect frames */
struct MockOutputHandler : public qpid::framing::OutputHandler {
- std::vector<qpid::framing::AMQFrame*> frames;
+ boost::ptr_vector<qpid::framing::AMQFrame> frames;
void send(qpid::framing::AMQFrame* frame){ frames.push_back(frame); }
};