diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scene/test_primitives.h | 18 | ||||
-rw-r--r-- | tests/servers/test_navigation_server_3d.h | 2 | ||||
-rw-r--r-- | tests/test_macros.h | 2 |
3 files changed, 14 insertions, 8 deletions
diff --git a/tests/scene/test_primitives.h b/tests/scene/test_primitives.h index cab37388fc..ad1a8e8440 100644 --- a/tests/scene/test_primitives.h +++ b/tests/scene/test_primitives.h @@ -106,8 +106,9 @@ TEST_CASE("[SceneTree][Primitive][Capsule] Capsule Primitive") { float dist_to_yaxis = 0.f; for (Vector3 point : points) { float new_dist_to_y = point.x * point.x + point.z * point.z; - if (new_dist_to_y > dist_to_yaxis) + if (new_dist_to_y > dist_to_yaxis) { dist_to_yaxis = new_dist_to_y; + } } CHECK(dist_to_yaxis <= radius * radius); @@ -116,10 +117,12 @@ TEST_CASE("[SceneTree][Primitive][Capsule] Capsule Primitive") { float max_y{ 0.f }; float min_y{ 0.f }; for (Vector3 point : points) { - if (point.y > max_y) + if (point.y > max_y) { max_y = point.y; - if (point.y < min_y) + } + if (point.y < min_y) { min_y = point.y; + } } CHECK(max_y - min_y <= height); @@ -198,12 +201,14 @@ TEST_CASE("[SceneTree][Primitive][Box] Box Primitive") { for (const Vector3 &normal : normals) { bool add_normal{ true }; for (const Vector3 &vec : distinct_normals) { - if (vec.is_equal_approx(normal)) + if (vec.is_equal_approx(normal)) { add_normal = false; + } } - if (add_normal) + if (add_normal) { distinct_normals.push_back(normal); + } } CHECK_MESSAGE(distinct_normals.size() == 6, @@ -220,8 +225,9 @@ TEST_CASE("[SceneTree][Primitive][Box] Box Primitive") { break; } } - if (!normal_correct_direction) + if (!normal_correct_direction) { break; + } } CHECK_MESSAGE(normal_correct_direction, diff --git a/tests/servers/test_navigation_server_3d.h b/tests/servers/test_navigation_server_3d.h index f2863248eb..f622aac6ad 100644 --- a/tests/servers/test_navigation_server_3d.h +++ b/tests/servers/test_navigation_server_3d.h @@ -51,7 +51,7 @@ public: } unsigned function1_calls{ 0 }; - Variant function1_latest_arg0{}; + Variant function1_latest_arg0; }; static inline Array build_array() { diff --git a/tests/test_macros.h b/tests/test_macros.h index a736030293..3cfe8dac37 100644 --- a/tests/test_macros.h +++ b/tests/test_macros.h @@ -476,6 +476,6 @@ public: for (int i = 0; i < string_list.size(); ++i) { \ CHECK(string_list[i] == m_slices[i]); \ } \ - } while (0) + } while (false) #endif // TEST_MACROS_H |