You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
JSONRPC: Require manual method registration
This commit is contained in:
@@ -57,10 +57,6 @@ String TestClassJSONRPC::something(const String &p_in) {
|
||||
return p_in + ", please";
|
||||
}
|
||||
|
||||
void TestClassJSONRPC::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("something", "in"), &TestClassJSONRPC::something);
|
||||
}
|
||||
|
||||
void test_process_action(const Variant &p_in, const Variant &p_expected, bool p_process_array_elements) {
|
||||
TestClassJSONRPC json_rpc = TestClassJSONRPC();
|
||||
const Variant &observed = json_rpc.process_action(p_in, p_process_array_elements);
|
||||
|
||||
@@ -60,20 +60,17 @@ TEST_CASE("[JSONRPC] process_string invalid") {
|
||||
}
|
||||
|
||||
class TestClassJSONRPC : public JSONRPC {
|
||||
GDCLASS(TestClassJSONRPC, JSONRPC)
|
||||
|
||||
public:
|
||||
String something(const String &p_in);
|
||||
TestClassJSONRPC() {
|
||||
set_method("something", callable_mp(this, &TestClassJSONRPC::something));
|
||||
}
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
String something(const String &p_in);
|
||||
};
|
||||
|
||||
void test_process_action(const Variant &p_in, const Variant &p_expected, bool p_process_array_elements = false);
|
||||
|
||||
TEST_CASE("[JSONRPC] process_action Dictionary") {
|
||||
ClassDB::register_class<TestClassJSONRPC>();
|
||||
|
||||
Dictionary in_dict = Dictionary();
|
||||
in_dict["method"] = "something";
|
||||
in_dict["id"] = "ID";
|
||||
|
||||
Reference in New Issue
Block a user