mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +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:
parent
967edafa63
commit
c808cd624a
1 changed files with 23 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue