Boost logo

Boost Users :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2006-06-08 16:53:18


"Pierre-Jules Tremblay" <iamtrep_at_[hidden]> wrote in message
news:4590bfef0606081055l4da18d0dp202ae232f39d30fc_at_mail.gmail.com...
> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net