forked from premiere/premiere-libtorrent
fixed tests on windows and when built with iterator debugging
This commit is contained in:
parent
b663ab81a6
commit
0d8f74cf78
|
@ -295,10 +295,10 @@ void test_check_files(path const& test_path
|
||||||
create_directory(test_path / "temp_storage");
|
create_directory(test_path / "temp_storage");
|
||||||
|
|
||||||
std::ofstream f;
|
std::ofstream f;
|
||||||
f.open((test_path / "temp_storage/test1.tmp").string().c_str());
|
f.open((test_path / "temp_storage/test1.tmp").string().c_str(), std::ios::trunc | std::ios::binary);
|
||||||
f.write(piece0, sizeof(piece0));
|
f.write(piece0, sizeof(piece0));
|
||||||
f.close();
|
f.close();
|
||||||
f.open((test_path / "temp_storage/test3.tmp").string().c_str());
|
f.open((test_path / "temp_storage/test3.tmp").string().c_str(), std::ios::trunc | std::ios::binary);
|
||||||
f.write(piece2, sizeof(piece2));
|
f.write(piece2, sizeof(piece2));
|
||||||
f.close();
|
f.close();
|
||||||
|
|
||||||
|
|
|
@ -65,12 +65,12 @@ void test_rate()
|
||||||
boost::tie(tor1, tor2, ignore) = setup_transfer(&ses1, &ses2, 0
|
boost::tie(tor1, tor2, ignore) = setup_transfer(&ses1, &ses2, 0
|
||||||
, true, false, true, "_transfer", 0, &t);
|
, true, false, true, "_transfer", 0, &t);
|
||||||
|
|
||||||
ses1.set_alert_mask(alert::all_categories & ~alert::progress_notification);
|
ses1.set_alert_mask(alert::all_categories & ~(alert::progress_notification | alert::performance_warning));
|
||||||
ses2.set_alert_mask(alert::all_categories & ~alert::progress_notification);
|
ses2.set_alert_mask(alert::all_categories & ~(alert::progress_notification | alert::performance_warning));
|
||||||
|
|
||||||
ptime start = time_now();
|
ptime start = time_now();
|
||||||
|
|
||||||
for (int i = 0; i < 40; ++i)
|
for (int i = 0; i < 70; ++i)
|
||||||
{
|
{
|
||||||
print_alerts(ses1, "ses1");
|
print_alerts(ses1, "ses1");
|
||||||
print_alerts(ses2, "ses2");
|
print_alerts(ses2, "ses2");
|
||||||
|
@ -157,7 +157,8 @@ void test_transfer()
|
||||||
|
|
||||||
if (tor2.is_finished()) break;
|
if (tor2.is_finished()) break;
|
||||||
|
|
||||||
TEST_CHECK(st1.state == torrent_status::seeding);
|
TEST_CHECK(st1.state == torrent_status::seeding
|
||||||
|
|| st1.state == torrent_status::checking_files);
|
||||||
TEST_CHECK(st2.state == torrent_status::downloading);
|
TEST_CHECK(st2.state == torrent_status::downloading);
|
||||||
|
|
||||||
test_sleep(1000);
|
test_sleep(1000);
|
||||||
|
|
Loading…
Reference in New Issue