Ignore:
Timestamp:
Jan 23, 2009, 6:44:15 PM (13 years ago)
Author:
charles
Message:

(trunk libT) fix some code that the newly-added gcc warnings didn't like

File:
1 edited

Legend:

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

    r7748 r7783  
    77#include "crypto.h"
    88
    9 #define VERBOSE 0
     9#undef VERBOSE
    1010#define NUM_LOOPS 1
    1111#define SPEED_TEST 0
    1212
    1313#if SPEED_TEST
    14  #undef VERBOSE
    15  #define VERBOSE 0
     14 #define VERBOSE
    1615 #undef NUM_LOOPS
    1716 #define NUM_LOOPS 200
     
    2019static int test = 0;
    2120
    22 #define check( A ) \
     21#ifdef VERBOSE
     22  #define check( A ) \
    2323    { \
    2424        ++test; \
    2525        if( A ){ \
    26             if( VERBOSE ) \
    27                 fprintf( stderr, "PASS test #%d (%s, %d)\n", test, __FILE__,\
    28                          __LINE__ );\
     26            fprintf( stderr, "PASS test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \
    2927        } else { \
    30             fprintf( stderr, "FAIL test #%d (%s, %d)\n", test, __FILE__,\
    31                      __LINE__ ); \
     28            fprintf( stderr, "FAIL test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \
    3229            return test; \
    3330        } \
    3431    }
     32#else
     33  #define check( A ) \
     34    { \
     35        ++test; \
     36        if( !( A ) ){ \
     37            fprintf( stderr, "FAIL test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \
     38            return test; \
     39        } \
     40    }
     41#endif
    3542
    3643static int
     
    188195
    189196    /* base64 */
    190     in = "YOYO!";
    191     out = tr_base64_encode( in, -1, &len );
     197    out = tr_base64_encode( "YOYO!", -1, &len );
    192198    check( out );
    193199    check( !strcmp( out, "WU9ZTyE=\n" ) );
Note: See TracChangeset for help on using the changeset viewer.