Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2007-11-02 12:13:49

I've traced through the code with the gdb and seems to me
that when assert is invoked, the program bails more or less
immediatly without jumping back to the orginal main or
invoking an exception that can be caught. This results
in tests which provoke assertions as being marked "passed".

Actually, this is unbelievable to me and I have to
believe that I'm missing something really dumb. I
also took a cursory look at Boost Test code and don't
see any special provision made for assert.

Also I investigated BOOST_ASSERT. It looks
to me that this code is not conditional upon
NDEBUG not being defined - that is that the
code included by BOOST_ASSERT would
still appear in a release build. Again, I can't help but
feel that I'm missing something really obvious.

Robert Ramey

Robert Ramey wrote:
> Peter Dimov wrote:
>> Robert Ramey:
>>> It seems to me that when I get an assertion in my GCC compilers the
>>> test is still being marked as "pass"
>>> I'm using lightweight test in the follow way. Does anyone have any
>>> suggestions?
>> ...
>>> BOOST_TEST(e.what());
>> ...
>>> BOOST_TEST("failed with uncaught exception:");
>> BOOST_TEST( expression ) tests whether expression is true. You might
>> need BOOST_ERROR for the above two if you want them to be flagged as
>> a test failure and output their argument as the reason.
>> I took a quick look at the serialization tests though and I don't see
>> anything resembling the above; everything in test_tools.hpp seems
>> fine.
> I'm doing this on a branch "serialization next release" rather than
> trunk.
> That might explain it.
> Robert Ramey
> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at