Boost logo

Boost Users :

Subject: [Boost-users] [unit_test_framework] checkpoints for BOOST_CHECK*?
From: rozelak_at_[hidden]
Date: 2009-08-27 07:19:25


Hallo,

I need to write an unit test checking several various inputs. As there
may be larger number of the inputs, I thought about a loop. The problem
is how to know the input for which the test failed (if it failed).

I wanted to write something like this:

....

BOOST_AUTO_TEST_CASE(....)
{
// each tested_variant may be quite complicated structure
for (tested_variants::iterator i) {
BOOST_TEST_CHECKPOINT("variant:" << i); // not usable for what I need
:-(
BOOST_CHECK_EQUAL(i.expected, tested_method(i.data));
}
}

....

However, BOOST_TEST_CHECKPOINT() does not work in this situation (well,
according to the documentation it works for exceptions only).

Is there a way how to achieve what I am looking for?
Thank you very much,
Dan T.


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