From e8db4fe67a4e43a3d5b705bca48fc71c0172cd64 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 20 Oct 2013 08:06:18 +0000 Subject: [PATCH] make test_torrent cheaper --- src/torrent.cpp | 2 +- test/test_torrent.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index c38f8b69c..7d8ce4781 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -1654,7 +1654,7 @@ namespace libtorrent } // in case file priorities were passed in via the add_torrent_params - // ans also in the case of share mode, we need to update the priorities + // and also in the case of share mode, we need to update the priorities update_piece_priorities(); std::vector const& web_seeds = m_torrent_file->web_seeds(); diff --git a/test/test_torrent.cpp b/test/test_torrent.cpp index 61ddfea28..b3b303beb 100644 --- a/test/test_torrent.cpp +++ b/test/test_torrent.cpp @@ -122,7 +122,7 @@ void test_running_torrent(boost::intrusive_ptr info, size_type fil std::auto_ptr al = ses.pop_alert(); assert(al.get()); std::cout << " " << al->message() << std::endl; - if (read_piece_alert* rpa = dynamic_cast(al.get())) + if (read_piece_alert* rpa = alert_cast(al.get())) { std::cout << "SUCCEEDED!" << std::endl; passed = true; @@ -145,14 +145,14 @@ int test_main() remove("test_torrent_dir2/tmp2"); remove("test_torrent_dir2/tmp3"); file_storage fs; - size_type file_size = 1 * 1024 * 1024 * 1024; + size_type file_size = 256 * 1024; 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); + libtorrent::create_torrent t(fs, 128 * 1024); t.add_tracker("http://non-existing.com/announce"); - std::vector piece(4 * 1024 * 1024); + std::vector piece(128 * 1024); for (int i = 0; i < int(piece.size()); ++i) piece[i] = (i % 26) + 'A'; @@ -177,7 +177,7 @@ int test_main() file_storage fs; fs.add_file("test_torrent_dir2/tmp1", 0); - libtorrent::create_torrent t(fs, 4 * 1024 * 1024); + libtorrent::create_torrent t(fs, 128 * 1024, 6); t.add_tracker("http://non-existing.com/announce"); std::vector tmp;