mirror of
https://github.com/transmission/transmission
synced 2024-12-23 16:24:02 +00:00
test: tests for magnet links with bad/junk values (#2483)
Co-authored-by: Srinidhi Kaushik <shrinidhi.kaushik@gmail.com>
This commit is contained in:
parent
c5bc3091cc
commit
85566c372e
1 changed files with 22 additions and 1 deletions
|
@ -30,6 +30,27 @@ TEST(MagnetMetainfo, magnetParse)
|
|||
"&tr=http%3A%2F%2Ftracker.opentracker.org%2Fannounce"
|
||||
"&ws=http%3A%2F%2Fserver.webseed.org%2Fpath%2Fto%2Ffile"sv;
|
||||
|
||||
auto constexpr UriHexWithEmptyValue =
|
||||
"magnet:?xt=urn:btih:"
|
||||
"d2354010a3ca4ade5b7427bb093a62a3899ff381"
|
||||
"&empty"
|
||||
"&dn=Display%20Name"
|
||||
"&tr=http%3A%2F%2Ftracker.openbittorrent.com%2Fannounce"
|
||||
"&tr=http%3A%2F%2Ftracker.opentracker.org%2Fannounce"
|
||||
"&ws=http%3A%2F%2Fserver.webseed.org%2Fpath%2Fto%2Ffile"sv;
|
||||
|
||||
auto constexpr UriHexWithJunkValues =
|
||||
"magnet:?xt=urn:btih:"
|
||||
"d2354010a3ca4ade5b7427bb093a62a3899ff381"
|
||||
"&empty"
|
||||
"&empty_again"
|
||||
"&dn=Display%20Name"
|
||||
"&tr=http%3A%2F%2Ftracker.openbittorrent.com%2Fannounce"
|
||||
"&empty_again"
|
||||
"&="
|
||||
"&ws=http%3A%2F%2Fserver.webseed.org%2Fpath%2Fto%2Ffile"
|
||||
"&tr=http%3A%2F%2Ftracker.opentracker.org%2Fannounce"sv;
|
||||
|
||||
auto constexpr UriBase32 =
|
||||
"magnet:?xt=urn:btih:"
|
||||
"2I2UAEFDZJFN4W3UE65QSOTCUOEZ744B"
|
||||
|
@ -38,7 +59,7 @@ TEST(MagnetMetainfo, magnetParse)
|
|||
"&ws=http%3A%2F%2Fserver.webseed.org%2Fpath%2Fto%2Ffile"
|
||||
"&tr=http%3A%2F%2Ftracker.opentracker.org%2Fannounce"sv;
|
||||
|
||||
for (auto const& uri : { UriHex, UriBase32 })
|
||||
for (auto const& uri : { UriHex, UriHexWithEmptyValue, UriHexWithJunkValues, UriBase32 })
|
||||
{
|
||||
auto mm = tr_magnet_metainfo{};
|
||||
|
||||
|
|
Loading…
Reference in a new issue