some asserts

This commit is contained in:
Arvid Norberg 2006-12-15 12:29:47 +00:00
parent 79ebcf5dd8
commit c567d06406
1 changed files with 8 additions and 0 deletions

View File

@ -718,6 +718,7 @@ namespace libtorrent
}
assert(total_done < m_torrent_file.total_size());
assert(wanted_done < m_torrent_file.total_size());
const std::vector<piece_picker::downloading_piece>& dl_queue
= m_picker->get_download_queue();
@ -757,6 +758,9 @@ namespace libtorrent
wanted_done += corr;
}
assert(total_done < m_torrent_file.total_size());
assert(wanted_done < m_torrent_file.total_size());
std::map<piece_block, int> downloading_piece;
for (const_peer_iterator i = begin(); i != end(); ++i)
{
@ -793,6 +797,10 @@ namespace libtorrent
if (!m_picker->is_filtered(i->first.piece_index))
wanted_done += i->second;
}
assert(total_done < m_torrent_file.total_size());
assert(wanted_done < m_torrent_file.total_size());
assert(total_done >= wanted_done);
return make_tuple(total_done, wanted_done);
}