| 85 | } |
| 86 | |
| 87 | void BtCancelMessageTest::testCreateMessage() |
| 88 | { |
| 89 | BtCancelMessage msg; |
| 90 | msg.setIndex(12345); |
| 91 | msg.setBegin(256); |
| 92 | msg.setLength(1_k); |
| 93 | unsigned char data[17]; |
| 94 | bittorrent::createPeerMessageString(data, sizeof(data), 13, 8); |
| 95 | bittorrent::setIntParam(&data[5], 12345); |
| 96 | bittorrent::setIntParam(&data[9], 256); |
| 97 | bittorrent::setIntParam(&data[13], 1_k); |
| 98 | auto rawmsg = msg.createMessage(); |
| 99 | CPPUNIT_ASSERT_EQUAL((size_t)17, rawmsg.size()); |
| 100 | CPPUNIT_ASSERT(std::equal(std::begin(rawmsg), std::end(rawmsg), data)); |
| 101 | } |
| 102 | |
| 103 | void BtCancelMessageTest::testDoReceivedAction() |
| 104 | { |
nothing calls this directly
no test coverage detected