forked from premiere/premiere-libtorrent
less printouts in test_transfer
This commit is contained in:
parent
21cbd1fac4
commit
6bb688f699
|
@ -82,7 +82,7 @@ void test_rate()
|
||||||
|
|
||||||
ptime start = time_now();
|
ptime start = time_now();
|
||||||
|
|
||||||
for (int i = 0; i < 7; ++i)
|
for (int i = 0; i < 70; ++i)
|
||||||
{
|
{
|
||||||
print_alerts(ses1, "ses1");
|
print_alerts(ses1, "ses1");
|
||||||
print_alerts(ses2, "ses2");
|
print_alerts(ses2, "ses2");
|
||||||
|
@ -90,14 +90,17 @@ void test_rate()
|
||||||
torrent_status st1 = tor1.status();
|
torrent_status st1 = tor1.status();
|
||||||
torrent_status st2 = tor2.status();
|
torrent_status st2 = tor2.status();
|
||||||
|
|
||||||
|
if (i % 10 == 0)
|
||||||
|
{
|
||||||
std::cerr
|
std::cerr
|
||||||
<< "up: \033[33m" << st1.upload_payload_rate / 1000000.f << "MB/s "
|
<< "up: \033[33m" << st1.upload_payload_rate / 1000000.f << "MB/s "
|
||||||
<< " down: \033[32m" << st2.download_payload_rate / 1000000.f << "MB/s "
|
<< " down: \033[32m" << st2.download_payload_rate / 1000000.f << "MB/s "
|
||||||
<< "\033[0m" << int(st2.progress * 100) << "% "
|
<< "\033[0m" << int(st2.progress * 100) << "% "
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
if (tor2.is_seed()) break;
|
if (tor2.is_seed()) break;
|
||||||
test_sleep(1000);
|
test_sleep(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CHECK(tor2.is_seed());
|
TEST_CHECK(tor2.is_seed());
|
||||||
|
@ -342,6 +345,8 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
|
||||||
torrent_status st1 = tor1.status();
|
torrent_status st1 = tor1.status();
|
||||||
torrent_status st2 = tor2.status();
|
torrent_status st2 = tor2.status();
|
||||||
|
|
||||||
|
if (i % 10 == 0)
|
||||||
|
{
|
||||||
std::cerr
|
std::cerr
|
||||||
<< "\033[32m" << int(st1.download_payload_rate / 1000.f) << "kB/s "
|
<< "\033[32m" << int(st1.download_payload_rate / 1000.f) << "kB/s "
|
||||||
<< "\033[33m" << int(st1.upload_payload_rate / 1000.f) << "kB/s "
|
<< "\033[33m" << int(st1.upload_payload_rate / 1000.f) << "kB/s "
|
||||||
|
@ -354,6 +359,7 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
|
||||||
<< st2.num_peers
|
<< st2.num_peers
|
||||||
<< " cc: " << st2.connect_candidates
|
<< " cc: " << st2.connect_candidates
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
if (!test_move_storage && st2.progress > 0.25f)
|
if (!test_move_storage && st2.progress > 0.25f)
|
||||||
{
|
{
|
||||||
|
@ -397,6 +403,7 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
|
||||||
test_sleep(100);
|
test_sleep(100);
|
||||||
print_alerts(ses2, "ses2");
|
print_alerts(ses2, "ses2");
|
||||||
torrent_status st2 = tor2.status();
|
torrent_status st2 = tor2.status();
|
||||||
|
if (i % 10 == 0)
|
||||||
std::cerr << "\033[0m" << int(st2.progress * 100) << "% " << std::endl;
|
std::cerr << "\033[0m" << int(st2.progress * 100) << "% " << std::endl;
|
||||||
if (st2.state != torrent_status::checking_files) break;
|
if (st2.state != torrent_status::checking_files) break;
|
||||||
}
|
}
|
||||||
|
@ -408,7 +415,7 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
|
||||||
{
|
{
|
||||||
print_alerts(ses2, "ses2");
|
print_alerts(ses2, "ses2");
|
||||||
torrent_status st2 = tor2.status();
|
torrent_status st2 = tor2.status();
|
||||||
std::cerr << "\033[0m" << int(st2.progress * 100) << "% " << std::endl;
|
// std::cerr << "\033[0m" << int(st2.progress * 100) << "% " << std::endl;
|
||||||
TEST_CHECK(st2.state == torrent_status::finished);
|
TEST_CHECK(st2.state == torrent_status::finished);
|
||||||
test_sleep(100);
|
test_sleep(100);
|
||||||
}
|
}
|
||||||
|
@ -507,6 +514,8 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
|
||||||
torrent_status st1 = tor1.status();
|
torrent_status st1 = tor1.status();
|
||||||
torrent_status st2 = tor2.status();
|
torrent_status st2 = tor2.status();
|
||||||
|
|
||||||
|
if (i % 10 == 0)
|
||||||
|
{
|
||||||
std::cerr
|
std::cerr
|
||||||
<< "\033[32m" << int(st1.download_payload_rate / 1000.f) << "kB/s "
|
<< "\033[32m" << int(st1.download_payload_rate / 1000.f) << "kB/s "
|
||||||
<< "\033[33m" << int(st1.upload_payload_rate / 1000.f) << "kB/s "
|
<< "\033[33m" << int(st1.upload_payload_rate / 1000.f) << "kB/s "
|
||||||
|
@ -519,6 +528,7 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
|
||||||
<< st2.num_peers
|
<< st2.num_peers
|
||||||
<< " cc: " << st2.connect_candidates
|
<< " cc: " << st2.connect_candidates
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
if (tor2.is_finished()) break;
|
if (tor2.is_finished()) break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue