summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/core/string/test_node_path.h22
-rw-r--r--tests/core/variant/test_array.h2
-rw-r--r--tests/test_main.cpp17
3 files changed, 28 insertions, 13 deletions
diff --git a/tests/core/string/test_node_path.h b/tests/core/string/test_node_path.h
index b0c810bb54..031a33c570 100644
--- a/tests/core/string/test_node_path.h
+++ b/tests/core/string/test_node_path.h
@@ -98,44 +98,44 @@ TEST_CASE("[NodePath] Relative path") {
}
TEST_CASE("[NodePath] Absolute path") {
- const NodePath node_path_aboslute = NodePath("/root/Sprite2D");
+ const NodePath node_path_absolute = NodePath("/root/Sprite2D");
CHECK_MESSAGE(
- node_path_aboslute.get_as_property_path() == NodePath(":root/Sprite2D"),
+ node_path_absolute.get_as_property_path() == NodePath(":root/Sprite2D"),
"The returned property path should match the expected value.");
CHECK_MESSAGE(
- node_path_aboslute.get_concatenated_subnames() == "",
+ node_path_absolute.get_concatenated_subnames() == "",
"The returned concatenated subnames should match the expected value.");
CHECK_MESSAGE(
- node_path_aboslute.get_name(0) == "root",
+ node_path_absolute.get_name(0) == "root",
"The returned name at index 0 should match the expected value.");
CHECK_MESSAGE(
- node_path_aboslute.get_name(1) == "Sprite2D",
+ node_path_absolute.get_name(1) == "Sprite2D",
"The returned name at index 1 should match the expected value.");
ERR_PRINT_OFF;
CHECK_MESSAGE(
- node_path_aboslute.get_name(2) == "",
+ node_path_absolute.get_name(2) == "",
"The returned name at invalid index 2 should match the expected value.");
CHECK_MESSAGE(
- node_path_aboslute.get_name(-1) == "",
+ node_path_absolute.get_name(-1) == "",
"The returned name at invalid index -1 should match the expected value.");
ERR_PRINT_ON;
CHECK_MESSAGE(
- node_path_aboslute.get_name_count() == 2,
+ node_path_absolute.get_name_count() == 2,
"The returned number of names should match the expected value.");
CHECK_MESSAGE(
- node_path_aboslute.get_subname_count() == 0,
+ node_path_absolute.get_subname_count() == 0,
"The returned number of subnames should match the expected value.");
CHECK_MESSAGE(
- node_path_aboslute.is_absolute(),
+ node_path_absolute.is_absolute(),
"The node path should be considered absolute.");
CHECK_MESSAGE(
- !node_path_aboslute.is_empty(),
+ !node_path_absolute.is_empty(),
"The node path shouldn't be considered empty.");
}
diff --git a/tests/core/variant/test_array.h b/tests/core/variant/test_array.h
index 228d77b3b5..ea61ae2a02 100644
--- a/tests/core/variant/test_array.h
+++ b/tests/core/variant/test_array.h
@@ -367,7 +367,7 @@ TEST_CASE("[Array] Duplicate recursive array") {
Array a_shallow = a.duplicate(false);
CHECK_EQ(a, a_shallow);
- // Deep copy of recursive array endup with recursion limit and return
+ // Deep copy of recursive array ends up with recursion limit and return
// an invalid result (multiple nested arrays), the point is we should
// not end up with a segfault and an error log should be printed
ERR_PRINT_OFF;
diff --git a/tests/test_main.cpp b/tests/test_main.cpp
index 07ea9a3cd6..7f49805274 100644
--- a/tests/test_main.cpp
+++ b/tests/test_main.cpp
@@ -30,6 +30,8 @@
#include "test_main.h"
+#include "editor/editor_paths.h"
+#include "editor/editor_settings.h"
#include "tests/core/config/test_project_settings.h"
#include "tests/core/input/test_input_event.h"
#include "tests/core/input/test_input_event_key.h"
@@ -224,7 +226,7 @@ struct GodotTestCaseListener : public doctest::IReporter {
String name = String(p_in.m_name);
String suite_name = String(p_in.m_test_suite);
- if (name.find("[SceneTree]") != -1) {
+ if (name.find("[SceneTree]") != -1 || name.find("[Editor]") != -1) {
memnew(MessageQueue);
memnew(Input);
@@ -267,6 +269,13 @@ struct GodotTestCaseListener : public doctest::IReporter {
if (!DisplayServer::get_singleton()->has_feature(DisplayServer::Feature::FEATURE_SUBWINDOWS)) {
SceneTree::get_singleton()->get_root()->set_embedding_subwindows(true);
}
+
+ if (name.find("[Editor]") != -1) {
+ Engine::get_singleton()->set_editor_hint(true);
+ EditorPaths::create();
+ EditorSettings::create();
+ }
+
return;
}
@@ -289,6 +298,12 @@ struct GodotTestCaseListener : public doctest::IReporter {
}
void test_case_end(const doctest::CurrentTestCaseStats &) override {
+ if (EditorSettings::get_singleton()) {
+ EditorSettings::destroy();
+ }
+
+ Engine::get_singleton()->set_editor_hint(false);
+
if (SceneTree::get_singleton()) {
SceneTree::get_singleton()->finalize();
}