summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-07-26 11:52:26 +0200
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-08-31 15:01:09 +0200
commit194bdde94787227e8f53a4e3273c192ab70b03ac (patch)
treec5e9d87fae1c8eb2af98ab34d687bd8c5a4a18d5 /tests
parent61598c5c88d95b96811d386cb20d714c35f4c6d7 (diff)
downloadredot-engine-194bdde94787227e8f53a4e3273c192ab70b03ac.tar.gz
Cleanup of raw `nullptr` checks with `Ref`
Using `is_valid/null` over checks with `nullptr` or `ERR_FAIL_NULL` etc.
Diffstat (limited to 'tests')
-rw-r--r--tests/core/io/test_http_client.h2
-rw-r--r--tests/scene/test_path_2d.h2
-rw-r--r--tests/scene/test_path_3d.h2
-rw-r--r--tests/scene/test_primitives.h6
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/core/io/test_http_client.h b/tests/core/io/test_http_client.h
index 961c653a0a..114ce3b4ed 100644
--- a/tests/core/io/test_http_client.h
+++ b/tests/core/io/test_http_client.h
@@ -41,7 +41,7 @@ namespace TestHTTPClient {
TEST_CASE("[HTTPClient] Instantiation") {
Ref<HTTPClient> client = HTTPClient::create();
- CHECK_MESSAGE(client != nullptr, "A HTTP Client created should not be a null pointer");
+ CHECK_MESSAGE(client.is_valid(), "A HTTP Client created should not be a null pointer");
}
TEST_CASE("[HTTPClient] query_string_from_dict") {
diff --git a/tests/scene/test_path_2d.h b/tests/scene/test_path_2d.h
index 7b6cec96db..4703bfa3bb 100644
--- a/tests/scene/test_path_2d.h
+++ b/tests/scene/test_path_2d.h
@@ -40,7 +40,7 @@ namespace TestPath2D {
TEST_CASE("[SceneTree][Path2D] Initialization") {
SUBCASE("Path should be empty right after initialization") {
Path2D *test_path = memnew(Path2D);
- CHECK(test_path->get_curve() == nullptr);
+ CHECK(test_path->get_curve().is_null());
memdelete(test_path);
}
}
diff --git a/tests/scene/test_path_3d.h b/tests/scene/test_path_3d.h
index f779f514a4..70c7099d48 100644
--- a/tests/scene/test_path_3d.h
+++ b/tests/scene/test_path_3d.h
@@ -40,7 +40,7 @@ namespace TestPath3D {
TEST_CASE("[Path3D] Initialization") {
SUBCASE("Path should be empty right after initialization") {
Path3D *test_path = memnew(Path3D);
- CHECK(test_path->get_curve() == nullptr);
+ CHECK(test_path->get_curve().is_null());
memdelete(test_path);
}
}
diff --git a/tests/scene/test_primitives.h b/tests/scene/test_primitives.h
index f105e1ac04..59f23983e5 100644
--- a/tests/scene/test_primitives.h
+++ b/tests/scene/test_primitives.h
@@ -609,7 +609,7 @@ TEST_CASE("[SceneTree][Primitive][TubeTrail] TubeTrail Primitive") {
CHECK(tube->get_sections() >= 0);
CHECK(tube->get_section_length() > 0);
CHECK(tube->get_section_rings() >= 0);
- CHECK(tube->get_curve() == nullptr);
+ CHECK(tube->get_curve().is_null());
CHECK(tube->get_builtin_bind_pose_count() >= 0);
}
@@ -669,7 +669,7 @@ TEST_CASE("[SceneTree][Primitive][RibbonTrail] RibbonTrail Primitive") {
CHECK(ribbon->get_section_length() > 0);
CHECK(ribbon->get_section_segments() >= 0);
CHECK(ribbon->get_builtin_bind_pose_count() >= 0);
- CHECK(ribbon->get_curve() == nullptr);
+ CHECK(ribbon->get_curve().is_null());
CHECK((ribbon->get_shape() == RibbonTrailMesh::SHAPE_CROSS ||
ribbon->get_shape() == RibbonTrailMesh::SHAPE_FLAT));
}
@@ -731,7 +731,7 @@ TEST_CASE("[SceneTree][Primitive][Text] Text Primitive") {
text->get_vertical_alignment() == VERTICAL_ALIGNMENT_TOP ||
text->get_vertical_alignment() == VERTICAL_ALIGNMENT_CENTER ||
text->get_vertical_alignment() == VERTICAL_ALIGNMENT_FILL));
- CHECK(text->get_font() == nullptr);
+ CHECK(text->get_font().is_null());
CHECK(text->get_font_size() > 0);
CHECK(text->get_line_spacing() >= 0);
CHECK((text->get_autowrap_mode() == TextServer::AUTOWRAP_OFF ||