mirror of https://github.com/aria2/aria2
2009-05-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added test case for XmlRpcProcessor to fail to parse malformed document. * test/XmlRpcRequestProcessorTest.ccpull/1/head
parent
a4346f0620
commit
0373ae325e
|
@ -1,3 +1,9 @@
|
||||||
|
2009-05-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Added test case for XmlRpcProcessor to fail to parse malformed
|
||||||
|
document.
|
||||||
|
* test/XmlRpcRequestProcessorTest.cc
|
||||||
|
|
||||||
2009-05-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2009-05-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Removed *.gmo files in po because they are generated on 'make
|
Removed *.gmo files in po because they are generated on 'make
|
||||||
|
|
|
@ -12,6 +12,7 @@ class XmlRpcRequestProcessorTest:public CppUnit::TestFixture {
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE(XmlRpcRequestProcessorTest);
|
CPPUNIT_TEST_SUITE(XmlRpcRequestProcessorTest);
|
||||||
CPPUNIT_TEST(testParseMemory);
|
CPPUNIT_TEST(testParseMemory);
|
||||||
|
CPPUNIT_TEST(testParseMemory_shouldFail);
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
public:
|
public:
|
||||||
void setUp() {}
|
void setUp() {}
|
||||||
|
@ -19,6 +20,7 @@ public:
|
||||||
void tearDown() {}
|
void tearDown() {}
|
||||||
|
|
||||||
void testParseMemory();
|
void testParseMemory();
|
||||||
|
void testParseMemory_shouldFail();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,6 +74,22 @@ void XmlRpcRequestProcessorTest::testParseMemory()
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("hello world"), req._params[2][1].s());
|
CPPUNIT_ASSERT_EQUAL(std::string("hello world"), req._params[2][1].s());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XmlRpcRequestProcessorTest::testParseMemory_shouldFail()
|
||||||
|
{
|
||||||
|
XmlRpcRequestProcessor proc;
|
||||||
|
try {
|
||||||
|
proc.parseMemory("<methodCall>"
|
||||||
|
" <methodName>aria2.addURI</methodName>"
|
||||||
|
" <params>"
|
||||||
|
" <param>"
|
||||||
|
" <value><i4>100</i4></value>"
|
||||||
|
" </param>");
|
||||||
|
CPPUNIT_FAIL("exception must be thrown.");
|
||||||
|
} catch(RecoverableException& e) {
|
||||||
|
// success
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace xmlrpc
|
} // namespace xmlrpc
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
Loading…
Reference in New Issue