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

Method testCreateMessage

test/BtPortMessageTest.cc:96–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void BtPortMessageTest::testCreateMessage()
97{
98 BtPortMessage msg(6881);
99 unsigned char data[7];
100 bittorrent::createPeerMessageString(data, sizeof(data), 3, 9);
101 bittorrent::setShortIntParam(&data[5], 6881);
102 auto rawmsg = msg.createMessage();
103 CPPUNIT_ASSERT_EQUAL((size_t)7, rawmsg.size());
104 CPPUNIT_ASSERT(std::equal(std::begin(rawmsg), std::end(rawmsg), data));
105}
106
107void BtPortMessageTest::testDoReceivedAction()
108{

Callers

nothing calls this directly

Calls 4

createPeerMessageStringFunction · 0.85
setShortIntParamFunction · 0.85
createMessageMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected