From 490ad37c43404b5dd681074ddaffd30b4167f4a4 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 30 Nov 2008 06:10:37 +0000 Subject: [PATCH] fixes to unit tests --- test/test_torrent.cpp | 8 ++++---- test/test_web_seed.cpp | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/test_torrent.cpp b/test/test_torrent.cpp index 25d6d387e..bcc1df407 100644 --- a/test/test_torrent.cpp +++ b/test/test_torrent.cpp @@ -56,9 +56,9 @@ int test_main() { file_storage fs; size_type file_size = 1 * 1024 * 1024 * 1024; - fs.add_file("test_torrent/tmp1", file_size); - fs.add_file("test_torrent/tmp2", file_size); - fs.add_file("test_torrent/tmp3", file_size); + fs.add_file("test_torrent_dir2/tmp1", file_size); + fs.add_file("test_torrent_dir2/tmp2", file_size); + fs.add_file("test_torrent_dir2/tmp3", file_size); libtorrent::create_torrent t(fs, 4 * 1024 * 1024); t.add_tracker("http://non-existing.com/announce"); @@ -83,7 +83,7 @@ int test_main() { file_storage fs; - fs.add_file("test_torrent/tmp1", 0); + fs.add_file("test_torrent_dir2/tmp1", 0); libtorrent::create_torrent t(fs, 4 * 1024 * 1024); t.add_tracker("http://non-existing.com/announce"); diff --git a/test/test_web_seed.cpp b/test/test_web_seed.cpp index 2620a1929..eaa8f180d 100644 --- a/test/test_web_seed.cpp +++ b/test/test_web_seed.cpp @@ -133,22 +133,22 @@ int test_main() using namespace boost::filesystem; try { - create_directory("test_torrent"); + create_directory("test_torrent_dir"); } catch (std::exception&) {} char random_data[300000]; std::srand(std::time(0)); std::generate(random_data, random_data + sizeof(random_data), &std::rand); - std::ofstream("./test_torrent/test1").write(random_data, 35); - std::ofstream("./test_torrent/test2").write(random_data, 16536 - 35); - std::ofstream("./test_torrent/test3").write(random_data, 16536); - std::ofstream("./test_torrent/test4").write(random_data, 17); - std::ofstream("./test_torrent/test5").write(random_data, 16536); - std::ofstream("./test_torrent/test6").write(random_data, 300000); - std::ofstream("./test_torrent/test7").write(random_data, 300000); + std::ofstream("./test_torrent_dir/test1").write(random_data, 35); + std::ofstream("./test_torrent_dir/test2").write(random_data, 16536 - 35); + std::ofstream("./test_torrent_dir/test3").write(random_data, 16536); + std::ofstream("./test_torrent_dir/test4").write(random_data, 17); + std::ofstream("./test_torrent_dir/test5").write(random_data, 16536); + std::ofstream("./test_torrent_dir/test6").write(random_data, 300000); + std::ofstream("./test_torrent_dir/test7").write(random_data, 300000); file_storage fs; - add_files(fs, path("test_torrent")); + add_files(fs, path("test_torrent_dir")); libtorrent::create_torrent t(fs, 16 * 1024); t.add_url_seed("http://127.0.0.1:8000/"); @@ -176,7 +176,7 @@ int test_main() test_transfer(torrent_file, i); stop_web_server(8000); - remove_all("./test_torrent"); + remove_all("./test_torrent_dir"); return 0; }