boost::test question

Hi The code below reports 2 failed assertions of 3. If you comment out one of the BOOST_CHECK macros, it reports 1 failed assertion of 1. Is the extra assertion expected behaviour? Thanks Jorge #include <boost/test/unit_test.hpp> using boost::unit_test::test_suite; void free_test_function() { // reports 'error in "free_test_function": test 2 == 1 failed' BOOST_CHECK(5 == 1); // non-critical test => continue after failure BOOST_CHECK(6 == 1); // non-critical test => continue after failure } test_suite* init_unit_test_suite( int, char* [] ) { test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); // this example will pass cause we know ahead of time number of expected failures test->add( BOOST_TEST_CASE( &free_test_function ), 2 /* expected one error */ ); return test; }

"Jorge Lodos" <lodos@segurmatica.cu> wrote in message news:003f01c7930a$bd3cc160$f9010a0a@segurmatica.cu...
Hi The code below reports 2 failed assertions of 3. If you comment out one of the BOOST_CHECK macros, it reports 1 failed assertion of 1. Is the extra assertion expected behaviour?
In the version you are using there was an extra assertion for each test case that validates that number of failures is not less than expected. Latest version is using message to report the condition. Gennadiy

Gennadiy Rozental writes:
"Jorge Lodos" <lodos@segurmatica.cu> wrote in message news:003f01c7930a$bd3cc160$f9010a0a@segurmatica.cu...
Hi The code below reports 2 failed assertions of 3. If you comment out one of the BOOST_CHECK macros, it reports 1 failed assertion of 1. Is the extra assertion expected behaviour?
In the version you are using there was an extra assertion for each test case that validates that number of failures is not less than expected. Latest version is using message to report the condition.
You know, I've seen the same thing, and always figured I was just confused (a usual state of affairs). :-) -- Dave Steffen, Ph.D. A Zen master once said to me, "Do the Software Engineer IV opposite of whatever I tell you." Numerica Corporation So I didn't. ph (970) 461-2000 x227 dgsteffen@numerica.us -- not Hofstadter (but should have been)
participants (3)
-
Dave Steffen
-
Gennadiy Rozental
-
Jorge Lodos