Ignore:
Timestamp:
Dec 10, 2009, 9:13:08 AM (13 years ago)
Author:
charles
Message:

(trunk libT) fix errors in tr_httpParseURL()

File:
1 edited

Legend:

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

    r9696 r9705  
    320320}
    321321
     322static int
     323test_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
    322346int
    323347main( void )
     
    366390    if( ( i = test_array( ) ) )
    367391        return i;
     392    if( ( i = test_url( ) ) )
     393        return i;
    368394
    369395    /* test that tr_cryptoRandInt() stays in-bounds */
Note: See TracChangeset for help on using the changeset viewer.