mirror of
https://github.com/aria2/aria2.git
synced 2026-04-13 00:09:32 +00:00
2008-12-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added tests the case where length < 0 is specified. * test/BencodeTest.cc
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2008-12-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Added tests the case where length < 0 is specified.
|
||||
* test/BencodeTest.cc
|
||||
|
||||
2008-12-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Fixed memory leak in decoderawstring()
|
||||
|
||||
@@ -244,7 +244,19 @@ void BencodeTest::testDecode()
|
||||
bencode::decode("x:abc");
|
||||
CPPUNIT_FAIL("exception must be thrown.");
|
||||
} catch(RecoverableException& e) {
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("Integer expected but none found."),
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("A positive integer expected"
|
||||
" but none found."),
|
||||
std::string(e.what()));
|
||||
}
|
||||
}
|
||||
{
|
||||
// string with minus length
|
||||
try {
|
||||
bencode::decode("-1:a");
|
||||
CPPUNIT_FAIL("exception must be thrown.");
|
||||
} catch(RecoverableException& e) {
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("A positive integer expected"
|
||||
" but none found."),
|
||||
std::string(e.what()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user