1#include <stdio.h> 2#include "transmission.h" 3#include "peer-msgs.h" 4#include "utils.h" 5 6#undef VERBOSE 7#include "libtransmission-test.h" 8 9int 10main( void ) 11{ 12#if 0 13 uint32_t i; 14 uint8_t infohash[SHA_DIGEST_LENGTH]; 15 struct tr_address addr; 16 tr_piece_index_t pieceCount = 1313; 17 size_t numwant; 18 size_t numgot; 19 tr_piece_index_t pieces[] = { 1059, 431, 808, 1217, 287, 376, 1188, 353, 508 }; 20 tr_piece_index_t buf[16]; 21 22 for( i = 0; i < SHA_DIGEST_LENGTH; ++i ) 23 infohash[i] = 0xaa; 24 tr_address_from_string( &addr, "80.4.4.200" ); 25 26 numwant = 7; 27 numgot = tr_generateAllowedSet( buf, numwant, pieceCount, infohash, &addr ); 28 check( numgot == numwant ); 29 for( i=0; i<numgot; ++i ) 30 check( buf[i] == pieces[i] ); 31 32 numwant = 9; 33 numgot = tr_generateAllowedSet( buf, numwant, pieceCount, infohash, &addr ); 34 check( numgot == numwant ); 35 for( i=0; i<numgot; ++i ) 36 check( buf[i] == pieces[i] ); 37#endif 38 39 return 0; 40} 41 42