summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/QA/FileTransferTest/FileTransferTest.cpp')
-rw-r--r--Swiften/QA/FileTransferTest/FileTransferTest.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/Swiften/QA/FileTransferTest/FileTransferTest.cpp b/Swiften/QA/FileTransferTest/FileTransferTest.cpp
index ebdb36a..7d69277 100644
--- a/Swiften/QA/FileTransferTest/FileTransferTest.cpp
+++ b/Swiften/QA/FileTransferTest/FileTransferTest.cpp
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014-2016 Isode Limited. 2 * Copyright (c) 2014-2018 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
@@ -8,7 +8,6 @@
8 8
9#include <boost/algorithm/string.hpp> 9#include <boost/algorithm/string.hpp>
10#include <boost/filesystem.hpp> 10#include <boost/filesystem.hpp>
11#include <boost/numeric/conversion/cast.hpp>
12 11
13 12
14#include <Swiften/Base/Debug.h> 13#include <Swiften/Base/Debug.h>
@@ -78,14 +77,14 @@ class FileTransferTest {
78 sendFilePath_ = boost::filesystem::unique_path("ft_send_%%%%%%%%%%%%%%%%.bin"); 77 sendFilePath_ = boost::filesystem::unique_path("ft_send_%%%%%%%%%%%%%%%%.bin");
79 receiveFilePath_ = boost::filesystem::unique_path("ft_receive_%%%%%%%%%%%%%%%%.bin"); 78 receiveFilePath_ = boost::filesystem::unique_path("ft_receive_%%%%%%%%%%%%%%%%.bin");
80 79
81 size_t size = 1024 + boost::numeric_cast<size_t>(randGen.generateRandomInteger(1024 * 10)); 80 size_t size = 1024 + static_cast<size_t>(randGen.generateRandomInteger(1024 * 10));
82 sendData_.resize(size); 81 sendData_.resize(size);
83 for (unsigned char& n : sendData_) { 82 for (unsigned char& n : sendData_) {
84 n = boost::numeric_cast<unsigned char>(randGen.generateRandomInteger(255)); 83 n = static_cast<unsigned char>(randGen.generateRandomInteger(255));
85 } 84 }
86 85
87 std::ofstream outfile(sendFilePath_.native().c_str(), std::ios::out | std::ios::binary); 86 std::ofstream outfile(sendFilePath_.native().c_str(), std::ios::out | std::ios::binary);
88 outfile.write(reinterpret_cast<char *>(&sendData_[0]), boost::numeric_cast<ptrdiff_t>(sendData_.size())); 87 outfile.write(reinterpret_cast<char *>(&sendData_[0]), static_cast<ptrdiff_t>(sendData_.size()));
89 outfile.close(); 88 outfile.close();
90 } 89 }
91 90