Browse Source

fix compare_vec3 test: use D_TOL-compatible values, remove redundant section

test-refactor
cinnaboot 2 months ago
parent
commit
287a6bbb03
  1. 10
      tests/test_physics_utilities.cpp

10
tests/test_physics_utilities.cpp

@ -207,8 +207,8 @@ SCENARIO("Rotation matrices", "[physics][utilities][rotation]") {
SCENARIO("compare_vec3 utility", "[physics][utilities][compare]") {
SECTION("equal vectors within tolerance") {
const Vec3 a = {1.0, 2.0, 3.0};
const Vec3 b = {1.0001, 2.0001, 3.0001};
REQUIRE(compare_vec3(a, b, 1e-3));
const Vec3 b = {1.0 + 1e-13, 2.0 + 1e-13, 3.0 + 1e-13};
REQUIRE(compare_vec3(a, b, D_TOL));
}
SECTION("equal vectors exactly") {
@ -222,10 +222,4 @@ SCENARIO("compare_vec3 utility", "[physics][utilities][compare]") {
const Vec3 b = {2.0, 2.0, 3.0};
REQUIRE(!compare_vec3(a, b, 0.5));
}
SECTION("zero vector comparison") {
const Vec3 a = {0.0, 0.0, 0.0};
const Vec3 b = {0.0, 0.0, 0.0};
REQUIRE(compare_vec3(a, b, 0.0));
}
}

Loading…
Cancel
Save