| 35 | CPPUNIT_TEST_SUITE_REGISTRATION(BtHandshakeMessageTest); |
| 36 | |
| 37 | void createHandshakeMessageData(unsigned char* msg) |
| 38 | { |
| 39 | msg[0] = 19; |
| 40 | memcpy(&msg[1], BtHandshakeMessageTest::BTPSTR.c_str(), |
| 41 | BtHandshakeMessageTest::BTPSTR.size()); |
| 42 | unsigned char reserved[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x04}; |
| 43 | memcpy(&msg[20], reserved, sizeof(reserved)); |
| 44 | unsigned char infoHash[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 45 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 46 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; |
| 47 | memcpy(&msg[28], infoHash, sizeof(infoHash)); |
| 48 | unsigned char peerId[] = {0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 49 | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 50 | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0}; |
| 51 | memcpy(&msg[48], peerId, sizeof(peerId)); |
| 52 | } |
| 53 | |
| 54 | void BtHandshakeMessageTest::testCreate() |
| 55 | { |
no test coverage detected