Boost logo

Boost Users :

From: Ewgenij Sokolovski (ewgenijkkg_at_[hidden])
Date: 2007-06-20 06:01:55


Hello. On the webpage I read:

In case if your test cases may throw custom exceptions (see here for list of
exceptions translated by default), you could register translator specific for
that exception.

http://www.boost.org/libs/test/doc/components/utf/index.html

So, if I understand it right, if I throw some custom exception in my test
program and do not catch it, then it is catched by the boost test framework and
reported in the proper way - if the exception can be translated by default. Now
I look at the exceptions, which can be translated by default and see:

In majority of the cases the monitored function doesn't need to throw the
boost::execution_exception to report an error in the Execution Monitor. If you
want a custom error message to be included into the execution_exception's error
message, use one of the following C++ types as an exception:

    * C string.
    * std:string.
    * any exception class in std::exception hierarchy.

http://www.boost.org/libs/test/doc/components/execution_monitor/index.html#caught_exception

So, I can use a C string for my exception.

I have written a small example test case and included throwing of an uncaught
exception
in it:

try{
    throw "blub";
    }
    catch(char* ex){
        throw;
    }

As I started the testing process I didn't get a "blub"-Exception message, but

Boost.Test internal framework error: unknown reason

So, what's wrong? Why is "blub" not reported as "blub"? Can anybody explain that?

Regards
Ewgenij


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