Boost logo

Boost Users :

Subject: Re: [Boost-users] boost test with assert()
From: Hicham Mouline (hicham_at_[hidden])
Date: 2008-11-24 12:31:55

Well. I wish to trigger the destructor, which runs right before the
Test...() method returns,
and the destructor asserts false... Inside the destructor, all there is the
conditional assert()...
Maybe that's the same you are saying...


-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Gennadiy Rozental
Sent: 24 November 2008 16:18
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] boost test with assert()

Uwe Schuster <Uwe.Schuster <at>> writes:

> > From: Hicham Mouline
> >
> > Because RemoveSimulation(....) takes arguments which are not available
> > inside the SimulatonId object/destructor.
> Hi Hicham,
> In our test suites we deal with this problem by using an own special
> implementation of the assert() function. In this assert, called
> dynamicAssert() or runTimeAssert(), we call the real assert() only if
> the application is not running under test application. If running under
> test, we throw an special exception type instead, e.g. AssertionEx. This
> exception can be caught by the UTF and tested by Test-Tools. The

He wants to perform check in destructor. Throwing an exception might cause
problem. Maybe in conjunction with uncaught_exception() it can be made to


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at