diff options
Diffstat (limited to 'Swiften/Queries/UnitTest/ResponderTest.cpp')
-rw-r--r-- | Swiften/Queries/UnitTest/ResponderTest.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Swiften/Queries/UnitTest/ResponderTest.cpp b/Swiften/Queries/UnitTest/ResponderTest.cpp index a256346..6d40b6c 100644 --- a/Swiften/Queries/UnitTest/ResponderTest.cpp +++ b/Swiften/Queries/UnitTest/ResponderTest.cpp @@ -1,18 +1,19 @@ /* * Copyright (c) 2010 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> #include <boost/shared_ptr.hpp> +#include <boost/smart_ptr/make_shared.hpp> #include <boost/bind.hpp> #include <Swiften/Queries/Responder.h> #include <Swiften/Queries/IQRouter.h> #include <Swiften/Queries/DummyIQChannel.h> #include <Swiften/Elements/SoftwareVersion.h> using namespace Swift; @@ -26,19 +27,19 @@ class ResponderTest : public CppUnit::TestFixture { CPPUNIT_TEST(testHandleIQ_Error); CPPUNIT_TEST(testHandleIQ_Result); CPPUNIT_TEST(testHandleIQ_NoPayload); CPPUNIT_TEST_SUITE_END(); public: void setUp() { channel_ = new DummyIQChannel(); router_ = new IQRouter(channel_); - payload_ = boost::shared_ptr<SoftwareVersion>(new SoftwareVersion("foo")); + payload_ = boost::make_shared<SoftwareVersion>("foo"); } void tearDown() { delete router_; delete channel_; } void testConstructor() { MyResponder testling(router_); @@ -102,19 +103,19 @@ class ResponderTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(!dynamic_cast<IQHandler*>(&testling)->handleIQ(createRequest(IQ::Result))); CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(testling.getPayloads_.size())); CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(testling.setPayloads_.size())); } void testHandleIQ_NoPayload() { MyResponder testling(router_); - CPPUNIT_ASSERT(!dynamic_cast<IQHandler*>(&testling)->handleIQ(boost::shared_ptr<IQ>(new IQ(IQ::Get)))); + CPPUNIT_ASSERT(!dynamic_cast<IQHandler*>(&testling)->handleIQ(boost::make_shared<IQ>(IQ::Get))); CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(testling.getPayloads_.size())); CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(testling.setPayloads_.size())); } private: boost::shared_ptr<IQ> createRequest(IQ::Type type) { boost::shared_ptr<IQ> iq(new IQ(type)); iq->addPayload(payload_); |