Subject: Re: [boost] [test] still broken in release
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2013-08-10 13:11:09
Bjorn Reese <breese <at> mail1.stofanet.dk> writes:
> On 08/09/2013 09:01 PM, Gennadiy Rozental wrote:
> > features and these are indeed completely missing from docs. Even worse
> > use number of old interfaces, which are now deprecated. Most important
> > example is testing tools: BOOST_CHECK_EQUAL, BOOST_CHECK_CLOSE - all
> BOOST_CHECK_EQUAL has been deprecated? What should be used instead?
BOOST_TEST( a == b )
This will produce as good an output. You can also do
BOOST_TEST( a > b )
BOOST_TEST( a != b )
BOOST_TEST( a + b < 2 )
All these will produce detailed output including values of a and b in case
if assertion fails. a and b could be collections, in which case above will
do per element comparison. a and b could be floating point numbers in which
case above will perform comparison with predefined tolerate (predefined for
the series of assertions of for the whole test case, and we will also have
an ability to specify it as second argument in above assertion). All of this
and much much more is the function of new "super testing tool" BOOST_TEST.
There are few rare examples where above will not work, BOOST_CHECK will be
You can see more examples in Boost.Test unit tests.