diff --git a/Makefile b/Makefile index 90be6e8d8..2fbf67f20 100644 --- a/Makefile +++ b/Makefile @@ -959,6 +959,11 @@ TEST_TORRENTS = \ empty_httpseed.torrent \ empty_path.torrent \ empty_path_multi.torrent \ + empty-files-1.torrent \ + empty-files-2.torrent \ + empty-files-3.torrent \ + empty-files-4.torrent \ + empty-files-5.torrent \ hidden_parent_path.torrent \ httpseed.torrent \ invalid_file_size.torrent \ diff --git a/test/test_torrent_info.cpp b/test/test_torrent_info.cpp index ea8b04290..7a3b4f068 100644 --- a/test/test_torrent_info.cpp +++ b/test/test_torrent_info.cpp @@ -335,6 +335,31 @@ static test_torrent_t const test_torrents[] = TEST_CHECK(ti->info_hashes().has_v2()); } }, + { "empty-files-1.torrent", [](torrent_info const* ti) { + TEST_CHECK(ti->info_hashes().has_v1()); + TEST_CHECK(ti->info_hashes().has_v2()); + } + }, + { "empty-files-2.torrent", [](torrent_info const* ti) { + TEST_CHECK(ti->info_hashes().has_v1()); + TEST_CHECK(ti->info_hashes().has_v2()); + } + }, + { "empty-files-3.torrent", [](torrent_info const* ti) { + TEST_CHECK(ti->info_hashes().has_v1()); + TEST_CHECK(ti->info_hashes().has_v2()); + } + }, + { "empty-files-4.torrent", [](torrent_info const* ti) { + TEST_CHECK(ti->info_hashes().has_v1()); + TEST_CHECK(ti->info_hashes().has_v2()); + } + }, + { "empty-files-5.torrent", [](torrent_info const* ti) { + TEST_CHECK(ti->info_hashes().has_v1()); + TEST_CHECK(ti->info_hashes().has_v2()); + } + }, }; struct test_failing_torrent_t diff --git a/test/test_torrents/empty-files-1.torrent b/test/test_torrents/empty-files-1.torrent new file mode 100644 index 000000000..e1317390e Binary files /dev/null and b/test/test_torrents/empty-files-1.torrent differ diff --git a/test/test_torrents/empty-files-2.torrent b/test/test_torrents/empty-files-2.torrent new file mode 100644 index 000000000..8b24dc986 Binary files /dev/null and b/test/test_torrents/empty-files-2.torrent differ diff --git a/test/test_torrents/empty-files-3.torrent b/test/test_torrents/empty-files-3.torrent new file mode 100644 index 000000000..a7a946867 Binary files /dev/null and b/test/test_torrents/empty-files-3.torrent differ diff --git a/test/test_torrents/empty-files-4.torrent b/test/test_torrents/empty-files-4.torrent new file mode 100644 index 000000000..eabe83861 Binary files /dev/null and b/test/test_torrents/empty-files-4.torrent differ diff --git a/test/test_torrents/empty-files-5.torrent b/test/test_torrents/empty-files-5.torrent new file mode 100644 index 000000000..79265e0a6 Binary files /dev/null and b/test/test_torrents/empty-files-5.torrent differ