Changeset 13623


Ignore:
Timestamp:
Nov 27, 2012, 11:21:13 PM (9 years ago)
Author:
jordan
Message:

(trunk, libT) #5150 'improper escaping of dirnames with new json' -- added new regression test, currently failing, to trigger this bug

File:
1 edited

Legend:

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

    r13613 r13623  
    194194}
    195195
     196static int
     197test_unescape (void)
     198{
     199    const char * in = "{ \"string-1\": \"\\/usr\\/lib\" }";
     200    tr_benc top;
     201    const char * str;
     202
     203    const int err = tr_jsonParse (NULL, in, strlen(in), &top, NULL);
     204    check_int_eq (0, err);
     205    check (tr_bencDictFindStr (&top, "string-1", &str));
     206    check_streq ("/usr/lib", str);
     207
     208    tr_bencFree (&top);
     209    return 0;
     210}
     211
    196212int
    197213main( void )
     
    201217                               test1,
    202218                               test2,
    203                                test3, };
     219                               test3,
     220                               test_unescape };
    204221
    205222    return runTests(tests, NUM_TESTS(tests));
Note: See TracChangeset for help on using the changeset viewer.