summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp')
-rw-r--r--Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp
index 6dec37f..7af546f 100644
--- a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp
+++ b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamServerSessionTest.cpp
@@ -72,11 +72,11 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
void testRequest() {
boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
- bytestreams->addReadBytestream("abcdef", stream1);
+ bytestreams->setHasBytestream("abcdef", true);
authenticate();
ByteArray hostname(createByteArray("abcdef"));
- receive(concat(createSafeByteArray("\x05\x01\x00\x03", 4), createSafeByteArray(hostname.size()), createSafeByteArray(hostname), createSafeByteArray("\x00\x00", 2)));
+ receive(concat(createSafeByteArray("\x05\x01\x00\x03", 4), createSafeByteArray(static_cast<char>(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));
}
@@ -86,18 +86,18 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
authenticate();
ByteArray hostname(createByteArray("abcdef"));
- receive(concat(createSafeByteArray("\x05\x01\x00\x03", 4), createSafeByteArray(hostname.size()), createSafeByteArray(hostname), createSafeByteArray("\x00\x00", 2)));
+ receive(concat(createSafeByteArray("\x05\x01\x00\x03", 4), createSafeByteArray(static_cast<char>(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);
}
void testReceiveData() {
boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
- bytestreams->addReadBytestream("abcdef", stream1);
+ bytestreams->setHasBytestream("abcdef", true);
authenticate();
request("abcdef");
eventLoop->processEvents();
- testling->startTransfer();
+ testling->startSending(stream1);
skipHeader("abcdef");
eventLoop->processEvents();
@@ -109,11 +109,11 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
boost::shared_ptr<SOCKS5BytestreamServerSession> testling(createSession());
testling->setChunkSize(3);
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
- bytestreams->addReadBytestream("abcdef", stream1);
+ bytestreams->setHasBytestream("abcdef", true);
authenticate();
request("abcdef");
eventLoop->processEvents();
- testling->startTransfer();
+ testling->startSending(stream1);
eventLoop->processEvents();
skipHeader("abcdef");
CPPUNIT_ASSERT(createByteArray("abcdefg") == receivedData);
@@ -125,11 +125,11 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
testling->setChunkSize(3);
stream1->setDataComplete(false);
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
- bytestreams->addReadBytestream("abcdef", stream1);
+ bytestreams->setHasBytestream("abcdef", true);
authenticate();
request("abcdef");
eventLoop->processEvents();
- testling->startTransfer();
+ testling->startSending(stream1);
eventLoop->processEvents();
skipHeader("abcdef");
CPPUNIT_ASSERT(createByteArray("abcdefg") == receivedData);
@@ -144,11 +144,11 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
testling->setChunkSize(3);
stream1->setDataComplete(false);
StartStopper<SOCKS5BytestreamServerSession> stopper(testling.get());
- bytestreams->addReadBytestream("abcdef", stream1);
+ bytestreams->setHasBytestream("abcdef", true);
authenticate();
request("abcdef");
eventLoop->processEvents();
- testling->startTransfer();
+ testling->startSending(stream1);
eventLoop->processEvents();
skipHeader("abcdef");
@@ -173,11 +173,11 @@ class SOCKS5BytestreamServerSessionTest : public CppUnit::TestFixture {
}
void request(const std::string& hostname) {
- receive(concat(createSafeByteArray("\x05\x01\x00\x03", 4), createSafeByteArray(hostname.size()), createSafeByteArray(hostname), createSafeByteArray("\x00\x00", 2)));
+ receive(concat(createSafeByteArray("\x05\x01\x00\x03", 4), createSafeByteArray(static_cast<char>(hostname.size())), createSafeByteArray(hostname), createSafeByteArray("\x00\x00", 2)));
}
void skipHeader(const std::string& hostname) {
- int headerSize = 7 + hostname.size();
+ size_t headerSize = 7 + hostname.size();
receivedData = createByteArray(&receivedData[headerSize], receivedData.size() - headerSize);
}