Changeset 10487
- Timestamp:
- Apr 15, 2010, 7:27:47 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/json-test.c
r8588 r10487 154 154 } 155 155 156 static int 157 test3( 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 156 176 int 157 177 main( void ) … … 168 188 return i; 169 189 190 if( ( i = test3( ) ) ) 191 return i; 192 170 193 return 0; 171 194 }
Note: See TracChangeset
for help on using the changeset viewer.