Changeset 10487


Ignore:
Timestamp:
Apr 15, 2010, 7:27:47 PM (13 years ago)
Author:
charles
Message:

(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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/json-test.c

    r8588 r10487  
    154154}
    155155
     156static int
     157test3( void )
     158{
     159    const char * in = "{ \"error\": 2,"
     160                      "  \"errorString\": \"torrent not registered with this tracker 6UHsVW'*C\","
     161                      "  \"eta\": 262792,"
     162                      "  \"id\": 25,"
     163                      "  \"leftUntilDone\": 2275655680 }";
     164    tr_benc top;
     165    const char * str;
     166
     167    const int err = tr_jsonParse( NULL, in, strlen( in ), &top, NULL );
     168    check( !err );
     169    check( tr_bencDictFindStr( &top, "errorString", &str ) );
     170    check( !strcmp( str, "torrent not registered with this tracker 6UHsVW'*C" ) );
     171
     172    tr_bencFree( &top );
     173    return 0;
     174}
     175
    156176int
    157177main( void )
     
    168188        return i;
    169189
     190    if( ( i = test3( ) ) )
     191        return i;
     192
    170193    return 0;
    171194}
Note: See TracChangeset for help on using the changeset viewer.