diff options
author | Tobias Markmann <tm@ayena.de> | 2012-03-20 00:05:55 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2012-03-20 19:13:43 (GMT) |
commit | 3d6694b0c698fff63d11f8bb4aa995c1df882315 (patch) | |
tree | a46ccace647f23a65100cf69c951345aa6dea7ab /Swiften/Client/UnitTest/ClientSessionTest.cpp | |
parent | 3d27d98ccc232ae7bfacfd5a3f85f44b6c2e9cc9 (diff) | |
download | swift-contrib-3d6694b0c698fff63d11f8bb4aa995c1df882315.zip swift-contrib-3d6694b0c698fff63d11f8bb4aa995c1df882315.tar.bz2 |
boost::shared_ptr<?>(new ?(...)) -> boost::make_shared<?>(...) transformation where possible.
License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
Diffstat (limited to 'Swiften/Client/UnitTest/ClientSessionTest.cpp')
-rw-r--r-- | Swiften/Client/UnitTest/ClientSessionTest.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Swiften/Client/UnitTest/ClientSessionTest.cpp b/Swiften/Client/UnitTest/ClientSessionTest.cpp index 22db8fc..a6d5a3a 100644 --- a/Swiften/Client/UnitTest/ClientSessionTest.cpp +++ b/Swiften/Client/UnitTest/ClientSessionTest.cpp @@ -60,19 +60,19 @@ class ClientSessionTest : public CppUnit::TestFixture { CPPUNIT_TEST(testSessionStart_AfterResourceBind); CPPUNIT_TEST(testWhitespacePing); CPPUNIT_TEST(testReceiveElementAfterSessionStarted); CPPUNIT_TEST(testSendElement); */ CPPUNIT_TEST_SUITE_END(); public: void setUp() { - server = boost::shared_ptr<MockSessionStream>(new MockSessionStream()); + server = boost::make_shared<MockSessionStream>(); sessionFinishedReceived = false; needCredentials = false; blindCertificateTrustChecker = new BlindCertificateTrustChecker(); } void tearDown() { delete blindCertificateTrustChecker; } @@ -414,23 +414,23 @@ class ClientSessionTest : public CppUnit::TestFixture { virtual void setWhitespacePingEnabled(bool enabled) { whitespacePingEnabled = enabled; } virtual void resetXMPPParser() { resetCount++; } void breakConnection() { - onClosed(boost::shared_ptr<SessionStream::Error>(new SessionStream::Error(SessionStream::Error::ConnectionReadError))); + onClosed(boost::make_shared<SessionStream::Error>(SessionStream::Error::ConnectionReadError)); } void breakTLS() { - onClosed(boost::shared_ptr<SessionStream::Error>(new SessionStream::Error(SessionStream::Error::TLSError))); + onClosed(boost::make_shared<SessionStream::Error>(SessionStream::Error::TLSError)); } void sendStreamStart() { ProtocolHeader header; header.setTo("foo.com"); return onStreamStartReceived(header); } @@ -439,23 +439,23 @@ class ClientSessionTest : public CppUnit::TestFixture { streamFeatures->setHasStartTLS(); onElementReceived(streamFeatures); } void sendStreamError() { onElementReceived(boost::make_shared<StreamError>()); } void sendTLSProceed() { - onElementReceived(boost::shared_ptr<TLSProceed>(new TLSProceed())); + onElementReceived(boost::make_shared<TLSProceed>()); } void sendTLSFailure() { - onElementReceived(boost::shared_ptr<StartTLSFailure>(new StartTLSFailure())); + onElementReceived(boost::make_shared<StartTLSFailure>()); } void sendStreamFeaturesWithMultipleAuthentication() { boost::shared_ptr<StreamFeatures> streamFeatures(new StreamFeatures()); streamFeatures->addAuthenticationMechanism("PLAIN"); streamFeatures->addAuthenticationMechanism("DIGEST-MD5"); streamFeatures->addAuthenticationMechanism("SCRAM-SHA1"); onElementReceived(streamFeatures); } @@ -478,31 +478,31 @@ class ClientSessionTest : public CppUnit::TestFixture { streamFeatures->setHasStreamManagement(); onElementReceived(streamFeatures); } void sendEmptyStreamFeatures() { onElementReceived(boost::make_shared<StreamFeatures>()); } void sendAuthSuccess() { - onElementReceived(boost::shared_ptr<AuthSuccess>(new AuthSuccess())); + onElementReceived(boost::make_shared<AuthSuccess>()); } void sendAuthFailure() { - onElementReceived(boost::shared_ptr<AuthFailure>(new AuthFailure())); + onElementReceived(boost::make_shared<AuthFailure>()); } void sendStreamManagementEnabled() { - onElementReceived(boost::shared_ptr<StreamManagementEnabled>(new StreamManagementEnabled())); + onElementReceived(boost::make_shared<StreamManagementEnabled>()); } void sendStreamManagementFailed() { - onElementReceived(boost::shared_ptr<StreamManagementFailed>(new StreamManagementFailed())); + onElementReceived(boost::make_shared<StreamManagementFailed>()); } void sendBindResult() { boost::shared_ptr<ResourceBind> resourceBind(new ResourceBind()); resourceBind->setJID(JID("foo@bar.com/bla")); boost::shared_ptr<IQ> iq = IQ::createResult(JID("foo@bar.com"), bindID, resourceBind); onElementReceived(iq); } @@ -749,19 +749,19 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ClientSessionTest); void testReceiveElementAfterSessionStarted() { boost::shared_ptr<MockSession> session(createSession("me@foo.com/Bar")); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); getMockServer()->sendStreamFeatures(); session->startSession(); processEvents(); getMockServer()->expectMessage(); - session->sendElement(boost::shared_ptr<Message>(new Message())); + session->sendElement(boost::make_shared<Message>())); } void testSendElement() { boost::shared_ptr<MockSession> session(createSession("me@foo.com/Bar")); session->onElementReceived.connect(boost::bind(&ClientSessionTest::addReceivedElement, this, _1)); getMockServer()->expectStreamStart(); getMockServer()->sendStreamStart(); getMockServer()->sendStreamFeatures(); getMockServer()->sendMessage(); |