Boost logo

Boost Users :

From: Chris Fairles (chris.fairles_at_[hidden])
Date: 2007-05-31 15:19:21


Thanks for the suggestion, tried a few things. I have
#define CHECK_IS_CLOSE_WEAK(x, y, t) \
        boost::test_tools::check_is_close((x),(y),
boost::test_tools::percent_tolerance(t), boost::test_tools::FPC_WEAK)

which works fine with when either x or y is 0. I tried the predicate
method, something like:

BOOST_CHECK_PREDICATE(boost::test_tools::check_is_close,
(first)(second)(boost::test_tools::percent_tolerance( e
))(boost::test_tools::FPC_WEAK))

But this fails
check boost::test_tools::check_is_close( m_cmp(i,j), m(i,j),
boost::test_tools::percent_tolerance( tolerance ),
boost::test_tools::FPC_WEAK ) failed for ( 0, -2.2204460492503131e-16,
1e-05, 1 )

Am I not using the predicate correctly?

On 5/31/07, Gennadiy Rozental <gennadiy.rozental_at_[hidden]> wrote:
>
> "Chris Fairles" <chris.fairles_at_[hidden]> wrote in message
> news:fac6bb500705310734l20adccxd3c2656306af0a7_at_mail.gmail.com...
> > 2) Use check_is_close explicitly and change the default comparison
> > type to FPC_WEAK. This means going outside the nice auto-unit-test and
> > test-tools framework which although I'm fine with, other programmers
> > writing test cases on my team might not be.
>
> You can combine check_is_close with BOOST_CHECK_PREDICATE to get nice test
> tools output.
>
> Gennadiy
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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