diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-05-18 16:22:06 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-05-18 16:50:18 (GMT) |
commit | 8472194d716e0e3b95a66bf5be45c246ee79d0af (patch) | |
tree | b9f473e0e606b012ee5013e85d2cf5e7523b7029 /Swiften/FileTransfer/UnitTest | |
parent | b1b3b8f88517ad8b14795cc8a6265962d2935be3 (diff) | |
download | swift-contrib-8472194d716e0e3b95a66bf5be45c246ee79d0af.zip swift-contrib-8472194d716e0e3b95a66bf5be45c246ee79d0af.tar.bz2 |
Propagate use of SafeByteArray down to the connection.
Diffstat (limited to 'Swiften/FileTransfer/UnitTest')
-rw-r--r-- | Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp index d4c31c5..06bc98f 100644 --- a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp +++ b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp @@ -48,7 +48,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession()); StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get()); - receive(createByteArray("\x05\x02\x01\x02")); + receive(createSafeByteArray("\x05\x02\x01\x02")); CPPUNIT_ASSERT(createByteArray("\x05\x00", 2) == receivedData); } @@ -57,10 +57,10 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession()); StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get()); - receive(createByteArray("\x05\x02\x01")); + receive(createSafeByteArray("\x05\x02\x01")); CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(receivedData.size())); - receive(createByteArray("\x01")); + receive(createSafeByteArray("\x01")); CPPUNIT_ASSERT(createByteArray("\x05\x00", 2) == receivedData); } @@ -71,7 +71,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { authenticate(); ByteArray hostname(createByteArray("abcdef")); - receive(concat(createByteArray("\x05\x01\x00\x03", 4), createByteArray(hostname.size()), hostname, createByteArray("\x00\x00", 2))); + receive(concat(createSafeByteArray("\x05\x01\x00\x03", 4), createSafeByteArray(hostname.size()), createSafeByteArray(hostname), createSafeByteArray("\x00\x00", 2))); CPPUNIT_ASSERT(createByteArray("\x05\x00\x00\x03\x06\x61\x62\x63\x64\x65\x66\x00\x00", 13) == createByteArray(&receivedData[0], 13)); } @@ -81,7 +81,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { authenticate(); ByteArray hostname(createByteArray("abcdef")); - receive(concat(createByteArray("\x05\x01\x00\x03", 4), createByteArray(hostname.size()), hostname, createByteArray("\x00\x00", 2))); + receive(concat(createSafeByteArray("\x05\x01\x00\x03", 4), createSafeByteArray(hostname.size()), createSafeByteArray(hostname), createSafeByteArray("\x00\x00", 2))); CPPUNIT_ASSERT(createByteArray("\x05\x04\x00\x03\x06\x61\x62\x63\x64\x65\x66\x00\x00", 13) == receivedData); } @@ -113,19 +113,19 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { } private: - void receive(const ByteArray& data) { + void receive(const SafeByteArray& data) { connection->receive(data); eventLoop->processEvents(); } void authenticate() { - receive(createByteArray("\x05\x02\x01\x02")); + receive(createSafeByteArray("\x05\x02\x01\x02")); receivedData.clear(); receivedDataChunks = 0; } void request(const std::string& hostname) { - receive(concat(createByteArray("\x05\x01\x00\x03", 4), createByteArray(hostname.size()), createByteArray(hostname), createByteArray("\x00\x00", 2))); + receive(concat(createSafeByteArray("\x05\x01\x00\x03", 4), createSafeByteArray(hostname.size()), createSafeByteArray(hostname), createSafeByteArray("\x00\x00", 2))); } void skipHeader(const std::string& hostname) { @@ -134,7 +134,7 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture { } - void handleDataWritten(const ByteArray& data) { + void handleDataWritten(const SafeByteArray& data) { receivedData.insert(receivedData.end(), data.begin(), data.end()); receivedDataChunks++; } |