diff --git a/libtransmission/utils-test.c b/libtransmission/utils-test.c index 95430b784..d03a5ed0f 100644 --- a/libtransmission/utils-test.c +++ b/libtransmission/utils-test.c @@ -3,7 +3,16 @@ #include "transmission.h" #include "utils.h" +#define VERBOSE 1 +#define NUM_LOOPS 1 +#define SPEED_TEST 0 + +#if SPEED_TEST +#undef VERBOSE #define VERBOSE 0 +#undef NUM_LOOPS +#define NUM_LOOPS 200 +#endif int test = 0; @@ -19,12 +28,35 @@ int test = 0; } \ } +static int +test_bitfields( void ) +{ + int i; + int bitcount = 5000000; + tr_bitfield * field = tr_bitfieldNew( bitcount ); + + /* make every seventh one true */ + for( i=0; i