Skip to content

Commit

Permalink
Add tolerances to all Box3dBounds checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed Aug 21, 2023
1 parent 877625a commit f087b03
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/testBox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
/// \brief This file contains tests for the Box class.

#include <memory>
// #include <iostream>
#include "stdio.h"

#include "lsst/sphgeom/Box.h"
#include "lsst/sphgeom/Box3d.h"
Expand Down Expand Up @@ -385,14 +387,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);
}

Expand Down

0 comments on commit f087b03

Please sign in to comment.