Fix various errors when running the unit tests
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
This commit is contained in:
@ -487,13 +487,13 @@ void add_exposed_classes(Context &r_context) {
|
||||
}
|
||||
|
||||
if (!ClassDB::is_class_exposed(class_name)) {
|
||||
MESSAGE(vformat("Ignoring class '%s' because it's not exposed.", class_name));
|
||||
INFO(vformat("Ignoring class '%s' because it's not exposed.", class_name));
|
||||
class_list.pop_front();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!ClassDB::is_class_enabled(class_name)) {
|
||||
MESSAGE(vformat("Ignoring class '%s' because it's not enabled.", class_name));
|
||||
INFO(vformat("Ignoring class '%s' because it's not enabled.", class_name));
|
||||
class_list.pop_front();
|
||||
continue;
|
||||
}
|
||||
@ -717,15 +717,10 @@ void add_exposed_classes(Context &r_context) {
|
||||
|
||||
bool method_conflict = exposed_class.find_property_by_name(signal.name);
|
||||
|
||||
// TODO:
|
||||
// ClassDB allows signal names that conflict with method or property names.
|
||||
// However registering a signal with a conflicting name is still considered wrong.
|
||||
// Unfortunately there are some existing cases that are yet to be fixed.
|
||||
// Until those are fixed we will print a warning instead of failing the test.
|
||||
String warn_msg = vformat(
|
||||
"Signal name conflicts with %s: '%s.%s.",
|
||||
method_conflict ? "method" : "property", class_name, signal.name);
|
||||
TEST_FAIL_COND_WARN((method_conflict || exposed_class.find_method_by_name(signal.name)),
|
||||
TEST_FAIL_COND((method_conflict || exposed_class.find_method_by_name(signal.name)),
|
||||
warn_msg.utf8().get_data());
|
||||
|
||||
exposed_class.signals_.push_back(signal);
|
||||
|
||||
@ -3482,9 +3482,9 @@ TEST_CASE("[SceneTree][CodeEdit] symbol lookup") {
|
||||
SIGNAL_CHECK("symbol_validate", signal_args);
|
||||
|
||||
SIGNAL_UNWATCH(code_edit, "symbol_validate");
|
||||
|
||||
memdelete(code_edit);
|
||||
}
|
||||
|
||||
memdelete(code_edit);
|
||||
}
|
||||
|
||||
TEST_CASE("[SceneTree][CodeEdit] line length guidelines") {
|
||||
|
||||
@ -221,7 +221,9 @@ TEST_CASE("[SceneTree][Viewport] Controls and InputEvent handling") {
|
||||
}
|
||||
|
||||
SUBCASE("[Viewport][GuiInputEvent] nullptr as argument doesn't lead to a crash.") {
|
||||
ERR_PRINT_OFF;
|
||||
CHECK_NOTHROW(root->push_input(nullptr));
|
||||
ERR_PRINT_ON;
|
||||
}
|
||||
|
||||
// Unit tests for Viewport::_gui_input_event (Mouse Buttons)
|
||||
|
||||
@ -147,7 +147,7 @@ int register_test_command(String p_command, TestFunc p_function);
|
||||
{ \
|
||||
const List<Ref<InputEvent>> *events = InputMap::get_singleton()->action_get_events(m_action); \
|
||||
const List<Ref<InputEvent>>::Element *first_event = events->front(); \
|
||||
Ref<InputEventKey> event = first_event->get(); \
|
||||
Ref<InputEventKey> event = first_event->get()->duplicate(); \
|
||||
event->set_pressed(true); \
|
||||
_SEND_DISPLAYSERVER_EVENT(event); \
|
||||
MessageQueue::get_singleton()->flush(); \
|
||||
|
||||
@ -255,8 +255,8 @@ struct GodotTestCaseListener : public doctest::IReporter {
|
||||
}
|
||||
|
||||
if (suite_name.find("[Navigation]") != -1 && navigation_server_2d == nullptr && navigation_server_3d == nullptr) {
|
||||
navigation_server_2d = memnew(NavigationServer2D);
|
||||
navigation_server_3d = NavigationServer3DManager::new_default_server();
|
||||
navigation_server_2d = memnew(NavigationServer2D);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user