more unit test cleanup

This commit is contained in:
Jordan Lee 2012-10-14 23:38:52 +00:00
parent 17beba3502
commit 1dafe0beef
9 changed files with 9 additions and 38 deletions

View File

@ -1,7 +1,6 @@
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h> /* isspace() */
#include <errno.h> /* EILSEQ */
#include <string.h> /* strlen(), strncmp() */
#include <event2/buffer.h>
@ -491,7 +490,7 @@ testParse2( void )
tr_bencDictAddStr( &top, "this-is-a-string", "this-is-a-string" );
benc = tr_bencToStr( &top, TR_FMT_BENC, &len );
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" ) );
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 );
check( !tr_bencParse( benc, benc+len, &top2, &end ) );
check( (char*)end == benc + len );
check( tr_bencIsDict( &top2 ) );

View File

@ -1,5 +1,3 @@
#include <stdio.h>
#include <string.h>
#include "transmission.h"
#include "clients.h"
@ -9,7 +7,7 @@
#define TEST_CLIENT( A, B ) \
tr_clientForId( buf, sizeof( buf ), A ); \
check( !strcmp( buf, B ) );
check_streq( B, buf );
int
main( void )

View File

@ -1,4 +1,3 @@
#include <stdio.h>
#include <string.h> /* memset() */
#include "transmission.h"

View File

@ -1,5 +1,4 @@
#include <stdio.h>
#include <string.h>
#include <string.h> /* strlen() */
#include "transmission.h"
#include "bencode.h"
#include "json.h"

View File

@ -4,9 +4,7 @@
#define LIBTRANSMISSION_TEST_H 1
#include <stdio.h>
#include <string.h>
#include "transmission.h"
#include "utils.h" /* tr_strcmp0() */
static int current_test = 0;

View File

@ -1,10 +1,7 @@
#include <stdio.h>
#include <string.h>
#include "transmission.h"
#include "magnet.h"
#include "utils.h"
/* #define VERBOSE */
#undef VERBOSE
#include "libtransmission-test.h"
@ -59,19 +56,5 @@ test1( void )
return 0;
}
int
main( void )
{
const testFunc tests[] = { test1 };
int ret;
if( (ret = runTests(tests, 1)) )
return ret;
#ifdef VERBOSE
fprintf( stderr, "magnet-test passed\n" );
#endif
return 0;
}
MAIN_SINGLE_TEST(test1)

View File

@ -1,5 +1,4 @@
#include "transmission.h"
#include "utils.h" /* tr_strcmp0 */
#undef VERBOSE
#include "libtransmission-test.h"

View File

@ -1,5 +1,3 @@
#include <stdio.h> /* fprintf */
#include <string.h> /* strcmp */
#include "transmission.h"
#include "bencode.h"
#include "rpcimpl.h"

View File

@ -1,6 +1,5 @@
#include <math.h>
#include <stdio.h> /* fprintf */
#include <string.h> /* strcmp */
#include <math.h> /* sqrt() */
#include <string.h> /* strlen() */
#include "transmission.h"
#include "bitfield.h"
@ -426,7 +425,6 @@ test_truncd( void )
tr_snprintf( buf, sizeof( buf ), "%.2f%%", 99.999 );
check_streq("100.00%", buf);
check( !strcmp( buf, "100.00%" ) );
tr_snprintf( buf, sizeof( buf ), "%.2f%%", tr_truncd( 99.999, 2 ) );
check_streq("99.99%", buf);