summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Haller <bromeon@gmail.com>2023-01-23 20:21:50 +0100
committerJan Haller <bromeon@gmail.com>2023-01-23 21:19:57 +0100
commit83026126d41f6f5ef44ee1269235b6f7121dc8a9 (patch)
tree5ff21fffd6c2f011f079b2650aa0ae7218ec902d
parent15686ca786a0fbbafb2d812f62b7c36bed91e774 (diff)
Add tests to ensure bound methods and signals are valid identifiers
-rw-r--r--tests/core/object/test_class_db.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/core/object/test_class_db.h b/tests/core/object/test_class_db.h
index eeb1648924..e68995e539 100644
--- a/tests/core/object/test_class_db.h
+++ b/tests/core/object/test_class_db.h
@@ -559,6 +559,8 @@ void add_exposed_classes(Context &r_context) {
MethodData method;
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) {
method.is_virtual = true;
@@ -682,6 +684,8 @@ void add_exposed_classes(Context &r_context) {
const MethodInfo &method_info = signal_map.get(K.key);
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();