Re: [Boost-users] [tests] Signals not well covered in unit tests (incontrast to exceptions)?
"Jens Seidel"
wrote in message news:20070726151640.GA19199@imkf-pc073.imkf.tu-freiberg.de... Hi, 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? Gennadiy
On Thu, Aug 02, 2007 at 01:39:03PM -0400, Gennadiy Rozental wrote:
"Jens Seidel"
wrote in message news:20070726151640.GA19199@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
"Jens Seidel"
On Thu, Aug 02, 2007 at 01:39:03PM -0400, Gennadiy Rozental wrote:
"Jens Seidel"
wrote in message news:20070726151640.GA19199@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.
I will look into these Gennadiy
participants (2)
-
Gennadiy Rozental
-
Jens Seidel