| 119 | } |
| 120 | |
| 121 | void BtRejectMessageTest::testCreateMessage() |
| 122 | { |
| 123 | BtRejectMessage msg; |
| 124 | msg.setIndex(12345); |
| 125 | msg.setBegin(256); |
| 126 | msg.setLength(1_k); |
| 127 | unsigned char data[17]; |
| 128 | bittorrent::createPeerMessageString(data, sizeof(data), 13, 16); |
| 129 | bittorrent::setIntParam(&data[5], 12345); |
| 130 | bittorrent::setIntParam(&data[9], 256); |
| 131 | bittorrent::setIntParam(&data[13], 1_k); |
| 132 | auto rawmsg = msg.createMessage(); |
| 133 | CPPUNIT_ASSERT_EQUAL((size_t)17, rawmsg.size()); |
| 134 | CPPUNIT_ASSERT(std::equal(std::begin(rawmsg), std::end(rawmsg), data)); |
| 135 | } |
| 136 | |
| 137 | void BtRejectMessageTest::testDoReceivedAction() |
| 138 | { |
nothing calls this directly
no test coverage detected