fixing warnings in tests code, part9 (#2758)

This commit is contained in:
Alden Torres 2018-02-02 02:26:21 -05:00 committed by Arvid Norberg
parent fe9883ea27
commit c5d62cf1ca
4 changed files with 7 additions and 11 deletions

View File

@ -526,7 +526,7 @@ TORRENT_TEST(lazy_entry)
{
unsigned char buf[] = { 0x44, 0x91, 0x3a };
entry ent = bdecode(buf, buf + sizeof(buf));
entry ent = bdecode(reinterpret_cast<char*>(buf), reinterpret_cast<char*>(buf) + sizeof(buf));
TEST_CHECK(ent == entry());
}

View File

@ -188,14 +188,7 @@ struct holder
holder(holder const&) = delete;
holder& operator=(holder const&) = delete;
holder(holder&& rhs) noexcept : m_buf(rhs.m_buf), m_size(rhs.m_size) { rhs.m_buf = nullptr; }
holder& operator=(holder&& rhs) noexcept
{
if (m_buf) free_buffer(m_buf);
m_buf = rhs.m_buf;
m_size = rhs.m_size;
rhs.m_buf = nullptr;
return *this;
}
holder& operator=(holder&& rhs) = delete;
char* data() const { return m_buf; }
std::size_t size() const { return m_size; }
private:

View File

@ -34,7 +34,9 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/hasher.hpp"
#include "libtorrent/broadcast_socket.hpp" // for supports_ipv6()
#include "setup_transfer.hpp"
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/crc.hpp>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
#include "test.hpp"

View File

@ -37,6 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/torrent_info.hpp"
#include "libtorrent/hex.hpp" // for to_hex
#include "libtorrent/time.hpp"
#include "libtorrent/aux_/openssl.hpp"
#include "test.hpp"
#include "test_utils.hpp"
@ -459,7 +460,7 @@ bool try_connect(lt::session& ses1, int port
{
std::string name = aux::to_hex(t->info_hash());
std::printf("SNI: %s\n", name.c_str());
SSL_set_tlsext_host_name(ssl_sock.native_handle(), name.c_str());
aux::openssl_set_tlsext_hostname(ssl_sock.native_handle(), name.c_str());
}
else if (flags & invalid_sni_hash)
{
@ -470,7 +471,7 @@ bool try_connect(lt::session& ses1, int port
name += hex_alphabet[rand() % 16];
std::printf("SNI: %s\n", name.c_str());
SSL_set_tlsext_host_name(ssl_sock.native_handle(), name.c_str());
aux::openssl_set_tlsext_hostname(ssl_sock.native_handle(), name.c_str());
}
std::printf("SSL handshake\n");