(trunk, libT) #5081 'Transmission discards webseed URLs that have trailing whitespace' -- add unit test (currently failing) for this bug.
This commit is contained in:
parent
e89fcc9bf6
commit
0630583637
|
@ -128,6 +128,7 @@ TESTS = \
|
|||
history-test \
|
||||
json-test \
|
||||
magnet-test \
|
||||
metainfo-test \
|
||||
peer-msgs-test \
|
||||
rpc-test \
|
||||
test-peer-id \
|
||||
|
@ -175,6 +176,10 @@ magnet_test_SOURCES = magnet-test.c
|
|||
magnet_test_LDADD = ${apps_ldadd}
|
||||
magnet_test_LDFLAGS = ${apps_ldflags}
|
||||
|
||||
metainfo_test_SOURCES = metainfo-test.c
|
||||
metainfo_test_LDADD = ${apps_ldadd}
|
||||
metainfo_test_LDFLAGS = ${apps_ldflags}
|
||||
|
||||
peer_msgs_test_SOURCES = peer-msgs-test.c
|
||||
peer_msgs_test_LDADD = ${apps_ldadd}
|
||||
peer_msgs_test_LDFLAGS = ${apps_ldflags}
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
#include "transmission.h"
|
||||
#include "utils.h" /* tr_strcmp0 */
|
||||
|
||||
#define VERBOSE
|
||||
#include "libtransmission-test.h"
|
||||
|
||||
static int
|
||||
test1( void )
|
||||
{
|
||||
tr_info inf;
|
||||
tr_ctor * ctor;
|
||||
const char * magnet_link;
|
||||
tr_parse_result parse_result;
|
||||
|
||||
/* background info @ http://wiki.theory.org/BitTorrent_Magnet-URI_Webseeding */
|
||||
magnet_link = "magnet:?"
|
||||
"xt=urn:btih:14FFE5DD23188FD5CB53A1D47F1289DB70ABF31E"
|
||||
"&dn=ubuntu+12+04+1+desktop+32+bit"
|
||||
"&tr=http%3A%2F%2Ftracker.publicbt.com%2Fannounce"
|
||||
"&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80"
|
||||
"&ws=http://transmissionbt.com ";
|
||||
ctor = tr_ctorNew (NULL);
|
||||
tr_ctorSetMetainfoFromMagnetLink (ctor, magnet_link);
|
||||
parse_result = tr_torrentParse (ctor, &inf);
|
||||
check_int_eq (inf.fileCount, 0); /* cos it's a magnet link */
|
||||
check_int_eq (parse_result, TR_PARSE_OK);
|
||||
check_int_eq (inf.trackerCount, 2);
|
||||
check_streq ("http://tracker.publicbt.com/announce", inf.trackers[0].announce);
|
||||
check_streq ("udp://tracker.publicbt.com:80", inf.trackers[1].announce);
|
||||
check_int_eq (inf.webseedCount, 1);
|
||||
check_streq ("http://transmissionbt.com", inf.webseeds[0]);
|
||||
|
||||
/* cleanup */
|
||||
tr_metainfoFree (&inf);
|
||||
tr_ctorFree (ctor);
|
||||
return 0;
|
||||
}
|
||||
|
||||
MAIN_SINGLE_TEST(test1)
|
Loading…
Reference in New Issue