mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add tests to ensure bound methods and signals are valid identifiers
This commit is contained in:
parent
15686ca786
commit
83026126d4
1 changed files with 4 additions and 0 deletions
|
|
@ -559,6 +559,8 @@ void add_exposed_classes(Context &r_context) {
|
||||||
|
|
||||||
MethodData method;
|
MethodData method;
|
||||||
method.name = method_info.name;
|
method.name = method_info.name;
|
||||||
|
TEST_FAIL_COND(!String(method.name).is_valid_identifier(),
|
||||||
|
"Method name is not a valid identifier: '", exposed_class.name, ".", method.name, "'.");
|
||||||
|
|
||||||
if (method_info.flags & METHOD_FLAG_VIRTUAL) {
|
if (method_info.flags & METHOD_FLAG_VIRTUAL) {
|
||||||
method.is_virtual = true;
|
method.is_virtual = true;
|
||||||
|
|
@ -682,6 +684,8 @@ void add_exposed_classes(Context &r_context) {
|
||||||
const MethodInfo &method_info = signal_map.get(K.key);
|
const MethodInfo &method_info = signal_map.get(K.key);
|
||||||
|
|
||||||
signal.name = method_info.name;
|
signal.name = method_info.name;
|
||||||
|
TEST_FAIL_COND(!String(signal.name).is_valid_identifier(),
|
||||||
|
"Signal name is not a valid identifier: '", exposed_class.name, ".", signal.name, "'.");
|
||||||
|
|
||||||
int argc = method_info.arguments.size();
|
int argc = method_info.arguments.size();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue