diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-03 16:13:55 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-03 16:13:55 +0200 |
commit | d15de6f264bc3659310c19bc402a432e2ea896e3 (patch) | |
tree | deb293154752257941ca8852de4eec167ff9d3b7 /tests | |
parent | b104f218410669ec81ec9ffd4d8833b8aa30a554 (diff) | |
parent | 194bdde94787227e8f53a4e3273c192ab70b03ac (diff) | |
download | redot-engine-d15de6f264bc3659310c19bc402a432e2ea896e3.tar.gz |
Merge pull request #96292 from AThousandShips/null_check_ref_fix
Cleanup of raw `nullptr` checks with `Ref`
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/io/test_http_client.h | 2 | ||||
-rw-r--r-- | tests/scene/test_path_2d.h | 2 | ||||
-rw-r--r-- | tests/scene/test_path_3d.h | 2 | ||||
-rw-r--r-- | tests/scene/test_primitives.h | 6 |
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 || |