fixed test_torrent_parse test

This commit is contained in:
Arvid Norberg 2013-03-05 00:32:57 +00:00
parent 0682272661
commit 83f626c18e
3 changed files with 5 additions and 5 deletions

View File

@ -964,10 +964,9 @@ namespace libtorrent
m_files.set_num_pieces(int((m_files.total_size() + m_files.piece_length() - 1)
/ m_files.piece_length()));
lazy_entry const* pieces = info.dict_find("pieces");
lazy_entry const* root_hash = info.dict_find("root hash");
if ((pieces == 0 || pieces->type() != lazy_entry::string_t)
&& (root_hash == 0 || root_hash->type() != lazy_entry::string_t))
lazy_entry const* pieces = info.dict_find_string("pieces");
lazy_entry const* root_hash = info.dict_find_string("root hash");
if (pieces == 0 && root_hash == 0)
{
ec = errors::torrent_missing_pieces;
return false;

View File

@ -95,7 +95,7 @@ test_failing_torrent_t test_error_torrents[] =
{ "invalid_pieces.torrent", errors::torrent_missing_pieces },
{ "unaligned_pieces.torrent", errors::torrent_invalid_hashes },
{ "invalid_root_hash.torrent", errors::torrent_invalid_hashes },
{ "invalid_root_hash2.torrent", errors::torrent_invalid_hashes },
{ "invalid_root_hash2.torrent", errors::torrent_missing_pieces},
{ "invalid_file_size.torrent", errors::torrent_file_parse_failed },
};

View File

@ -0,0 +1 @@
d10:created by10:libtorrent13:creation datei1359599503e4:infod6:lengthi425e4:name4:temp12:piece lengthi16384e9:root hashi1343eee