Boost logo

Boost Users :

From: Jens Seidel (jensseidel_at_[hidden])
Date: 2007-08-02 15:40:01


On Thu, Aug 02, 2007 at 01:39:03PM -0400, Gennadiy Rozental wrote:
> > "Jens Seidel" <jensseidel_at_[hidden]> wrote in message
> > news:20070726151640.GA19199_at_imkf-pc073.imkf.tu-freiberg.de...
> > I have the following problem with a C++ project on Linux using the
> > Boost.test framework:
>
> Can you write simple example that show the problem?

Hhm, OK, I tried so but noticed that my initial attempt (throwing an
exception from a signal handler (after recieving a "division by
zero" signal) on a POSIX platform) is just undefined by ANSI C++.

Maybe someone has nevertheless a good idea how to continue a test without
the effects of previous tests.

The attached example test1.cpp demonstrates that destructors are not
called if a signal is raised, so that some global data structures are not
cleared. Bad ...

If an exception is thrown indstead of a signal all works as expected.
That's why I initially thought that I just write my own signal handler
and throw an exception from it to clear my data structures for the
next tests ... (test2.cpp)

It's no longer important but test2.cpp demonstrates indeed that my own
signal handler (which now just calls abort()) is not called by
Boost.test which is probably a bug.

Jens







Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net