Ignore:
Timestamp:
May 20, 2008, 5:33:54 PM (14 years ago)
Author:
charles
Message:

(1) RPC "add-torrent" now lets clients embed base64-encoded metainfo directly into the request
(2) remove the RISON code; it didn't make the final cut
(3) add base64 encode/decode utilities and unit tests

File:
1 edited

Legend:

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

    r5843 r5860  
    273273
    274274static int
    275 testRISONSnippet( const char * rison_str, const char * expected )
    276 {
    277     char * serialized = tr_rison2json( rison_str, -1 );
    278 #if 0
    279 fprintf( stderr, " expected: [%s]\n", expected );
    280 fprintf( stderr, "      got: [%s]\n", serialized );
    281 #endif
    282     check( !strcmp( serialized, expected ) );
    283     tr_free( serialized );
    284     return 0;
    285 }
    286 
    287 static int
    288 testRISON( void )
    289 {
    290     int val;
    291     const char * rison;
    292     const char * expected;
    293 
    294     rison = "(a:0,b:foo,c:'23skidoo')";
    295     expected = "{ \"a\": 0, \"b\": \"foo\", \"c\": \"23skidoo\" }";
    296     if(( val = testRISONSnippet( rison, expected )))
    297         return val;
    298 
    299     rison = "(method:torrent-info)";
    300     expected = "{ \"method\": \"torrent-info\" }";
    301     if(( val = testRISONSnippet( rison, expected )))
    302         return val;
    303 
    304     return 0;
    305 }
    306 
    307 static int
    308275testJSONSnippet( const char * benc_str, const char * expected )
    309276{
     
    406373        return i;
    407374
    408     if(( i = testRISON( )))
    409         return i;
    410 
    411375    if(( i = testStackSmash( )))
    412376        return i;
Note: See TracChangeset for help on using the changeset viewer.