MCPcopy Create free account
hub / github.com/aria2/aria2 / testCreateMessage

Method testCreateMessage

test/BtAllowedFastMessageTest.cc:66–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void BtAllowedFastMessageTest::testCreateMessage()
67{
68 BtAllowedFastMessage msg;
69 msg.setIndex(12345);
70 unsigned char data[9];
71 bittorrent::createPeerMessageString(data, sizeof(data), 5, 17);
72 bittorrent::setIntParam(&data[5], 12345);
73 auto rawmsg = msg.createMessage();
74 CPPUNIT_ASSERT_EQUAL((size_t)9, rawmsg.size());
75 CPPUNIT_ASSERT(std::equal(std::begin(rawmsg), std::end(rawmsg), data));
76}
77
78void BtAllowedFastMessageTest::testDoReceivedAction()
79{

Callers

nothing calls this directly

Calls 5

createPeerMessageStringFunction · 0.85
setIntParamFunction · 0.85
setIndexMethod · 0.45
createMessageMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected