#include #include #include #include "transmission.h" #include "blocklist.h" #include "net.h" #include "utils.h" #define VERBOSE 0 #define check(A) { \ ++test; \ if (A) { \ if( VERBOSE ) \ fprintf( stderr, "PASS test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \ } else { \ if( VERBOSE ) \ fprintf( stderr, "FAIL test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \ return test; \ } \ } extern void tr_getBlocklistFilename( char * buf, size_t buflen ); static void createTestBlocklist( const char * tmpfile ) { const char * lines[] = { "Austin Law Firm:216.16.1.144-216.16.1.151", "Sargent Controls and Aerospace:216.19.18.0-216.19.18.255", "Corel Corporation:216.21.157.192-216.21.157.223", "Fox Speed Channel:216.79.131.192-216.79.131.223" }; FILE * out; int i; const int lineCount = sizeof(lines) / sizeof(lines[0]); /* create the ascii file to feed to libtransmission */ out = fopen( tmpfile, "w+" ); for( i=0; i