-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use approximate equality checks for 3D point tests
Currently, we require exact equality on floating point 3D vectors, which is unreasonable. This commit changes the code such that the equality is instead defined with an epsilon value of 1E-6.
- Loading branch information
1 parent
73ff9d3
commit b69bac7
Showing
2 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** Detray library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#include <gtest/gtest.h> | ||
|
||
#pragma once | ||
|
||
#define EXPECT_POINT3_NEAR(point1, point2, abs_error) \ | ||
do { \ | ||
EXPECT_NEAR(point1[0], point2[0], abs_error); \ | ||
EXPECT_NEAR(point1[1], point2[1], abs_error); \ | ||
EXPECT_NEAR(point1[2], point2[2], abs_error); \ | ||
} while (false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters