1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

(trunk libT) #3134 "transmission-remote apparently can't handle apostrophes in errorStrings" -- I'm unable to reproduce the reported behavior, but that's no reason to let a new unit test go to waste... committing the unit test anyway

This commit is contained in:
Charles Kerr 2010-04-15 19:27:47 +00:00
parent 967edafa63
commit c808cd624a

View file

@ -153,6 +153,26 @@ test2( void )
return 0;
}
static int
test3( void )
{
const char * in = "{ \"error\": 2,"
" \"errorString\": \"torrent not registered with this tracker 6UHsVW'*C\","
" \"eta\": 262792,"
" \"id\": 25,"
" \"leftUntilDone\": 2275655680 }";
tr_benc top;
const char * str;
const int err = tr_jsonParse( NULL, in, strlen( in ), &top, NULL );
check( !err );
check( tr_bencDictFindStr( &top, "errorString", &str ) );
check( !strcmp( str, "torrent not registered with this tracker 6UHsVW'*C" ) );
tr_bencFree( &top );
return 0;
}
int
main( void )
{
@ -167,6 +187,9 @@ main( void )
if( ( i = test2( ) ) )
return i;
if( ( i = test3( ) ) )
return i;
return 0;
}