16 #ifndef OPENKALMAN_VALUES_TESTS_HPP 17 #define OPENKALMAN_VALUES_TESTS_HPP 35 template<values::value Arg1, values::value Arg2, values::value Err>
36 struct TestComparison<Arg1, Arg2, Err>
38 template<typename Arg1, typename Arg2, typename Err>
39 struct
TestComparison<Arg1, Arg2, Err,
std::enable_if_t<values::value<Arg1> and values::value<Arg2> and values::value<Err>>>
41 : ::testing::AssertionResult
45 template<
typename Arg>
46 static auto print(Arg&& arg)
48 if constexpr (values::complex<Arg>)
54 return std::forward<Arg>(arg);
59 static ::testing::AssertionResult
60 compare(
const Arg1 arg1,
const Arg2 arg2,
const Err& err)
63 return ::testing::AssertionSuccess();
65 return ::testing::AssertionFailure() << print(
values::to_number(arg2)) <<
" is not within " <<
72 : ::testing::AssertionResult {
compare(arg1, arg2, err)} {}
78 #endif //OPENKALMAN_VALUES_TESTS_HPP Definition for values::to_number.
constexpr partial_ordering compare(const Lhs &lhs, const Rhs &rhs)
Compare two collections.
Definition: compare.hpp:106
constexpr auto imag(Arg arg)
A constexpr function to obtain the imaginary part of a (complex) number.
Definition: imag.hpp:40
Definition: tuple_reverse.hpp:103
constexpr auto to_number(Arg arg)
Convert any values::value to a values::number.
Definition: to_number.hpp:34
Definition for values::imag.
constexpr auto real(Arg arg)
A constexpr function to obtain the real part of a (complex) number.
Definition: real.hpp:40
constexpr bool near(const Arg1 &arg1, const Arg2 &arg2)
Determine whether two numbers are within a rounding tolerance.
Definition: near.hpp:36
Definition for values::real.
Definition for ::complex.