summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-15 18:07:44 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-15 18:07:44 (GMT)
commitf061668e3c1d5eac01b85303e2c81df2bc560e9a (patch)
treede56afe6d93cb36425f7c2e458575d27bd9105a4 /Swiften/Client/UnitTest
parent0930cd940963be0edfe7c80b4925babca0e01443 (diff)
downloadswift-f061668e3c1d5eac01b85303e2c81df2bc560e9a.zip
swift-f061668e3c1d5eac01b85303e2c81df2bc560e9a.tar.bz2
Make stream stack layers reference counted.
Diffstat (limited to 'Swiften/Client/UnitTest')
-rw-r--r--Swiften/Client/UnitTest/SessionTest.cpp10
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>();
}
};