summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-05-18 16:22:06 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-05-18 16:50:18 (GMT)
commit8472194d716e0e3b95a66bf5be45c246ee79d0af (patch)
treeb9f473e0e606b012ee5013e85d2cf5e7523b7029 /Swiften/Network/UnitTest
parentb1b3b8f88517ad8b14795cc8a6265962d2935be3 (diff)
downloadswift-8472194d716e0e3b95a66bf5be45c246ee79d0af.zip
swift-8472194d716e0e3b95a66bf5be45c246ee79d0af.tar.bz2
Propagate use of SafeByteArray down to the connection.
Diffstat (limited to 'Swiften/Network/UnitTest')
-rw-r--r--Swiften/Network/UnitTest/ChainedConnectorTest.cpp2
-rw-r--r--Swiften/Network/UnitTest/ConnectorTest.cpp2
-rw-r--r--Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp20
3 files changed, 12 insertions, 12 deletions
diff --git a/Swiften/Network/UnitTest/ChainedConnectorTest.cpp b/Swiften/Network/UnitTest/ChainedConnectorTest.cpp
index 9c4c99d..c7d23da 100644
--- a/Swiften/Network/UnitTest/ChainedConnectorTest.cpp
+++ b/Swiften/Network/UnitTest/ChainedConnectorTest.cpp
@@ -128,7 +128,7 @@ class ChainedConnectorTest : public CppUnit::TestFixture {
HostAddressPort getLocalAddress() const { return HostAddressPort(); }
void disconnect() { assert(false); }
- void write(const ByteArray&) { assert(false); }
+ void write(const SafeByteArray&) { assert(false); }
bool connects;
int id;
diff --git a/Swiften/Network/UnitTest/ConnectorTest.cpp b/Swiften/Network/UnitTest/ConnectorTest.cpp
index 6151b5c..6488e67 100644
--- a/Swiften/Network/UnitTest/ConnectorTest.cpp
+++ b/Swiften/Network/UnitTest/ConnectorTest.cpp
@@ -269,7 +269,7 @@ class ConnectorTest : public CppUnit::TestFixture {
HostAddressPort getLocalAddress() const { return HostAddressPort(); }
void disconnect() { assert(false); }
- void write(const ByteArray&) { assert(false); }
+ void write(const SafeByteArray&) { assert(false); }
EventLoop* eventLoop;
boost::optional<HostAddressPort> hostAddressPort;
diff --git a/Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp b/Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp
index d33c988..90be27e 100644
--- a/Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp
+++ b/Swiften/Network/UnitTest/HTTPConnectProxiedConnectionTest.cpp
@@ -76,7 +76,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
testling->connect(HostAddressPort(HostAddress("2.2.2.2"), 2345));
eventLoop->processEvents();
- connectionFactory->connections[0]->onDataRead(createByteArray("HTTP/1.0 200 Connection established\r\n\r\n"));
+ connectionFactory->connections[0]->onDataRead(createSafeByteArray("HTTP/1.0 200 Connection established\r\n\r\n"));
eventLoop->processEvents();
CPPUNIT_ASSERT(connectFinished);
@@ -89,7 +89,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
testling->connect(HostAddressPort(HostAddress("2.2.2.2"), 2345));
eventLoop->processEvents();
- connectionFactory->connections[0]->onDataRead(createByteArray("FLOOP"));
+ connectionFactory->connections[0]->onDataRead(createSafeByteArray("FLOOP"));
eventLoop->processEvents();
CPPUNIT_ASSERT(connectFinished);
@@ -102,7 +102,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
testling->connect(HostAddressPort(HostAddress("2.2.2.2"), 2345));
eventLoop->processEvents();
- connectionFactory->connections[0]->onDataRead(createByteArray("HTTP/1.0 401 Unauthorized\r\n\r\n"));
+ connectionFactory->connections[0]->onDataRead(createSafeByteArray("HTTP/1.0 401 Unauthorized\r\n\r\n"));
eventLoop->processEvents();
CPPUNIT_ASSERT(connectFinished);
@@ -114,10 +114,10 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
HTTPConnectProxiedConnection::ref testling(createTestling());
testling->connect(HostAddressPort(HostAddress("2.2.2.2"), 2345));
eventLoop->processEvents();
- connectionFactory->connections[0]->onDataRead(createByteArray("HTTP/1.0 200 Connection established\r\n\r\n"));
+ connectionFactory->connections[0]->onDataRead(createSafeByteArray("HTTP/1.0 200 Connection established\r\n\r\n"));
eventLoop->processEvents();
- connectionFactory->connections[0]->onDataRead(createByteArray("abcdef"));
+ connectionFactory->connections[0]->onDataRead(createSafeByteArray("abcdef"));
CPPUNIT_ASSERT_EQUAL(createByteArray("abcdef"), dataRead);
}
@@ -126,11 +126,11 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
HTTPConnectProxiedConnection::ref testling(createTestling());
testling->connect(HostAddressPort(HostAddress("2.2.2.2"), 2345));
eventLoop->processEvents();
- connectionFactory->connections[0]->onDataRead(createByteArray("HTTP/1.0 200 Connection established\r\n\r\n"));
+ connectionFactory->connections[0]->onDataRead(createSafeByteArray("HTTP/1.0 200 Connection established\r\n\r\n"));
eventLoop->processEvents();
connectionFactory->connections[0]->dataWritten.clear();
- testling->write(createByteArray("abcdef"));
+ testling->write(createSafeByteArray("abcdef"));
CPPUNIT_ASSERT_EQUAL(createByteArray("abcdef"), connectionFactory->connections[0]->dataWritten);
}
@@ -151,7 +151,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
HTTPConnectProxiedConnection::ref testling(createTestling());
testling->connect(HostAddressPort(HostAddress("2.2.2.2"), 2345));
eventLoop->processEvents();
- connectionFactory->connections[0]->onDataRead(createByteArray("HTTP/1.0 200 Connection established\r\n\r\n"));
+ connectionFactory->connections[0]->onDataRead(createSafeByteArray("HTTP/1.0 200 Connection established\r\n\r\n"));
eventLoop->processEvents();
testling->disconnect();
@@ -180,7 +180,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
disconnectedError = e;
}
- void handleDataRead(const ByteArray& d) {
+ void handleDataRead(const SafeByteArray& d) {
append(dataRead, d);
}
@@ -204,7 +204,7 @@ class HTTPConnectProxiedConnectionTest : public CppUnit::TestFixture {
onDisconnected(boost::optional<Connection::Error>());
}
- void write(const ByteArray& d) {
+ void write(const SafeByteArray& d) {
append(dataWritten, d);
}