8 Jun
2006
8 Jun
'06
8:53 p.m.
"Pierre-Jules Tremblay"
Right.
I meant what would you propose for checking inequality for floating-point types? Similar to the original poster asking for BOOST_CHECK_NOT_EQUAL(), what I'm asking about is a BOOST_CHECK_NOT_CLOSE() or BOOST_CHECK_NOT_SMALL() which would use the appropriate tolerance algorithm.
Is there a way of getting this kind of result with the current tools?
using namespace std; using namespace boost::test_tools; BOOST_CHECK_PREDICATE( not( check_is_close ), (a)(b)(percent_tolerance(t)) ); BOOST_CHECK_PREDICATE( not( check_is_close ), (a)(b)(fraction_tolerance(t)) ); BOOST_CHECK_PREDICATE( not( check_is_small ), (a)(t) ); Gennadiy