diff options
Diffstat (limited to 'cpp/tests')
-rw-r--r-- | cpp/tests/.vg-supp | 54 | ||||
-rw-r--r-- | cpp/tests/InMemoryContentTest.cpp | 4 | ||||
-rw-r--r-- | cpp/tests/LazyLoadedContentTest.cpp | 4 | ||||
-rw-r--r-- | cpp/tests/MessageTest.cpp | 2 | ||||
-rw-r--r-- | cpp/tests/MockChannel.h | 5 |
5 files changed, 8 insertions, 61 deletions
diff --git a/cpp/tests/.vg-supp b/cpp/tests/.vg-supp index b9737f3990..b5abdf1385 100644 --- a/cpp/tests/.vg-supp +++ b/cpp/tests/.vg-supp @@ -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) -} diff --git a/cpp/tests/InMemoryContentTest.cpp b/cpp/tests/InMemoryContentTest.cpp index d02cc56a7b..4597ee5e5d 100644 --- a/cpp/tests/InMemoryContentTest.cpp +++ b/cpp/tests/InMemoryContentTest.cpp @@ -67,11 +67,11 @@ public: 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()); } } diff --git a/cpp/tests/LazyLoadedContentTest.cpp b/cpp/tests/LazyLoadedContentTest.cpp index b24cd5a84a..5a4dd34b53 100644 --- a/cpp/tests/LazyLoadedContentTest.cpp +++ b/cpp/tests/LazyLoadedContentTest.cpp @@ -97,11 +97,11 @@ public: 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()); } } }; diff --git a/cpp/tests/MessageTest.cpp b/cpp/tests/MessageTest.cpp index 9d200cf001..6d766c2260 100644 --- a/cpp/tests/MessageTest.cpp +++ b/cpp/tests/MessageTest.cpp @@ -76,7 +76,7 @@ class MessageTest : public CppUnit::TestCase 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()); } diff --git a/cpp/tests/MockChannel.h b/cpp/tests/MockChannel.h index 10fcb56969..79aa1d35af 100644 --- a/cpp/tests/MockChannel.h +++ b/cpp/tests/MockChannel.h @@ -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); } }; |