Changeset 13570


Ignore:
Timestamp:
Oct 14, 2012, 11:38:52 PM (9 years ago)
Author:
jordan
Message:

more unit test cleanup

Location:
trunk/libtransmission
Files:
9 edited

Legend:

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

    r13569 r13570  
    1 #include <ctype.h>
    2 #include <errno.h>
    3 #include <stdio.h>
    4 #include <string.h>
     1#include <ctype.h> /* isspace() */
     2#include <errno.h> /* EILSEQ */
     3#include <string.h> /* strlen(), strncmp() */
    54
    65#include <event2/buffer.h>
     
    492491
    493492    benc = tr_bencToStr( &top, TR_FMT_BENC, &len );
    494     check( !strcmp( benc, "d14:this-is-a-booli1e14:this-is-a-real8:0.50000016:this-is-a-string16:this-is-a-string14:this-is-an-inti1234ee" ) );
     493    check_streq( "d14:this-is-a-booli1e14:this-is-a-real8:0.50000016:this-is-a-string16:this-is-a-string14:this-is-an-inti1234ee", benc );
    495494    check( !tr_bencParse( benc, benc+len, &top2, &end ) );
    496495    check( (char*)end == benc + len );
  • trunk/libtransmission/clients-test.c

    r13442 r13570  
    1 #include <stdio.h>
    2 #include <string.h>
    31#include "transmission.h"
    42#include "clients.h"
     
    108#define TEST_CLIENT( A, B ) \
    119    tr_clientForId( buf, sizeof( buf ), A ); \
    12     check( !strcmp( buf, B ) );
     10    check_streq( B, buf );
    1311
    1412int
  • trunk/libtransmission/history-test.c

    r13569 r13570  
    1 #include <stdio.h>
    21#include <string.h> /* memset() */
    32
  • trunk/libtransmission/json-test.c

    r13569 r13570  
    1 #include <stdio.h>
    2 #include <string.h>
     1#include <string.h> /* strlen() */
    32#include "transmission.h"
    43#include "bencode.h"
  • trunk/libtransmission/libtransmission-test.h

    r13565 r13570  
    55
    66#include <stdio.h>
    7 #include <string.h>
    87
    9 #include "transmission.h"
    108#include "utils.h" /* tr_strcmp0() */
    119
  • trunk/libtransmission/magnet-test.c

    r13569 r13570  
    1 #include <stdio.h>
    2 #include <string.h>
    31#include "transmission.h"
    42#include "magnet.h"
    53#include "utils.h"
    64
    7 /* #define VERBOSE */
    85#undef VERBOSE
    96#include "libtransmission-test.h"
     
    6057}
    6158
    62 int
    63 main( void )
    64 {
    65     const testFunc tests[] = { test1 };
    66     int ret;
     59MAIN_SINGLE_TEST(test1)
    6760
    68     if( (ret = runTests(tests, 1)) )
    69         return ret;
    70 
    71 #ifdef VERBOSE
    72     fprintf( stderr, "magnet-test passed\n" );
    73 #endif
    74 
    75     return 0;
    76 }
    77 
  • trunk/libtransmission/metainfo-test.c

    r13568 r13570  
    11#include "transmission.h"
    2 #include "utils.h" /* tr_strcmp0 */
    32
    43#undef VERBOSE
  • trunk/libtransmission/rpc-test.c

    r13569 r13570  
    1 #include <stdio.h> /* fprintf */
    2 #include <string.h> /* strcmp */
    31#include "transmission.h"
    42#include "bencode.h"
  • trunk/libtransmission/utils-test.c

    r13569 r13570  
    1 #include <math.h>
    2 #include <stdio.h> /* fprintf */
    3 #include <string.h> /* strcmp */
     1#include <math.h> /* sqrt() */
     2#include <string.h> /* strlen() */
    43
    54#include "transmission.h"
     
    427426    tr_snprintf( buf, sizeof( buf ), "%.2f%%", 99.999 );
    428427    check_streq("100.00%", buf);
    429     check( !strcmp( buf, "100.00%" ) );
    430428
    431429    tr_snprintf( buf, sizeof( buf ), "%.2f%%", tr_truncd( 99.999, 2 ) );
Note: See TracChangeset for help on using the changeset viewer.