diff --git a/test/swarm_suite.cpp b/test/swarm_suite.cpp index eb7dcdf22..2f3efd19a 100644 --- a/test/swarm_suite.cpp +++ b/test/swarm_suite.cpp @@ -36,6 +36,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/alert_types.hpp" #include "libtorrent/thread.hpp" #include "libtorrent/time.hpp" +#include "libtorrent/random.hpp" #include #include "test.hpp" @@ -102,8 +103,11 @@ void test_swarm(int flags) // three peers before finishing. float rate_limit = 100000; + int port = lt::random() % 100; + char iface[50]; + snprintf(iface, sizeof(iface), "0.0.0.0:480%02d", port); pack.set_int(settings_pack::upload_rate_limit, rate_limit); - pack.set_str(settings_pack::listen_interfaces, "0.0.0.0:48000"); + pack.set_str(settings_pack::listen_interfaces, iface); pack.set_int(settings_pack::max_retry_port_bind, 1000); pack.set_int(settings_pack::out_enc_policy, settings_pack::pe_forced); @@ -111,12 +115,14 @@ void test_swarm(int flags) lt::session ses1(pack); - pack.set_str(settings_pack::listen_interfaces, "0.0.0.0:49000"); + snprintf(iface, sizeof(iface), "0.0.0.0:490%02d", port); + pack.set_str(settings_pack::listen_interfaces, iface); pack.set_int(settings_pack::download_rate_limit, rate_limit / 2); pack.set_int(settings_pack::upload_rate_limit, rate_limit); lt::session ses2(pack); - pack.set_str(settings_pack::listen_interfaces, "0.0.0.0:50000"); + snprintf(iface, sizeof(iface), "0.0.0.0:500%02d", port); + pack.set_str(settings_pack::listen_interfaces, iface); lt::session ses3(pack); torrent_handle tor1; diff --git a/test/test_utp.cpp b/test/test_utp.cpp index 23e416c08..df2141a2b 100644 --- a/test/test_utp.cpp +++ b/test/test_utp.cpp @@ -63,7 +63,17 @@ void test_transfer() session_proxy p1; session_proxy p2; + const int mask = alert::all_categories + & ~(alert::progress_notification + | alert::performance_warning + | alert::stats_notification); + settings_pack pack; + pack.set_bool(settings_pack::enable_lsd, false); + pack.set_bool(settings_pack::enable_natpmp, false); + pack.set_bool(settings_pack::enable_upnp, false); + pack.set_bool(settings_pack::enable_dht, false); + pack.set_int(settings_pack::alert_mask, mask); pack.set_int(settings_pack::out_enc_policy, settings_pack::pe_disabled); pack.set_int(settings_pack::in_enc_policy, settings_pack::pe_disabled); pack.set_bool(settings_pack::enable_outgoing_tcp, false); @@ -98,9 +108,9 @@ void test_transfer() , true, false, true, "_utp", 0, &t, false, &atp); #ifdef TORRENT_USE_VALGRIND - const int timeout = 12; + const int timeout = 16; #else - const int timeout = 6; + const int timeout = 8; #endif for (int i = 0; i < timeout; ++i)