system.listNotifications RPC method
This commit is contained in:
@@ -80,6 +80,7 @@ class RpcMethodTest : public CppUnit::TestFixture {
|
||||
CPPUNIT_TEST(testSystemMulticall);
|
||||
CPPUNIT_TEST(testSystemMulticall_fail);
|
||||
CPPUNIT_TEST(testSystemListMethods);
|
||||
CPPUNIT_TEST(testSystemListNotifications);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
private:
|
||||
@@ -146,6 +147,7 @@ public:
|
||||
void testSystemMulticall();
|
||||
void testSystemMulticall_fail();
|
||||
void testSystemListMethods();
|
||||
void testSystemListNotifications();
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(RpcMethodTest);
|
||||
@@ -1396,6 +1398,24 @@ void RpcMethodTest::testSystemListMethods()
|
||||
}
|
||||
}
|
||||
|
||||
void RpcMethodTest::testSystemListNotifications()
|
||||
{
|
||||
SystemListNotificationsRpcMethod m;
|
||||
auto res = m.execute(createReq("system.listNotifications"), e_.get());
|
||||
CPPUNIT_ASSERT_EQUAL(0, res.code);
|
||||
|
||||
const auto resParams = downcast<List>(res.param);
|
||||
auto& allNames = allNotificationsNames();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(allNames.size(), resParams->size());
|
||||
|
||||
for (size_t i = 0; i < allNames.size(); ++i) {
|
||||
const auto s = downcast<String>(resParams->get(i));
|
||||
CPPUNIT_ASSERT(s);
|
||||
CPPUNIT_ASSERT_EQUAL(allNames[i], s->s());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace rpc
|
||||
|
||||
} // namespace aria2
|
||||
|
||||
Reference in New Issue
Block a user