diff --git a/test/dht_server.cpp b/test/dht_server.cpp index 49f9ad41e..07cb8efdd 100644 --- a/test/dht_server.cpp +++ b/test/dht_server.cpp @@ -172,8 +172,6 @@ int num_dht_hits() void stop_dht() { - fprintf(stderr, "%s: stop_dht()\n", time_now_string()); g_dht.reset(); - fprintf(stderr, "%s: stop_dht() done\n", time_now_string()); } diff --git a/test/main.cpp b/test/main.cpp index 44d008ceb..ff1da30e0 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -263,11 +263,11 @@ int main(int argc, char const* argv[]) if (!tests_to_run.empty()) { - fprintf(stderr, "UNKONWN tests:\n"); + fprintf(stderr, "\x1b[1mUNKONWN tests:\x1b[0m\n"); for (std::set::iterator i = tests_to_run.begin() , end(tests_to_run.end()); i != end; ++i) { - fprintf(stderr, "%s\n", i->c_str()); + fprintf(stderr, " %s\n", i->c_str()); } } diff --git a/test/peer_server.cpp b/test/peer_server.cpp index 939640e50..2531c52d0 100644 --- a/test/peer_server.cpp +++ b/test/peer_server.cpp @@ -160,8 +160,6 @@ int num_peer_hits() void stop_peer() { - fprintf(stderr, "%s: PEER stop_peer()\n", time_now_string()); g_peer.reset(); - fprintf(stderr, "%s: PEER stop_peer() done\n", time_now_string()); } diff --git a/test/test_file.cpp b/test/test_file.cpp index 5be90ca05..69e99ac77 100644 --- a/test/test_file.cpp +++ b/test/test_file.cpp @@ -59,7 +59,7 @@ int touch_file(std::string const& filename, int size) return 0; } -void test_create_directory() +TORRENT_TEST(create_directory) { error_code ec; create_directory("__foobar__", ec); @@ -75,7 +75,7 @@ void test_create_directory() TEST_CHECK(!ec); } -void test_stat() +TORRENT_TEST(file_status) { error_code ec; @@ -103,11 +103,8 @@ void test_stat() TEST_CHECK(diff >= 2 && diff <= 4); } -TORRENT_TEST(file) +TORRENT_TEST(directory) { - test_create_directory(); - test_stat(); - error_code ec; create_directory("file_test_dir", ec); @@ -150,8 +147,11 @@ TORRENT_TEST(file) if (ec) fprintf(stderr, "remove_all: %s\n", ec.message().c_str()); remove_all("file_test_dir2", ec); if (ec) fprintf(stderr, "remove_all: %s\n", ec.message().c_str()); +} - // test path functions +// test path functions +TORRENT_TEST(paths) +{ TEST_EQUAL(combine_path("test1/", "test2"), "test1/test2"); TEST_EQUAL(combine_path("test1", "."), "test1"); TEST_EQUAL(combine_path(".", "test1"), "test1"); @@ -242,9 +242,11 @@ TORRENT_TEST(file) #endif TEST_EQUAL(complete("."), current_working_directory()); +} - // test split_string - +// test split_string +TORRENT_TEST(split_string) +{ char const* tags[10]; char tags_str[] = " this is\ta test\t string\x01to be split and it cannot " "extend over the limit of elements \t"; @@ -274,11 +276,13 @@ TORRENT_TEST(file) test = "1.2.3/_"; replace_extension(test, "txt"); TEST_EQUAL(test, "1.2.3/_.txt"); +} - - // file class +// file class +TORRENT_TEST(file) +{ + error_code ec; file f; - ec.clear(); #if TORRENT_USE_UNC_PATHS || !defined WIN32 TEST_CHECK(f.open("con", file::read_write, ec)); #else @@ -302,7 +306,5 @@ TORRENT_TEST(file) TEST_CHECK(!ec); TEST_CHECK(strcmp(test_buf, "test") == 0); f.close(); - - return 0; } diff --git a/test/udp_tracker.cpp b/test/udp_tracker.cpp index 598c5cd8a..528c0a637 100644 --- a/test/udp_tracker.cpp +++ b/test/udp_tracker.cpp @@ -224,8 +224,6 @@ int num_udp_announces() void stop_udp_tracker() { - fprintf(stderr, "%s: UDP stop_udp_tracker()\n", time_now_string()); g_udp_tracker.reset(); - fprintf(stderr, "%s: UDP stop_udp_tracker() done\n", time_now_string()); }