mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 13:37:40 +03:00
Rewritten ExtensionMessageRegistry
This commit is contained in:
parent
f0000a8754
commit
c13dc166de
20 changed files with 321 additions and 143 deletions
|
@ -137,12 +137,17 @@ void PeerSessionResourceTest::testGetExtensionMessageID()
|
|||
{
|
||||
PeerSessionResource res(1024, 1024*1024);
|
||||
|
||||
res.addExtension("a2", 9);
|
||||
CPPUNIT_ASSERT_EQUAL((uint8_t)9, res.getExtensionMessageID("a2"));
|
||||
CPPUNIT_ASSERT_EQUAL((uint8_t)0, res.getExtensionMessageID("non"));
|
||||
res.addExtension(ExtensionMessageRegistry::UT_PEX, 9);
|
||||
CPPUNIT_ASSERT_EQUAL((uint8_t)9,
|
||||
res.getExtensionMessageID
|
||||
(ExtensionMessageRegistry::UT_PEX));
|
||||
CPPUNIT_ASSERT_EQUAL((uint8_t)0,
|
||||
res.getExtensionMessageID
|
||||
(ExtensionMessageRegistry::UT_METADATA));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("a2"), res.getExtensionName(9));
|
||||
CPPUNIT_ASSERT_EQUAL(std::string(""), res.getExtensionName(10));
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("ut_pex"),
|
||||
std::string(res.getExtensionName(9)));
|
||||
CPPUNIT_ASSERT(!res.getExtensionName(10));
|
||||
}
|
||||
|
||||
void PeerSessionResourceTest::testFastExtensionEnabled()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue