Remove tr_generateAllowedSet declaration (#4029)

This commit is contained in:
A Cœur 2022-10-25 21:50:53 +08:00 committed by GitHub
parent 798e873b87
commit 14f2698cdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 31 deletions

View File

@ -80,11 +80,4 @@ tr_peerMsgs* tr_peerMsgsNew(
tr_peer_callback callback,
void* callback_data);
size_t tr_generateAllowedSet(
tr_piece_index_t* setmePieces,
size_t desiredSetSize,
size_t pieceCount,
uint8_t const* infohash,
struct tr_address const* addr);
/* @} */

View File

@ -12,28 +12,4 @@
TEST(PeerMsgs, placeholder)
{
#if 0
auto infohash = tr_sha1_digest_t{};
tr_piece_index_t pieceCount = 1313;
size_t numwant;
size_t numgot;
tr_piece_index_t pieces[] = { 1059, 431, 808, 1217, 287, 376, 1188, 353, 508 };
tr_piece_index_t buf[16];
memset(std::data(infohash), 0xaa, std::size(infohash));
auto const addr = tr_address::fromString("80.4.4.200");
numwant = 7;
numgot = tr_generateAllowedSet(buf, numwant, pieceCount, infohash, &addr);
check_uint(numgot, ==, numwant);
check_mem(buf, ==, pieces, numgot);
numwant = 9;
numgot = tr_generateAllowedSet(buf, numwant, pieceCount, infohash, &addr);
check_uint(numgot, ==, numwant);
check_mem(buf, ==, pieces, numgot);
#endif
}