diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index cdad6a7b9..7dbef4381 100755 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -1822,8 +1822,6 @@ namespace libtorrent } } - m_statistics.second_tick(tick_interval); - // If the client sends more data // we send it data faster, otherwise, slower. // It will also depend on how much data the diff --git a/test/Jamfile b/test/Jamfile index 6568ce48c..6d20ad236 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -3,16 +3,23 @@ use-project /torrent : .. ; exe test_upnp : test_upnp.cpp /torrent//torrent : static multi verbose on ; -project - : requirements +lib test_common + : + main.cpp + setup_transfer.cpp + : + static + : multi /torrent//torrent - main.cpp - setup_transfer.cpp - : default-build - static + ; + +project + : requirements + test_common ; + test-suite libtorrent : [ run test_buffer.cpp ] [ run test_storage.cpp ] diff --git a/test/setup_transfer.cpp b/test/setup_transfer.cpp index 47d2e5d07..fc1cd0236 100644 --- a/test/setup_transfer.cpp +++ b/test/setup_transfer.cpp @@ -15,7 +15,6 @@ void test_sleep(int millisec) { boost::xtime xt; boost::xtime_get(&xt, boost::TIME_UTC); - xt.nsec += millisec * 1000000; boost::uint64_t nanosec = (millisec % 1000) * 1000000 + xt.nsec; int sec = millisec / 1000; if (nanosec > 1000000000) diff --git a/test/test_swarm.cpp b/test/test_swarm.cpp index b94ec2e60..5c0969431 100644 --- a/test/test_swarm.cpp +++ b/test/test_swarm.cpp @@ -22,7 +22,7 @@ void test_swarm() // immediately. To make the swarm actually connect all // three peers before finishing. float rate_limit = 40000; - ses1.set_upload_rate_limit(int(rate_limit * 1.1)); + ses1.set_upload_rate_limit(int(rate_limit)); ses2.set_download_rate_limit(int(rate_limit)); ses3.set_download_rate_limit(int(rate_limit)); ses2.set_upload_rate_limit(int(rate_limit / 2)); @@ -54,7 +54,7 @@ void test_swarm() int count_dl_rates2 = 0; int count_dl_rates3 = 0; - for (int i = 0; i < 35; ++i) + for (int i = 0; i < 60; ++i) { std::auto_ptr a; a = ses1.pop_alert(); @@ -107,8 +107,8 @@ void test_swarm() std::cerr << "average rate: " << (average2 / 1000.f) << "kB/s - " << (average3 / 1000.f) << "kB/s" << std::endl; -// TEST_CHECK(std::fabs(average2 - float(rate_limit)) < 5000.f); -// TEST_CHECK(std::fabs(average3 - float(rate_limit)) < 5000.f); + TEST_CHECK(std::fabs(average2 - float(rate_limit)) < 3000.f); + TEST_CHECK(std::fabs(average3 - float(rate_limit)) < 3000.f); if (tor2.is_seed() && tor3.is_seed()) std::cerr << "done\n"; }