MCPcopy Create free account
hub / github.com/bblanchon/ArduinoJson / WithinRelMatcher

Method WithinRelMatcher

extras/tests/catch/catch.hpp:11640–11645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11638 }
11639
11640 WithinRelMatcher::WithinRelMatcher(double target, double epsilon):
11641 m_target(target),
11642 m_epsilon(epsilon){
11643 CATCH_ENFORCE(m_epsilon >= 0., "Relative comparison with epsilon < 0 does not make sense.");
11644 CATCH_ENFORCE(m_epsilon < 1., "Relative comparison with epsilon >= 1 does not make sense.");
11645 }
11646
11647 bool WithinRelMatcher::match(double const& matchee) const {
11648 const auto relMargin = m_epsilon * (std::max)(std::fabs(matchee), std::fabs(m_target));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected