diff options
Diffstat (limited to 'Swiften/Queries/UnitTest/IQRouterTest.cpp')
-rw-r--r-- | Swiften/Queries/UnitTest/IQRouterTest.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Swiften/Queries/UnitTest/IQRouterTest.cpp b/Swiften/Queries/UnitTest/IQRouterTest.cpp index d0d4911..0acb87b 100644 --- a/Swiften/Queries/UnitTest/IQRouterTest.cpp +++ b/Swiften/Queries/UnitTest/IQRouterTest.cpp @@ -4,9 +4,9 @@ * See the COPYING file for more information. */ +#include <memory> + #include <boost/bind.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/smart_ptr/make_shared.hpp> #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> @@ -45,7 +45,7 @@ class IQRouterTest : public CppUnit::TestFixture { DummyIQHandler handler2(true, &testling); testling.removeHandler(&handler1); - channel_->onIQReceived(boost::make_shared<IQ>()); + channel_->onIQReceived(std::make_shared<IQ>()); CPPUNIT_ASSERT_EQUAL(0, handler1.called); CPPUNIT_ASSERT_EQUAL(1, handler2.called); @@ -56,9 +56,9 @@ class IQRouterTest : public CppUnit::TestFixture { DummyIQHandler handler2(true, &testling); DummyIQHandler handler1(true, &testling); - channel_->onIQReceived(boost::make_shared<IQ>()); + channel_->onIQReceived(std::make_shared<IQ>()); testling.removeHandler(&handler1); - channel_->onIQReceived(boost::make_shared<IQ>()); + channel_->onIQReceived(std::make_shared<IQ>()); CPPUNIT_ASSERT_EQUAL(1, handler1.called); CPPUNIT_ASSERT_EQUAL(1, handler2.called); @@ -69,7 +69,7 @@ class IQRouterTest : public CppUnit::TestFixture { DummyIQHandler handler2(false, &testling); DummyIQHandler handler1(true, &testling); - channel_->onIQReceived(boost::make_shared<IQ>()); + channel_->onIQReceived(std::make_shared<IQ>()); CPPUNIT_ASSERT_EQUAL(1, handler1.called); CPPUNIT_ASSERT_EQUAL(0, handler2.called); @@ -81,7 +81,7 @@ class IQRouterTest : public CppUnit::TestFixture { DummyIQHandler handler2(true, &testling); DummyIQHandler handler1(false, &testling); - channel_->onIQReceived(boost::make_shared<IQ>()); + channel_->onIQReceived(std::make_shared<IQ>()); CPPUNIT_ASSERT_EQUAL(1, handler1.called); CPPUNIT_ASSERT_EQUAL(1, handler2.called); @@ -92,7 +92,7 @@ class IQRouterTest : public CppUnit::TestFixture { IQRouter testling(channel_); DummyIQHandler handler(false, &testling); - channel_->onIQReceived(boost::make_shared<IQ>()); + channel_->onIQReceived(std::make_shared<IQ>()); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(channel_->iqs_.size())); CPPUNIT_ASSERT(channel_->iqs_[0]->getPayload<ErrorPayload>()); @@ -104,8 +104,8 @@ class IQRouterTest : public CppUnit::TestFixture { DummyIQHandler handler2(true, &testling); RemovingIQHandler handler1(&testling); - channel_->onIQReceived(boost::make_shared<IQ>()); - channel_->onIQReceived(boost::make_shared<IQ>()); + channel_->onIQReceived(std::make_shared<IQ>()); + channel_->onIQReceived(std::make_shared<IQ>()); CPPUNIT_ASSERT_EQUAL(1, handler1.called); CPPUNIT_ASSERT_EQUAL(2, handler2.called); @@ -115,7 +115,7 @@ class IQRouterTest : public CppUnit::TestFixture { IQRouter testling(channel_); testling.setFrom(JID("foo@bar.com/baz")); - testling.sendIQ(boost::make_shared<IQ>()); + testling.sendIQ(std::make_shared<IQ>()); CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), channel_->iqs_[0]->getFrom()); } @@ -123,7 +123,7 @@ class IQRouterTest : public CppUnit::TestFixture { void testSendIQ_WithoutFrom() { IQRouter testling(channel_); - testling.sendIQ(boost::make_shared<IQ>()); + testling.sendIQ(std::make_shared<IQ>()); CPPUNIT_ASSERT_EQUAL(JID(), channel_->iqs_[0]->getFrom()); } @@ -133,7 +133,7 @@ class IQRouterTest : public CppUnit::TestFixture { testling.setFrom(JID("foo@bar.com/baz")); DummyIQHandler handler(false, &testling); - channel_->onIQReceived(boost::make_shared<IQ>()); + channel_->onIQReceived(std::make_shared<IQ>()); CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com/baz"), channel_->iqs_[0]->getFrom()); } @@ -148,7 +148,7 @@ class IQRouterTest : public CppUnit::TestFixture { router->removeHandler(this); } - virtual bool handleIQ(boost::shared_ptr<IQ>) { + virtual bool handleIQ(std::shared_ptr<IQ>) { called++; return handle; } @@ -162,7 +162,7 @@ class IQRouterTest : public CppUnit::TestFixture { router->addHandler(this); } - virtual bool handleIQ(boost::shared_ptr<IQ>) { + virtual bool handleIQ(std::shared_ptr<IQ>) { called++; router->removeHandler(this); return false; |