Re: [Boost-users] [BULK] Re: [Test] Asserting a failure
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Gennadiy Rozental Sent: Wednesday, August 24, 2005 9:51 AM To: boost-users@lists.boost.org Subject: [BULK] Re: [Boost-users] [Test] Asserting a failure Importance: Low
cannot find one. All I see are macros that assert successes, and those that assert exceptions. But my particular function does not throw, it simply "assert()"s.
I do not know reliable/portable way to intercept an assert invocation. So you are on your own here. If you know any hooks to do the job, I am open to suggestions.
Try replacing your asserts with BOOST_ASSERT which can be a passive assert depending on how you use it. http://www.boost.org/libs/utility/assert.html
Try replacing your asserts with BOOST_ASSERT which can be a passive assert depending on how you use it.
Hmm. That's an idea. I could probably do this within Boost.Test so users wouldn't need to bother: test_tools.hpp: #if !defined(BOOST_TEST_NO_ASSERT_HANDLER) namespace boost { inline void assertion_failed(char const * expr, char const * function, char const * file, long line) { ... } } #endif This way by default I will always supply definition for the function, unless user is willing to suply different one. Gennadiy
participants (2)
-
Gennadiy Rozental
-
Sohail Somani