diff --git a/bindings/python/src/bytes.hpp b/bindings/python/src/bytes.hpp index 02943b92a..8949bfe05 100644 --- a/bindings/python/src/bytes.hpp +++ b/bindings/python/src/bytes.hpp @@ -11,15 +11,12 @@ struct bytes { bytes(char const* s, int len): arr(s, len) {} bytes(std::string const& s): arr(s) {} -#if __cplusplus >= 201103L bytes(std::string&& s): arr(std::move(s)) {} bytes(bytes const&) = default; bytes(bytes&&) = default; bytes& operator=(bytes&&) = default; -#endif bytes() {} std::string arr; }; #endif - diff --git a/include/libtorrent/announce_entry.hpp b/include/libtorrent/announce_entry.hpp index 4aef87aa9..e3a920674 100644 --- a/include/libtorrent/announce_entry.hpp +++ b/include/libtorrent/announce_entry.hpp @@ -54,10 +54,8 @@ namespace libtorrent announce_entry(std::string const& u); announce_entry(); ~announce_entry(); -#if __cplusplus >= 201103L announce_entry(announce_entry const&) = default; announce_entry& operator=(announce_entry const&) = default; -#endif // tracker URL as it appeared in the torrent file std::string url; @@ -195,4 +193,3 @@ namespace libtorrent } #endif - diff --git a/include/libtorrent/block_cache.hpp b/include/libtorrent/block_cache.hpp index 81d3644d0..a6ec108fd 100644 --- a/include/libtorrent/block_cache.hpp +++ b/include/libtorrent/block_cache.hpp @@ -172,10 +172,8 @@ namespace libtorrent { cached_piece_entry(); ~cached_piece_entry(); -#if __cplusplus >= 201103L cached_piece_entry(cached_piece_entry const&) = default; cached_piece_entry& operator=(cached_piece_entry const&) = default; -#endif bool ok_to_evict(bool ignore_hash = false) const { @@ -545,4 +543,3 @@ namespace libtorrent } #endif // TORRENT_BLOCK_CACHE - diff --git a/include/libtorrent/entry.hpp b/include/libtorrent/entry.hpp index 810f61208..3755646a9 100644 --- a/include/libtorrent/entry.hpp +++ b/include/libtorrent/entry.hpp @@ -117,7 +117,7 @@ namespace libtorrent // newly constructed entry entry(dictionary_type); entry(span); - template ::value || std::is_same::value>::type> entry(U v) @@ -161,7 +161,7 @@ namespace libtorrent entry& operator=(entry&&); entry& operator=(dictionary_type); entry& operator=(span); - template ::value || std::is_same::value>::type> entry& operator=(U v) diff --git a/include/libtorrent/file_storage.hpp b/include/libtorrent/file_storage.hpp index 0d6ed274b..0942ce883 100644 --- a/include/libtorrent/file_storage.hpp +++ b/include/libtorrent/file_storage.hpp @@ -56,10 +56,8 @@ namespace libtorrent file_entry(); // hidden ~file_entry(); -#if __cplusplus >= 201103L file_entry(file_entry const&) = default; file_entry& operator=(file_entry const&) = default; -#endif // the full path of this file. The paths are unicode strings // encoded in UTF-8. @@ -648,4 +646,3 @@ namespace libtorrent } #endif // TORRENT_FILE_STORAGE_HPP_INCLUDED - diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index c9702ce7d..d72685d8c 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -142,9 +142,7 @@ namespace libtorrent struct has_block { -#if __cplusplus >= 201103L has_block(has_block const&) = default; -#endif has_block(piece_block const& b): block(b) {} piece_block const& block; diff --git a/include/libtorrent/session_settings.hpp b/include/libtorrent/session_settings.hpp index e5e194b2a..305b4dc7d 100644 --- a/include/libtorrent/session_settings.hpp +++ b/include/libtorrent/session_settings.hpp @@ -59,10 +59,8 @@ namespace libtorrent session_settings(std::string const& user_agent = "libtorrent/" LIBTORRENT_VERSION); ~session_settings(); -#if __cplusplus >= 201103L session_settings(session_settings const&) = default; session_settings& operator=(session_settings const&) = default; -#endif // automatically set to the libtorrent version you're using in order to // be forward binary compatible. This field should not be changed. diff --git a/include/libtorrent/span.hpp b/include/libtorrent/span.hpp index 058d6fdc9..f3fcef97b 100644 --- a/include/libtorrent/span.hpp +++ b/include/libtorrent/span.hpp @@ -78,7 +78,7 @@ namespace libtorrent reverse_iterator rend() const { return reverse_iterator(begin()); } T& front() const { TORRENT_ASSERT(m_len > 0); return m_ptr[0]; } - T& back() const { TORRENT_ASSERT(m_len > 0); return m_ptr[m_len-1]; } + T& back() const { TORRENT_ASSERT(m_len > 0); return m_ptr[m_len - 1]; } span first(size_t const n) const { diff --git a/include/libtorrent/torrent_status.hpp b/include/libtorrent/torrent_status.hpp index 542615034..5e7f32a92 100644 --- a/include/libtorrent/torrent_status.hpp +++ b/include/libtorrent/torrent_status.hpp @@ -53,10 +53,8 @@ namespace libtorrent // hidden torrent_status(); ~torrent_status(); -#if __cplusplus >= 201103L torrent_status(torrent_status const&) = default; torrent_status& operator=(torrent_status const&) = default; -#endif // compares if the torrent status objects come from the same torrent. i.e. // only the torrent_handle field is compared. @@ -518,5 +516,4 @@ namespace libtorrent } -#endif - +#endif // TORRENT_TORRENT_STATUS_HPP_INCLUDED diff --git a/include/libtorrent/upnp.hpp b/include/libtorrent/upnp.hpp index 923825dba..1261b5fbd 100644 --- a/include/libtorrent/upnp.hpp +++ b/include/libtorrent/upnp.hpp @@ -296,10 +296,8 @@ private: TORRENT_ASSERT(magic == 1337); magic = 0; } -#if __cplusplus >= 201103L rootdevice(rootdevice const&) = default; rootdevice& operator=(rootdevice const&) = default; -#endif #endif // the interface url, through which the list of @@ -418,4 +416,3 @@ namespace boost { namespace system { } } #endif - diff --git a/simulation/test_trackers_extension.cpp b/simulation/test_trackers_extension.cpp deleted file mode 100644 index 0e639d989..000000000 --- a/simulation/test_trackers_extension.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - -Copyright (c) 2008-2015, Arvid Norberg -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the distribution. - * Neither the name of the author nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -#include "test.hpp" - -#ifndef TORRENT_NO_DEPRECATE - -#include "setup_swarm.hpp" -#include "libtorrent/alert.hpp" -#include "libtorrent/announce_entry.hpp" -#include "libtorrent/settings_pack.hpp" -#include "libtorrent/add_torrent_params.hpp" -#include "libtorrent/alert_types.hpp" -#include "libtorrent/extensions/lt_trackers.hpp" -#include "libtorrent/session.hpp" -#include "settings.hpp" - -using namespace libtorrent; - -TORRENT_TEST(plain) -{ - dsl_config network_cfg; - sim::simulation sim{network_cfg}; - - settings_pack pack = settings(); - - add_torrent_params p; - p.flags &= ~lt::add_torrent_params::flag_paused; - p.flags &= ~lt::add_torrent_params::flag_auto_managed; - - // the default torrent has one tracker - // we remove this from session 0 (the one under test) - p.trackers.push_back("http://test.non-existent.com/announce"); - - bool connected = false; - - setup_swarm(2, swarm_test::upload - , sim , pack, p - // init session - , [](lt::session& ses) { - ses.add_extension(&create_lt_trackers_plugin); - } - // add session - , [](lt::settings_pack& pack) {} - // add torrent - , [](lt::add_torrent_params& params) { - - // make sure neither peer has any content - // TODO: it would be more efficient to not create the content in the first - // place - params.save_path = save_path(test_counter(), 1); - - // the test is whether this peer will receive the tracker or not - params.trackers.clear(); - } - // on alert - , [&](lt::alert const* a, lt::session& ses) { - if (alert_cast(a)) - connected = true; - } - // terminate - , [&](int ticks, lt::session& ses) -> bool { - if (ticks > 10) - { - TEST_ERROR("timeout"); - return true; - } - return connected && ses.get_torrents()[0].trackers().size() > 0; - }); - - TEST_EQUAL(connected, true); -} - -TORRENT_TEST(no_metadata) -{ - dsl_config network_cfg; - sim::simulation sim{network_cfg}; - - settings_pack pack = settings(); - - add_torrent_params p; - p.flags &= ~lt::add_torrent_params::flag_paused; - p.flags &= ~lt::add_torrent_params::flag_auto_managed; - - // the default torrent has one tracker - // we remove this from session 0 (the one under test) - p.trackers.push_back("http://test.non-existent.com/announce"); - - bool connected = false; - - setup_swarm(2, swarm_test::upload - , sim , pack, p - // init session - , [](lt::session& ses) { - ses.add_extension(&create_lt_trackers_plugin); - } - // add session - , [](lt::settings_pack& pack) {} - // add torrent - , [](lt::add_torrent_params& params) { - - // make sure neither peer has any content - // TODO: it would be more efficient to not create the content in the first - // place - params.save_path = save_path(test_counter(), 1); - - // the test is whether this peer will receive the tracker or not - params.trackers.clear(); - - // if we don't have metadata, the other peer should not send the - // tracker to us - params.info_hash = sha1_hash("aaaaaaaaaaaaaaaaaaaa"); - params.ti.reset(); - } - // on alert - , [&](lt::alert const* a, lt::session& ses) { - if (alert_cast(a)) - connected = true; - } - // terminate - , [](int ticks, lt::session& ses) -> bool { - if (ticks < 10) - return false; - TEST_EQUAL(ses.get_torrents()[0].trackers().size(), 0); - return true; - }); - - TEST_EQUAL(connected, true); -} -#else -TORRENT_TEST(dummy) {} -#endif - diff --git a/test/test_heterogeneous_queue.cpp b/test/test_heterogeneous_queue.cpp index cb1d14e4c..6eebc80b1 100644 --- a/test/test_heterogeneous_queue.cpp +++ b/test/test_heterogeneous_queue.cpp @@ -96,7 +96,6 @@ struct F TEST_EQUAL(f_.gutted, false); } -#if __cplusplus >= 201103L F(F&& f_) : self(this) , f(f_.f) @@ -109,7 +108,6 @@ struct F TEST_EQUAL(f_.gutted, false); f_.gutted = true; } -#endif ~F() { @@ -296,5 +294,3 @@ TORRENT_TEST(nontrivial) q.emplace_back("testing to allocate non-trivial objects"); } } - -