diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/input/test_input_event_key.h | 7 | ||||
-rw-r--r-- | tests/core/math/test_geometry_3d.h | 8 | ||||
-rw-r--r-- | tests/core/object/test_class_db.h | 4 | ||||
-rw-r--r-- | tests/scene/test_code_edit.h | 2 |
4 files changed, 12 insertions, 9 deletions
diff --git a/tests/core/input/test_input_event_key.h b/tests/core/input/test_input_event_key.h index 697215bab7..3317941fad 100644 --- a/tests/core/input/test_input_event_key.h +++ b/tests/core/input/test_input_event_key.h @@ -106,11 +106,11 @@ TEST_CASE("[InputEventKey] Key correctly converts itself to text") { // Key is None without a physical key. none_key.set_keycode(Key::NONE); - CHECK(none_key.as_text() == " (Physical)"); + CHECK(none_key.as_text() == "(Unset)"); // Key is none and has modifiers. none_key.set_ctrl_pressed(true); - CHECK(none_key.as_text() == "Ctrl+ (Physical)"); + CHECK(none_key.as_text() == "Ctrl+(Unset)"); // Key is None WITH a physical key AND modifiers. none_key.set_physical_keycode(Key::ENTER); @@ -144,8 +144,7 @@ TEST_CASE("[InputEventKey] Key correctly converts itself to text") { TEST_CASE("[InputEventKey] Key correctly converts its state to a string representation") { InputEventKey none_key; - // Set physical to true. - CHECK(none_key.to_string() == "InputEventKey: keycode=0 (), mods=none, physical=true, pressed=false, echo=false"); + CHECK(none_key.to_string() == "InputEventKey: keycode=(Unset), mods=none, physical=false, pressed=false, echo=false"); // Set physical key to Escape. none_key.set_physical_keycode(Key::ESCAPE); CHECK(none_key.to_string() == "InputEventKey: keycode=4194305 (Escape), mods=none, physical=true, pressed=false, echo=false"); diff --git a/tests/core/math/test_geometry_3d.h b/tests/core/math/test_geometry_3d.h index 8d57bd5319..46a99aa4b6 100644 --- a/tests/core/math/test_geometry_3d.h +++ b/tests/core/math/test_geometry_3d.h @@ -388,13 +388,13 @@ TEST_CASE("[Geometry3D] Segment Intersects Triangle") { TEST_CASE("[Geometry3D] Triangle and Box Overlap") { struct Case { - Vector3 box_centre; + Vector3 box_center; Vector3 box_half_size; Vector3 *tri_verts = nullptr; bool want; Case(){}; - Case(Vector3 p_centre, Vector3 p_half_size, Vector3 *p_verts, bool p_want) : - box_centre(p_centre), box_half_size(p_half_size), tri_verts(p_verts), want(p_want){}; + Case(Vector3 p_center, Vector3 p_half_size, Vector3 *p_verts, bool p_want) : + box_center(p_center), box_half_size(p_half_size), tri_verts(p_verts), want(p_want){}; }; Vector<Case> tt; Vector3 GoodTriangle[3] = { Vector3(3, 2, 3), Vector3(2, 2, 1), Vector3(2, 1, 1) }; @@ -403,7 +403,7 @@ TEST_CASE("[Geometry3D] Triangle and Box Overlap") { tt.push_back(Case(Vector3(1000, 1000, 1000), Vector3(1, 1, 1), BadTriangle, false)); for (int i = 0; i < tt.size(); ++i) { Case current_case = tt[i]; - bool output = Geometry3D::triangle_box_overlap(current_case.box_centre, current_case.box_half_size, current_case.tri_verts); + bool output = Geometry3D::triangle_box_overlap(current_case.box_center, current_case.box_half_size, current_case.tri_verts); CHECK(output == current_case.want); } } 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(); diff --git a/tests/scene/test_code_edit.h b/tests/scene/test_code_edit.h index e98aece305..828029dabe 100644 --- a/tests/scene/test_code_edit.h +++ b/tests/scene/test_code_edit.h @@ -2773,7 +2773,7 @@ TEST_CASE("[SceneTree][CodeEdit] completion") { CHECK(code_edit->get_line(0) == "''"); CHECK(code_edit->get_caret_column() == 1); - /* Move out from centre, Should match and insert larger key. */ + /* Move out from center, Should match and insert larger key. */ SEND_GUI_ACTION(code_edit, "ui_text_caret_right"); SEND_GUI_KEY_EVENT(code_edit, Key::APOSTROPHE); CHECK(code_edit->get_line(0) == "''''''"); |