diff options
Diffstat (limited to 'test/RpcMethodTest.cc')
| -rw-r--r-- | test/RpcMethodTest.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/RpcMethodTest.cc b/test/RpcMethodTest.cc index 1bcac3af..f89afd9b 100644 --- a/test/RpcMethodTest.cc +++ b/test/RpcMethodTest.cc @@ -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 |
