Merge pull request #94798 from AThousandShips/api_check_args
[Tests] Add check for argument name validity
This commit is contained in:
@ -414,6 +414,9 @@ void validate_argument(const Context &p_context, const ExposedClass &p_class, co
|
|||||||
#ifdef DEBUG_METHODS_ENABLED
|
#ifdef DEBUG_METHODS_ENABLED
|
||||||
TEST_COND((p_arg.name.is_empty() || p_arg.name.begins_with("_unnamed_arg")),
|
TEST_COND((p_arg.name.is_empty() || p_arg.name.begins_with("_unnamed_arg")),
|
||||||
vformat("Unnamed argument in position %d of %s '%s.%s'.", p_arg.position, p_owner_type, p_class.name, p_owner_name));
|
vformat("Unnamed argument in position %d of %s '%s.%s'.", p_arg.position, p_owner_type, p_class.name, p_owner_name));
|
||||||
|
|
||||||
|
TEST_FAIL_COND((p_arg.name != "@varargs@" && !p_arg.name.is_valid_ascii_identifier()),
|
||||||
|
vformat("Invalid argument name '%s' of %s '%s.%s'.", p_arg.name, p_owner_type, p_class.name, p_owner_name));
|
||||||
#endif // DEBUG_METHODS_ENABLED
|
#endif // DEBUG_METHODS_ENABLED
|
||||||
|
|
||||||
const ExposedClass *arg_class = p_context.find_exposed_class(p_arg.type);
|
const ExposedClass *arg_class = p_context.find_exposed_class(p_arg.type);
|
||||||
|
|||||||
Reference in New Issue
Block a user