From 68abd7a44deae718debbec0d4e59745f692329bf Mon Sep 17 00:00:00 2001 From: arvidn Date: Sat, 5 Sep 2015 22:07:02 -0400 Subject: [PATCH] move out test_alert_manager from the main test (as it actually sleeps). also add some debug logging to it --- .travis.yml | 2 +- test/Jamfile | 2 +- test/test_alert_manager.cpp | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3dbaaed0b..86f455de0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: cpp os: -# - linux + - linux - osx env: diff --git a/test/Jamfile b/test/Jamfile index 6f1f331ba..f831ab20a 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -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 ] diff --git a/test/test_alert_manager.cpp b/test/test_alert_manager.cpp index 75c1624a7..343233698 100644 --- a/test/test_alert_manager.cpp +++ b/test/test_alert_manager.cpp @@ -242,6 +242,8 @@ TORRENT_TEST(wait_for_alert) time_point end = clock_type::now(); TEST_EQUAL(a, static_cast(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);