From 137e45121a08fc077903a37c22a7ca0cd512277c Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Tue, 5 May 2026 10:19:01 -0400 Subject: [PATCH] refactor: use compare_vec3 for 3-component assertions --- tests/test_physics_utilities.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/test_physics_utilities.cpp b/tests/test_physics_utilities.cpp index dbdeea3..49266f4 100644 --- a/tests/test_physics_utilities.cpp +++ b/tests/test_physics_utilities.cpp @@ -12,23 +12,17 @@ SCENARIO("Vector math utilities", "[physics][utilities][vector]") { SECTION("add") { const Vec3 sum = vec3_add(a, b); - REQUIRE_THAT(sum.x, WithinAbs(5.0, R_TOL)); - REQUIRE_THAT(sum.y, WithinAbs(7.0, R_TOL)); - REQUIRE_THAT(sum.z, WithinAbs(9.0, R_TOL)); + REQUIRE(compare_vec3(sum, {5.0, 7.0, 9.0}, R_TOL)); } SECTION("sub") { const Vec3 diff = vec3_sub(b, a); - REQUIRE_THAT(diff.x, WithinAbs(3.0, R_TOL)); - REQUIRE_THAT(diff.y, WithinAbs(3.0, R_TOL)); - REQUIRE_THAT(diff.z, WithinAbs(3.0, R_TOL)); + REQUIRE(compare_vec3(diff, {3.0, 3.0, 3.0}, R_TOL)); } SECTION("scale") { const Vec3 scaled = vec3_scale(a, 2.0); - REQUIRE_THAT(scaled.x, WithinAbs(2.0, R_TOL)); - REQUIRE_THAT(scaled.y, WithinAbs(4.0, R_TOL)); - REQUIRE_THAT(scaled.z, WithinAbs(6.0, R_TOL)); + REQUIRE(compare_vec3(scaled, {2.0, 4.0, 6.0}, R_TOL)); } SECTION("magnitude") {