2
#include "transmission.h"
14
fprintf( stderr, "PASS test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \
16
fprintf( stderr, "FAIL test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \
25
fprintf( stderr, "FAIL test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \
36
uint8_t infohash[SHA_DIGEST_LENGTH];
37
struct tr_address addr;
38
tr_piece_index_t pieceCount = 1313;
41
tr_piece_index_t pieces[] = { 1059, 431, 808, 1217, 287, 376, 1188, 353, 508 };
42
tr_piece_index_t buf[16];
44
for( i = 0; i < SHA_DIGEST_LENGTH; ++i )
46
tr_pton( "80.4.4.200", &addr );
49
numgot = tr_generateAllowedSet( buf, numwant, pieceCount, infohash, &addr );
50
check( numgot == numwant );
51
for( i=0; i<numgot; ++i )
52
check( buf[i] == pieces[i] );
55
numgot = tr_generateAllowedSet( buf, numwant, pieceCount, infohash, &addr );
56
check( numgot == numwant );
57
for( i=0; i<numgot; ++i )
58
check( buf[i] == pieces[i] );