mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 21:47:37 +03:00
2010-02-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Return SharedHandle<LpdMessage>(new LpdMessage()) if received data is bad in LpdMessageReceiver. * src/LpdMessage.h * src/LpdMessageReceiver.cc * src/LpdMessageReceiver.h * src/LpdReceiveMessageCommand.cc * test/LpdMessageReceiverTest.cc
This commit is contained in:
parent
6ae5882f3c
commit
232deb47b5
6 changed files with 37 additions and 5 deletions
|
@ -60,7 +60,10 @@ void LpdMessageReceiverTest::testReceiveMessage()
|
|||
sendsock->writeData(request.c_str(), request.size(),
|
||||
LPD_MULTICAST_ADDR, LPD_MULTICAST_PORT);
|
||||
|
||||
CPPUNIT_ASSERT(rcv.receiveMessage().isNull());
|
||||
msg = rcv.receiveMessage();
|
||||
CPPUNIT_ASSERT(!msg.isNull());
|
||||
CPPUNIT_ASSERT(msg->getPeer().isNull());
|
||||
CPPUNIT_ASSERT(msg->getInfoHash().empty());
|
||||
|
||||
// Bad port
|
||||
request =
|
||||
|
@ -70,7 +73,14 @@ void LpdMessageReceiverTest::testReceiveMessage()
|
|||
sendsock->writeData(request.c_str(), request.size(),
|
||||
LPD_MULTICAST_ADDR, LPD_MULTICAST_PORT);
|
||||
|
||||
CPPUNIT_ASSERT(rcv.receiveMessage().isNull());
|
||||
msg = rcv.receiveMessage();
|
||||
CPPUNIT_ASSERT(!msg.isNull());
|
||||
CPPUNIT_ASSERT(msg->getPeer().isNull());
|
||||
CPPUNIT_ASSERT(msg->getInfoHash().empty());
|
||||
|
||||
// No data available
|
||||
msg = rcv.receiveMessage();
|
||||
CPPUNIT_ASSERT(msg.isNull());
|
||||
}
|
||||
|
||||
} // namespace aria2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue