Performs equivalent check of std::fabs(lhs - rhs) <= margin But without the subtraction to allow for INFINITY in comparison
| 9162 | // Performs equivalent check of std::fabs(lhs - rhs) <= margin |
| 9163 | // But without the subtraction to allow for INFINITY in comparison |
| 9164 | bool WithinAbsMatcher::match(double const& matchee) const { |
| 9165 | return (matchee + m_margin >= m_target) && (m_target + m_margin >= matchee); |
| 9166 | } |
| 9167 | |
| 9168 | std::string WithinAbsMatcher::describe() const { |
| 9169 | return "is within " + ::Catch::Detail::stringify(m_margin) + " of " + ::Catch::Detail::stringify(m_target); |
no test coverage detected