diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-07-15 18:07:44 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-07-15 18:07:44 (GMT) |
commit | f061668e3c1d5eac01b85303e2c81df2bc560e9a (patch) | |
tree | de56afe6d93cb36425f7c2e458575d27bd9105a4 /Swiften/Client/UnitTest | |
parent | 0930cd940963be0edfe7c80b4925babca0e01443 (diff) | |
download | swift-contrib-f061668e3c1d5eac01b85303e2c81df2bc560e9a.zip swift-contrib-f061668e3c1d5eac01b85303e2c81df2bc560e9a.tar.bz2 |
Make stream stack layers reference counted.
Diffstat (limited to 'Swiften/Client/UnitTest')
-rw-r--r-- | Swiften/Client/UnitTest/SessionTest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Swiften/Client/UnitTest/SessionTest.cpp b/Swiften/Client/UnitTest/SessionTest.cpp index f7f1db0..5d43736 100644 --- a/Swiften/Client/UnitTest/SessionTest.cpp +++ b/Swiften/Client/UnitTest/SessionTest.cpp @@ -718,23 +718,23 @@ class SessionTest : public CppUnit::TestFixture { MockTLSLayerFactory() : haveTLS_(true) {} void setTLSSupported(bool b) { haveTLS_ = b; } virtual bool canCreate() const { return haveTLS_; } - virtual TLSLayer* createTLSLayer() { + virtual boost::shared_ptr<TLSLayer> createTLSLayer() { assert(haveTLS_); - MockTLSLayer* result = new MockTLSLayer(); + boost::shared_ptr<MockTLSLayer> result(new MockTLSLayer()); layers_.push_back(result); return result; } - std::vector<MockTLSLayer*> layers_; + std::vector< boost::shared_ptr<MockTLSLayer> > layers_; bool haveTLS_; }; struct MockSession : public Session { MockSession(const JID& jid, ConnectionFactory* connectionFactory, TLSLayerFactory* tlsLayerFactory, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers) : Session(jid, connectionFactory, tlsLayerFactory, payloadParserFactories, payloadSerializers) {} - MockTLSLayer* getTLSLayer() const { + boost::shared_ptr<MockTLSLayer> getTLSLayer() const { return getStreamStack()->getLayer<MockTLSLayer>(); } - WhitespacePingLayer* getWhitespacePingLayer() const { + boost::shared_ptr<WhitespacePingLayer> getWhitespacePingLayer() const { return getStreamStack()->getLayer<WhitespacePingLayer>(); } }; |