Ignore:
Timestamp:
Dec 30, 2008, 10:07:39 PM (12 years ago)
Author:
charles
Message:

(trunk libT) have tr_bencSaveAsJSON() use an evbuffer

File:
1 edited

Legend:

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

    r7359 r7552  
    33#include <stdio.h>
    44#include <string.h>
     5
     6#include "event.h"
     7
    58#include "transmission.h"
    69#include "bencode.h"
     
    310313{
    311314    tr_benc top;
    312     char *  serialized;
     315    struct evbuffer * buf = tr_getBuffer( );
     316    char * serialized;
    313317
    314318    tr_bencLoad( benc_str, strlen( benc_str ), &top, NULL );
    315     serialized = tr_bencSaveAsJSON( &top, NULL );
     319    serialized = tr_bencSaveAsJSON( &top, buf );
    316320    stripWhitespace( serialized );
    317321#if 0
     
    321325#endif
    322326    check( !strcmp( serialized, expected ) );
    323     tr_free( serialized );
    324327    tr_bencFree( &top );
     328    tr_releaseBuffer( buf );
    325329    return 0;
    326330}
Note: See TracChangeset for help on using the changeset viewer.