summaryrefslogtreecommitdiffstats
path: root/tests/scene/test_primitives.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scene/test_primitives.h')
-rw-r--r--tests/scene/test_primitives.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/scene/test_primitives.h b/tests/scene/test_primitives.h
index 59f23983e5..7426a9ce29 100644
--- a/tests/scene/test_primitives.h
+++ b/tests/scene/test_primitives.h
@@ -104,8 +104,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);
@@ -114,10 +115,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);
@@ -196,12 +199,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,
@@ -218,8 +223,9 @@ TEST_CASE("[SceneTree][Primitive][Box] Box Primitive") {
break;
}
}
- if (!normal_correct_direction)
+ if (!normal_correct_direction) {
break;
+ }
}
CHECK_MESSAGE(normal_correct_direction,