mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01: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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user