Skip to content

Commit bc4ca96

Browse files
committed
Adjust function to add wiggle room to tolerance
1 parent 06cb79e commit bc4ca96

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/testing_utils.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <algorithm>
12
#include <complex>
23
#include <filesystem>
34
#include <iostream>
@@ -119,4 +120,11 @@ Catch::Generators::GeneratorWrapper<std::tuple<T1, T2, T3>> xsf_test_cases(
119120
);
120121
}
121122

123+
124+
template <typename T>
125+
T adjust_tolerance(T tol) {
126+
// Add some wiggle room to tolerance from table.
127+
return 2 * std::max(std::numeric_limits<T>::epsilon(), tol);
128+
}
129+
122130
} // namespace

0 commit comments

Comments
 (0)