added test for replace_trackers and removed incorrect assert

This commit is contained in:
Arvid Norberg 2007-11-15 10:11:39 +00:00
parent 95d09070fb
commit bab4695028
2 changed files with 3 additions and 1 deletions

View File

@ -1406,7 +1406,6 @@ namespace libtorrent
void torrent::replace_trackers(std::vector<announce_entry> const& urls)
{
TORRENT_ASSERT(!urls.empty());
m_trackers = urls;
if (m_currently_trying_tracker >= (int)m_trackers.size())
m_currently_trying_tracker = (int)m_trackers.size()-1;

View File

@ -69,6 +69,9 @@ void test_transfer()
remove_all("./tmp1");
torrent_handle th = ses.add_torrent(torrent_file, "./tmp1");
std::vector<announce_entry> empty;
th.replace_trackers(empty);
for (int i = 0; i < 30; ++i)
{
torrent_status s = th.status();