Skip to content

Commit

Permalink
chore(tests): brush over surface tests (acts-project#3783)
Browse files Browse the repository at this point in the history
- removed `Tests/UnitTests/Core/Surfaces/BoundaryToleranceTestsRefs.hpp` because it was unused.
- fixed typo in the testing numbers in `Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp`
- enable tests, that were planned but not finished back in the days
  • Loading branch information
AJPfleger authored Oct 27, 2024
1 parent 2e641cd commit a5d5633
Show file tree
Hide file tree
Showing 28 changed files with 858 additions and 961 deletions.
7 changes: 4 additions & 3 deletions Tests/UnitTests/Core/Surfaces/AlignmentHelperTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <algorithm>
#include <cmath>
#include <numbers>
#include <utility>

namespace Acts::Test {
Expand All @@ -23,9 +24,9 @@ namespace Acts::Test {
BOOST_AUTO_TEST_CASE(alignment_helper_test) {
// (a) Test with non-identity rotation matrix
// Rotation angle parameters
const double alpha = M_PI;
const double beta = 0;
const double gamma = M_PI / 2;
const double alpha = std::numbers::pi;
const double beta = 0.;
const double gamma = std::numbers::pi / 2.;
// rotation around x axis
AngleAxis3 rotX(alpha, Vector3(1., 0., 0.));
// rotation around y axis
Expand Down
17 changes: 8 additions & 9 deletions Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ namespace Acts::Test {

BOOST_AUTO_TEST_SUITE(Surfaces)

ActsScalar minRadius = 7.2;
ActsScalar maxRadius = 12.0;
ActsScalar minPhi = 0.74195;
ActsScalar maxPhi = 1.33970;
const ActsScalar minRadius = 7.2;
const ActsScalar maxRadius = 12.0;
const ActsScalar minPhi = 0.74195;
const ActsScalar maxPhi = 1.33970;

Vector2 offset(-2., 2.);
const Vector2 offset(-2., 2.);

// Unit tests for AnnulusBounds constructors
BOOST_AUTO_TEST_CASE(AnnulusBoundsConstruction) {
Expand Down Expand Up @@ -60,13 +60,13 @@ BOOST_AUTO_TEST_CASE(AnnulusBoundsExcpetion) {
// Exception for swapped radii
BOOST_CHECK_THROW(AnnulusBounds(maxRadius, minRadius, minPhi, maxPhi, offset),
std::logic_error);
// Exception for out of range min phi
// Exception for out of range min phi
BOOST_CHECK_THROW(AnnulusBounds(minRadius, maxRadius, -4., maxPhi, offset),
std::logic_error);
// Exception for out of range max phi
// Exception for out of range max phi
BOOST_CHECK_THROW(AnnulusBounds(minRadius, maxRadius, minPhi, 4., offset),
std::logic_error);
// Exception for out of range max phi
// Exception for out of range max phi
BOOST_CHECK_THROW(AnnulusBounds(minRadius, maxRadius, maxPhi, minPhi, offset),
std::logic_error);
}
Expand All @@ -76,7 +76,6 @@ BOOST_AUTO_TEST_CASE(AnnulusBoundsProperties) {
/// Test construction with radii and default sector
AnnulusBounds aBounds(minRadius, maxRadius, minPhi, maxPhi, offset);

//
/// Test type() (redundant; already used in constructor confirmation)
BOOST_CHECK_EQUAL(aBounds.type(), SurfaceBounds::eAnnulus);

Expand Down
7 changes: 3 additions & 4 deletions Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#include <optional>
#include <vector>

#include "BoundaryToleranceTestsRefs.hpp"

namespace Acts::Test {

BOOST_AUTO_TEST_SUITE(Surfaces)
Expand All @@ -42,6 +40,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckBoxSimple) {
BOOST_CHECK(
!detail::insideAlignedBox(ll, ur, tolerance, {2, 0}, std::nullopt));
}

// Aligned box w/ tolerance check along first axis
BOOST_AUTO_TEST_CASE(BoundaryCheckBoxToleranceLoc0) {
boost::execution_monitor em;
Expand Down Expand Up @@ -73,7 +72,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckBoxCovariance) {
cov << 1, 0.5, 0.5, 2;
Vector2 ll(-1, -1);
Vector2 ur(1, 1);
auto tolerance = BoundaryTolerance::Chi2Bound(cov.inverse(), 3.0);
auto tolerance = BoundaryTolerance::Chi2Bound(cov.inverse(), 3.);
BOOST_CHECK(
detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt));
BOOST_CHECK(
Expand Down Expand Up @@ -190,7 +189,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) {

{
auto tolerance =
BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), 1.0);
BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), 1.);
BOOST_CHECK(
detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt));
BOOST_CHECK(
Expand Down
216 changes: 0 additions & 216 deletions Tests/UnitTests/Core/Surfaces/BoundaryToleranceTestsRefs.hpp

This file was deleted.

Loading

0 comments on commit a5d5633

Please sign in to comment.