Boost logo

Boost Users :

Subject: Re: [Boost-users] boost test with assert()
From: Hicham Mouline (hicham_at_[hidden])
Date: 2008-11-21 15:23:11

Then it looks like I shouldn't catch the assert.

Let me present the situation clearer, and see if I can change
the underlying assert().

SimulationId simId = AddSimulation(...)

SimulationId is an object designed to "enforce", in very simple usages,
that whenever in a scope AddSimulation() is called,
a RemoveSimulation(simId) is also called.

RemoveSimulation clears a flag on simId, and simId destructor
asserts that the flag is cleared

And so the test looks like this:

void SimulationIdTest::TestDestructorAfterAddRemoveSimulation()
  SimulationId simId = AddSimulation(...);
  // I want to test here that the destructor asserts(false)

But this test is within a large test suite, and the asserts(false) should be

Possibly, there is a nicer/cleaner way to test this?


-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Gennadiy Rozental
Sent: 21 November 2008 19:23
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] boost test with assert()
Hicham Mouline wrote:
> Is it not possible to test that it aborts, and then control that and
> continue running the test suite?
There is no safe way to continue after SIGABORT.

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