Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2005-11-10 11:47:10


I have a couple of feature requests for Boost.Test:

1) Can BOOST_CHECK_CLOSE please print the actual difference between the
values (as a percent to match the tolerance) as well as the values
themselves? The reason this is important, is that it's not always easy to
get this value from the input values - because the precision of the machine
on which the test is run far outstrips that of the author's machine, so his
calculator isn't any use :-(

2) Can we please have a BOOST_CHECK_EPSILON, that uses a whole number of
epsilon as the tolerance? IMO BOOST_CHECK_CLOSE should have been written
this way to begin with, but it's too late now. Again it should print out
the actual relative error as a multiple of epsilon as well as the input
values. Actually while we're at it the absolute error may be useful to have
in some situations as well :-)

BTW, in case it helps: I've switched to using std::pow(two,
1-std::numeric_limits<T>::digits) to calculate machine epsilon, because of
the strange behaviour on Darwin with long doubles if you use
numeric_limits<>::epsilon() (see
http://lists.boost.org/Archives/boost/2005/09/93390.php).

Thanks!

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk