Ignore:
Timestamp:
Jun 25, 2010, 1:13:35 AM (12 years ago)
Author:
charles
Message:

(trunk) #3311 "MingW build of Transmission" -- modify tr_strip_positional_args() to strip out the ' printf flag. Platforms not supporting $ tend to not support ' either

File:
1 edited

Legend:

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

    r10239 r10844  
    104104
    105105static int
     106test_strip_positional_args( void )
     107{
     108    const char * in;
     109    const char * out;
     110    const char * expected;
     111
     112    in = "Hello %1$s foo %2$.*f";
     113    expected = "Hello %s foo %.*f";
     114    out = tr_strip_positional_args( in );
     115    check( out != NULL )
     116    check( !strcmp( out, expected ) )
     117
     118    in = "Hello %1$'d foo %2$'f";
     119    expected = "Hello %d foo %f";
     120    out = tr_strip_positional_args( in );
     121    check( out != NULL )
     122    check( !strcmp( out, expected ) )
     123
     124    return 0;
     125}
     126
     127static int
    106128test_strstrip( void )
    107129{
     
    393415    if( ( i = test_lowerbound( ) ) )
    394416        return i;
     417    if( ( i = test_strip_positional_args( ) ) )
     418        return i;
    395419    if( ( i = test_strstrip( ) ) )
    396420        return i;
Note: See TracChangeset for help on using the changeset viewer.