Files
rtorrent/test/rpc/test_jsonrpc.h
xirvik 439d23ce62 Bound JSON-RPC input by size and nesting depth
Enforce the nesting bound in one parse, capping allocation by depth, not input size.
2026-09-23 09:25:25 +02:00

31 lines
632 B
C++

#include "test/helpers/test_fixture.h"
#include "test/helpers/test_main_thread.h"
#include "rpc/command_map.h"
#include "rpc/jsonrpc.h"
class TestJsonrpc : public test_fixture {
CPPUNIT_TEST_SUITE(TestJsonrpc);
CPPUNIT_TEST(test_basics);
CPPUNIT_TEST(test_response_size_limit);
CPPUNIT_TEST(test_depth_limit);
CPPUNIT_TEST(test_size_limit);
CPPUNIT_TEST_SUITE_END();
public:
void setUp();
void tearDown();
void test_basics();
void test_response_size_limit();
void test_depth_limit();
void test_size_limit();
private:
std::unique_ptr<TestMainThread> m_test_main_thread;
rpc::JsonRpc m_jsonrpc;
};