Changeset 9707


Ignore:
Timestamp:
Dec 10, 2009, 10:44:06 AM (12 years ago)
Author:
charles
Message:

(trunk libT) add simple tr_http_unescape() unit test

File:
1 edited

Legend:

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

    r9705 r9707  
    66#include "ConvertUTF.h" /* tr_utf8_validate*/
    77#include "platform.h"
     8#include "crypto.h"
    89#include "utils.h"
    9 #include "crypto.h"
     10#include "web.h"
    1011
    1112/* #define VERBOSE */
     
    326327    char * host;
    327328    char * path;
     329    char * str;
    328330    const char * url;
    329331
     
    333335    check( !strcmp( path, "/some/path" ) )
    334336    check( port == 80 )
     337    tr_free( path );
     338    tr_free( host );
    335339
    336340    url = "http://www.some-tracker.org:80/some/path";
     
    339343    check( !strcmp( path, "/some/path" ) )
    340344    check( port == 80 )
    341 
     345    tr_free( path );
     346    tr_free( host );
     347
     348    url = "http%3A%2F%2Fwww.example.com%2F~user%2F%3Ftest%3D1%26test1%3D2";
     349    str = tr_http_unescape( url, strlen( url ) );
     350    check( !strcmp( str, "http://www.example.com/~user/?test=1&test1=2" ) )
     351    tr_free( str );
    342352
    343353    return 0;
Note: See TracChangeset for help on using the changeset viewer.