mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-27 09:01:46 +00:00
tests: Add explicit margin to Approx in tests_pose
To avoid an issue with catch2::Approx defaults applied around 0 See https://github.com/catchorg/Catch2/issues/1079
This commit is contained in:
parent
217c9749dc
commit
d0b00c7d23
|
@ -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<float>::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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue