From d6b39b8c345c2d37fdc32b786b42b93e66c36535 Mon Sep 17 00:00:00 2001 From: Eli Rykoff Date: Mon, 21 Aug 2023 08:05:17 -0700 Subject: [PATCH] Add tolerances to all Box3dBounds checks. --- tests/testBox.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testBox.cc b/tests/testBox.cc index 08ddfba..4332ccb 100644 --- a/tests/testBox.cc +++ b/tests/testBox.cc @@ -385,14 +385,14 @@ TEST_CASE(Box3dBounds) { b = Box::fromRadians(0.25 * PI, -0.25 * PI, 1.25 * PI, 0.25 * PI); bb = b.getBoundingBox3d(); CHECK(bb.x().getA() == -1); - CHECK(bb.x().getB() >= 0.5 * std::sqrt(2.0)); + CHECK(bb.x().getB() >= 0.5 * std::sqrt(2.0) - TOLERANCE); CHECK(bb.x().getB() <= 0.5 * std::sqrt(2.0) + TOLERANCE); CHECK(bb.y().getA() >= -0.5 * std::sqrt(2.0) - TOLERANCE); - CHECK(bb.y().getA() <= -0.5 * std::sqrt(2.0)); + CHECK(bb.y().getA() <= -0.5 * std::sqrt(2.0) + TOLERANCE); CHECK(bb.y().getB() == 1); CHECK(bb.z().getA() >= -0.5 * std::sqrt(2.0) - TOLERANCE); - CHECK(bb.z().getA() <= -0.5 * std::sqrt(2.0)); - CHECK(bb.z().getB() >= 0.5 * std::sqrt(2.0)); + CHECK(bb.z().getA() <= -0.5 * std::sqrt(2.0) + TOLERANCE); + CHECK(bb.z().getB() >= 0.5 * std::sqrt(2.0) - TOLERANCE); CHECK(bb.z().getB() <= 0.5 * std::sqrt(2.0) + TOLERANCE); }