
27 Aug
2009
27 Aug
'09
11:19 a.m.
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.