Changeset 9705 for trunk/libtransmission/utils-test.c
- Timestamp:
- Dec 10, 2009, 9:13:08 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/utils-test.c
r9696 r9705 320 320 } 321 321 322 static int 323 test_url( void ) 324 { 325 int port; 326 char * host; 327 char * path; 328 const char * url; 329 330 url = "http://www.some-tracker.org/some/path"; 331 check( !tr_httpParseURL( url, -1, &host, &port, &path ) ) 332 check( !strcmp( host, "www.some-tracker.org" ) ) 333 check( !strcmp( path, "/some/path" ) ) 334 check( port == 80 ) 335 336 url = "http://www.some-tracker.org:80/some/path"; 337 check( !tr_httpParseURL( url, -1, &host, &port, &path ) ) 338 check( !strcmp( host, "www.some-tracker.org" ) ) 339 check( !strcmp( path, "/some/path" ) ) 340 check( port == 80 ) 341 342 343 return 0; 344 } 345 322 346 int 323 347 main( void ) … … 366 390 if( ( i = test_array( ) ) ) 367 391 return i; 392 if( ( i = test_url( ) ) ) 393 return i; 368 394 369 395 /* test that tr_cryptoRandInt() stays in-bounds */
Note: See TracChangeset
for help on using the changeset viewer.