diff --git a/tests/tests_pose.cpp b/tests/tests_pose.cpp index 98bbd1b4d..0fdaa2289 100644 --- a/tests/tests_pose.cpp +++ b/tests/tests_pose.cpp @@ -56,11 +56,12 @@ TEST_CASE("Pose interpolation works") struct xrt_pose res = {}; math_pose_interpolate(&a, &b, 0.5, &res); - CHECK(res.position.x == Approx(0)); - CHECK(res.position.y == Approx(0)); - CHECK(res.position.z == Approx(0)); - CHECK(res.orientation.x == Approx(0)); - CHECK(res.orientation.x == Approx(0)); - CHECK(res.orientation.y == Approx(0)); - CHECK(res.orientation.w == Approx(1)); + float e = std::numeric_limits::epsilon(); + CHECK(res.position.x == Approx(0).margin(e)); + CHECK(res.position.y == Approx(0).margin(e)); + CHECK(res.position.z == Approx(0).margin(e)); + CHECK(res.orientation.x == Approx(0).margin(e)); + CHECK(res.orientation.x == Approx(0).margin(e)); + CHECK(res.orientation.y == Approx(0).margin(e)); + CHECK(res.orientation.w == Approx(1).margin(e)); }