Boost logo

Boost :

Subject: Re: [boost] [test] BOOST_TEST - universal testing tool
From: Rhys Ulerich (rhys.ulerich_at_[hidden])
Date: 2012-11-06 06:16:46


> BOOST_TEST(a == 0.003, unit_test::percent_tolerance(1e-6) );
>
> ...
>
> BOOST_TEST( expr == std::vector<int>{1,2,3,4});

Can combine these constructs to perform floating point tests with
tolerance on a collection?

That is,
BOOST_TEST( expr == std::vector<double>{1,2,3,4},
unit_test::percent_tolerance(1e-6));

I ask because, for my numerics codes, I've kludged together the Test
floating point tolerance algorithms to produce something like a
BOOST_CHECK_CLOSE_COLLECTIONS. Direct support within Test would be
much appreciated.

Thanks,
Rhys


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