forked from premiere/premiere-libtorrent
move out test_alert_manager from the main test (as it actually sleeps). also add some debug logging to it
This commit is contained in:
parent
17c5759829
commit
68abd7a44d
|
@ -1,7 +1,7 @@
|
|||
language: cpp
|
||||
|
||||
os:
|
||||
# - linux
|
||||
- linux
|
||||
- osx
|
||||
|
||||
env:
|
||||
|
|
|
@ -110,7 +110,6 @@ test-suite libtorrent :
|
|||
test_bloom_filter.cpp
|
||||
test_identify_client.cpp
|
||||
test_merkle.cpp
|
||||
test_alert_manager.cpp
|
||||
test_resolve_links.cpp
|
||||
test_crc32.cpp
|
||||
test_heterogeneous_queue.cpp
|
||||
|
@ -150,6 +149,7 @@ test-suite libtorrent :
|
|||
test_linked_list.cpp
|
||||
test_file_progress.cpp ]
|
||||
|
||||
[ run test_alert_manager.cpp ]
|
||||
[ run test_direct_dht.cpp ]
|
||||
[ run test_magnet.cpp ]
|
||||
[ run test_storage.cpp ]
|
||||
|
|
|
@ -242,6 +242,8 @@ TORRENT_TEST(wait_for_alert)
|
|||
|
||||
time_point end = clock_type::now();
|
||||
TEST_EQUAL(a, static_cast<alert*>(0));
|
||||
fprintf(stderr, "delay: %d ms (expected 1 second)\n"
|
||||
, int(total_milliseconds(end - start)));
|
||||
TEST_CHECK(end - start > milliseconds(900));
|
||||
TEST_CHECK(end - start < milliseconds(1100));
|
||||
|
||||
|
@ -250,6 +252,8 @@ TORRENT_TEST(wait_for_alert)
|
|||
start = clock_type::now();
|
||||
a = mgr.wait_for_alert(seconds(1));
|
||||
end = clock_type::now();
|
||||
|
||||
fprintf(stderr, "delay: %d ms\n", int(total_milliseconds(end - start)));
|
||||
TEST_CHECK(end - start < milliseconds(1));
|
||||
TEST_CHECK(a->type() == torrent_added_alert::alert_type);
|
||||
|
||||
|
@ -262,6 +266,8 @@ TORRENT_TEST(wait_for_alert)
|
|||
|
||||
a = mgr.wait_for_alert(seconds(10));
|
||||
end = clock_type::now();
|
||||
|
||||
fprintf(stderr, "delay: %d ms\n", int(total_milliseconds(end - start)));
|
||||
TEST_CHECK(end - start < milliseconds(500));
|
||||
TEST_CHECK(a->type() == torrent_added_alert::alert_type);
|
||||
|
||||
|
|
Loading…
Reference in New Issue