summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/QA/FileTransferTest/FileTransferTest.cpp')
-rw-r--r--Swiften/QA/FileTransferTest/FileTransferTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Swiften/QA/FileTransferTest/FileTransferTest.cpp b/Swiften/QA/FileTransferTest/FileTransferTest.cpp
index 8faf8a9..2dcaeb8 100644
--- a/Swiften/QA/FileTransferTest/FileTransferTest.cpp
+++ b/Swiften/QA/FileTransferTest/FileTransferTest.cpp
@@ -79,19 +79,19 @@ class FileTransferTest {
receiveFilePath_ = boost::filesystem::unique_path();
size_t size = 1024 + boost::numeric_cast<size_t>(randGen.generateRandomInteger(1024 * 10));
sendData_.resize(size);
for (size_t n = 0; n < sendData_.size(); n++) {
sendData_[n] = boost::numeric_cast<unsigned char>(randGen.generateRandomInteger(255));
}
std::ofstream outfile(sendFilePath_.native().c_str(), std::ios::out | std::ios::binary);
- outfile.write(reinterpret_cast<char *>(&sendData_[0]), sendData_.size());
+ outfile.write(reinterpret_cast<char *>(&sendData_[0]), boost::numeric_cast<ptrdiff_t>(sendData_.size()));
outfile.close();
}
~FileTransferTest() {
timeOut_->stop();
delete senderTracer_;
delete receiverTracer_;
@@ -255,19 +255,19 @@ class FileTransferTest {
ByteArray receiveData_;
std::vector<IncomingFileTransfer::ref> incomingFileTransfers_;
boost::filesystem::path receiveFilePath_;
boost::optional<FileTransferError> receiverError_;
bool receiverIsDone_;
Timer::ref timeOut_;
};
-bool runTest(int senderCandidates, int receiverCandidates) {
+static bool runTest(int senderCandidates, int receiverCandidates) {
bool success = false;
std::cout << "senderCandidates: " << senderCandidates << ", receiverCandidates: " << receiverCandidates << std::endl;
bool expectSuccess = (senderCandidates & receiverCandidates) > 0;
eventLoop = boost::make_shared<SimpleEventLoop>();
networkFactories = boost::make_shared<BoostNetworkFactories>(eventLoop.get());
boost::shared_ptr<FileTransferTest> testRun = boost::make_shared<FileTransferTest>(senderCandidates, receiverCandidates);