#include <catch_matchers_floating.h>
Definition at line 3048 of file catch.hpp.
◆ WithinAbsMatcher() [1/2]
Catch::Matchers::Floating::WithinAbsMatcher::WithinAbsMatcher |
( |
double | target, |
|
|
double | margin ) |
Definition at line 83 of file catch_matchers_floating.cpp.
84 :m_target{ target }, m_margin{ margin } {
85 CATCH_ENFORCE(margin >= 0,
"Invalid margin: " << margin <<
'.'
86 << " Margin has to be non-negative.");
87 }
#define CATCH_ENFORCE(condition, msg)
◆ WithinAbsMatcher() [2/2]
Catch::Matchers::Floating::WithinAbsMatcher::WithinAbsMatcher |
( |
double | target, |
|
|
double | margin ) |
◆ describe() [1/2]
std::string Catch::Matchers::Floating::WithinAbsMatcher::describe |
( |
| ) |
const |
|
overridevirtual |
◆ describe() [2/2]
std::string Catch::Matchers::Floating::WithinAbsMatcher::describe |
( |
| ) |
const |
|
overridevirtual |
◆ match() [1/2]
bool Catch::Matchers::Floating::WithinAbsMatcher::match |
( |
double const & | matchee | ) |
const |
|
override |
Definition at line 91 of file catch_matchers_floating.cpp.
91 {
92 return (matchee + m_margin >= m_target) && (m_target + m_margin >= matchee);
93 }
◆ match() [2/2]
bool Catch::Matchers::Floating::WithinAbsMatcher::match |
( |
double const & | matchee | ) |
const |
|
override |
The documentation for this struct was generated from the following files: