Change the threshold param of near to be inclusive

I.e. it means the maximum allowed difference, similar to how other testing frameworks handle this and it allows a threshold of 0 to mean "equal"
This commit is contained in:
Alexander Grund 2022-01-06 15:38:29 +01:00
parent e26601672e
commit 98541eb5a7
No known key found for this signature in database
GPG key ID: AA48A0760367A42B
2 changed files with 4 additions and 3 deletions

View file

@ -106,7 +106,7 @@ namespace detail
# define MOCK_NEAR_DEFINED
#endif
MOCK_NARY_CONSTRAINT( near, 2, ( expected, tolerance ),
std::abs( actual - expected ) < tolerance )
std::abs( actual - expected ) <= tolerance )
#ifdef MOCK_NEAR_DEFINED
# pragma pop_macro( "near" )
#endif