mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 21:47:37 +03:00
test: Fix stack overflow
This commit is contained in:
parent
3080af7370
commit
c2ae77dff4
1 changed files with 2 additions and 2 deletions
|
@ -63,12 +63,12 @@ void DefaultBtMessageFactoryTest::testCreateBtMessage_BtExtendedMessage()
|
|||
memcpy(msg+6, payload.c_str(), payload.size());
|
||||
|
||||
auto m =
|
||||
factory_->createBtMessage((const unsigned char*)msg+4, sizeof(msg));
|
||||
factory_->createBtMessage((const unsigned char*)msg+4, sizeof(msg)-4);
|
||||
CPPUNIT_ASSERT(BtExtendedMessage::ID == m->getId());
|
||||
try {
|
||||
// disable extended messaging
|
||||
peer_->setExtendedMessagingEnabled(false);
|
||||
factory_->createBtMessage((const unsigned char*)msg+4, sizeof(msg));
|
||||
factory_->createBtMessage((const unsigned char*)msg+4, sizeof(msg)-4);
|
||||
CPPUNIT_FAIL("exception must be thrown.");
|
||||
} catch(Exception& e) {
|
||||
std::cerr << e.stackTrace() << std::endl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue