Skip to content

Commit

Permalink
test: Bounds regression tests (#4001)
Browse files Browse the repository at this point in the history
This PR adds regression tests based on a grid of sample points. The bounds on a surface are checked, and the result is compared to a reference matrix that is parsed from a string. In case of a mismatch a diff like this is printed:

<img width="571" alt="image" src="https://github.com/user-attachments/assets/3def3100-ab59-41a7-bb83-ad7ef8c5ff60" />

We'll probably extend this to more shapes and tolerance scenarios. This is a proof of concept only.
paulgessinger authored Dec 19, 2024
1 parent 8e430f8 commit 87439ad
Showing 3 changed files with 3,189 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Core/include/Acts/Surfaces/BoundaryTolerance.hpp
Original file line number Diff line number Diff line change
@@ -87,6 +87,10 @@ class BoundaryTolerance {
throw std::invalid_argument(
"AbsoluteCartesian: Tolerance must be non-negative");
}
if ((tolerance0 == 0) != (tolerance1 == 0)) {
throw std::invalid_argument(
"AbsoluteCartesian: Both tolerances must be zero or non-zero");
}
}
};

3,184 changes: 3,184 additions & 0 deletions Tests/UnitTests/Core/Surfaces/BoundsRegressionTests.cpp

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Tests/UnitTests/Core/Surfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -28,3 +28,4 @@ add_unittest(TrapezoidBounds TrapezoidBoundsTests.cpp)
add_unittest(VerticesHelper VerticesHelperTests.cpp)
add_unittest(AlignmentHelper AlignmentHelperTests.cpp)
add_unittest(PolyhedronSurfacesTests PolyhedronSurfacesTests.cpp)
add_unittest(BoundsRegression BoundsRegressionTests.cpp)

0 comments on commit 87439ad

Please sign in to comment.