summaryrefslogtreecommitdiff
path: root/tests/scene/test_theme.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scene/test_theme.h')
-rw-r--r--tests/scene/test_theme.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/scene/test_theme.h b/tests/scene/test_theme.h
index f7cfa0fd5b..f5b21eec32 100644
--- a/tests/scene/test_theme.h
+++ b/tests/scene/test_theme.h
@@ -101,18 +101,24 @@ TEST_CASE_FIXTURE(Fixture, "[Theme] Good theme type names") {
SUBCASE("set_type_variation") {
for (const StringName &name : names) {
+ if (name == StringName()) { // Skip empty here, not allowed.
+ continue;
+ }
Ref<Theme> theme = memnew(Theme);
ErrorDetector ed;
theme->set_type_variation(valid_type_name, name);
- CHECK(ed.has_error == (name == StringName()));
+ CHECK_FALSE(ed.has_error);
}
for (const StringName &name : names) {
+ if (name == StringName()) { // Skip empty here, not allowed.
+ continue;
+ }
Ref<Theme> theme = memnew(Theme);
ErrorDetector ed;
theme->set_type_variation(name, valid_type_name);
- CHECK(ed.has_error == (name == StringName()));
+ CHECK_FALSE(ed.has_error);
}
}
}
@@ -125,6 +131,8 @@ TEST_CASE_FIXTURE(Fixture, "[Theme] Bad theme type names") {
String::utf8("contains_汉字"),
};
+ ERR_PRINT_OFF; // All these rightfully print errors.
+
SUBCASE("add_type") {
for (const StringName &name : names) {
Ref<Theme> theme = memnew(Theme);
@@ -175,6 +183,8 @@ TEST_CASE_FIXTURE(Fixture, "[Theme] Bad theme type names") {
CHECK(ed.has_error);
}
}
+
+ ERR_PRINT_ON;
}
TEST_CASE_FIXTURE(Fixture, "[Theme] Good theme item names") {
@@ -223,6 +233,8 @@ TEST_CASE_FIXTURE(Fixture, "[Theme] Bad theme item names") {
String::utf8("contains_汉字"),
};
+ ERR_PRINT_OFF; // All these rightfully print errors.
+
SUBCASE("set_theme_item") {
for (const StringName &name : names) {
for (const DataEntry &entry : valid_data) {
@@ -250,6 +262,8 @@ TEST_CASE_FIXTURE(Fixture, "[Theme] Bad theme item names") {
}
}
}
+
+ ERR_PRINT_ON;
}
} // namespace TestTheme