
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...
thanks
-----Original Message-----
From: boost-users-bounces@lists.boost.org
[mailto:boost-users-bounces@lists.boost.org] On Behalf Of Gennadiy Rozental
Sent: 24 November 2008 16:18
To: boost-users@lists.boost.org
Subject: Re: [Boost-users] boost test with assert()
Uwe Schuster
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 work. Gennadiy