unittest polishing
This commit is contained in:
parent
bb72af6bbe
commit
e515dd5c25
@ -95,7 +95,7 @@ void test_swarm()
|
|||||||
boost::tie(tor1, tor2, tor3) = setup_transfer(&ses1, &ses2, &ses3, true, false, true, "_unchoke");
|
boost::tie(tor1, tor2, tor3) = setup_transfer(&ses1, &ses2, &ses3, true, false, true, "_unchoke");
|
||||||
|
|
||||||
session_status st = ses1.status();
|
session_status st = ses1.status();
|
||||||
TEST_CHECK(st.allowed_upload_slots == 1);
|
TEST_EQUAL(st.allowed_upload_slots, 1);
|
||||||
for (int i = 0; i < 100; ++i)
|
for (int i = 0; i < 100; ++i)
|
||||||
{
|
{
|
||||||
print_alerts(ses1, "ses1");
|
print_alerts(ses1, "ses1");
|
||||||
|
@ -106,7 +106,7 @@ void test_transfer(int flags
|
|||||||
TEST_CHECK(tor2.status().has_metadata);
|
TEST_CHECK(tor2.status().has_metadata);
|
||||||
std::cerr << "waiting for transfer to complete\n";
|
std::cerr << "waiting for transfer to complete\n";
|
||||||
|
|
||||||
for (int i = 0; i < 20; ++i)
|
for (int i = 0; i < timeout * 10; ++i)
|
||||||
{
|
{
|
||||||
torrent_status st1 = tor1.status();
|
torrent_status st1 = tor1.status();
|
||||||
torrent_status st2 = tor2.status();
|
torrent_status st2 = tor2.status();
|
||||||
@ -137,11 +137,18 @@ int test_main()
|
|||||||
{
|
{
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
for (int f = 0; f <= (clear_files | disconnect | full_encryption); ++f)
|
#ifdef TORRENT_USE_VALGRIND
|
||||||
test_transfer(f, &create_metadata_plugin, 5);
|
const int timeout = 8;
|
||||||
|
#else
|
||||||
|
const int timeout = 3;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (int f = 0; f <= (clear_files | disconnect | full_encryption); ++f)
|
for (int f = 0; f <= (clear_files | disconnect | full_encryption); ++f)
|
||||||
test_transfer(f, &create_ut_metadata_plugin, 2);
|
test_transfer(f, &create_metadata_plugin, timeout * 2);
|
||||||
|
|
||||||
|
|
||||||
|
for (int f = 0; f <= (clear_files | disconnect | full_encryption); ++f)
|
||||||
|
test_transfer(f, &create_ut_metadata_plugin, timeout);
|
||||||
|
|
||||||
error_code ec;
|
error_code ec;
|
||||||
remove_all("tmp1", ec);
|
remove_all("tmp1", ec);
|
||||||
|
@ -285,12 +285,12 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
|
|||||||
|
|
||||||
for (int i = 0; i < 200; ++i)
|
for (int i = 0; i < 200; ++i)
|
||||||
{
|
{
|
||||||
print_alerts(ses1, "ses1", true, true, true, &on_alert);
|
|
||||||
print_alerts(ses2, "ses2", true, true, true, &on_alert);
|
|
||||||
|
|
||||||
torrent_status st1 = tor1.status();
|
torrent_status st1 = tor1.status();
|
||||||
torrent_status st2 = tor2.status();
|
torrent_status st2 = tor2.status();
|
||||||
|
|
||||||
|
print_alerts(ses1, "ses1", true, true, true, &on_alert);
|
||||||
|
print_alerts(ses2, "ses2", true, true, true, &on_alert);
|
||||||
|
|
||||||
if (i % 10 == 0)
|
if (i % 10 == 0)
|
||||||
{
|
{
|
||||||
print_ses_rate(i / 10.f, &st1, &st2);
|
print_ses_rate(i / 10.f, &st1, &st2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user