mirror of https://github.com/aria2/aria2
2008-12-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added tests the case where length < 0 is specified. * test/BencodeTest.ccpull/1/head
parent
9b197e97d3
commit
057132cd5f
|
@ -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()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue