Boost logo

Boost Users :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2006-03-02 16:24:42


"Sean Huang" <huangsean_at_[hidden]> wrote in message
news:BAY102-DAV1123743A2F03A66559A0CEA3F50_at_phx.gbl...
> For example:
>
> BOOST_CHECK_THROW( (throw "string exception"), std::exception );
>
> I was expecting to get an error message in the form
> "error in xxx: exception<std::exception> expected".
> Instead a message like the following was logged:
> unknown location(0): fatal error in "xxxx": unknown type
>
> I'm not sure if this behavior is by design. If it is, it would be nice
> tools
> that catch all exceptions are provided.

Unexpected exception is an error for any statement, for any tool. Common
rule is that execution monitors deals with it (like in case above).
BOOST_CHECK_THROW checks that particular exception gets thrown. There are 3
possible outcome:
1. No exception is thrown - error is reported by the tool
2. Expected exception is thrown - no error is reported
3. Unexpected exception is thrown - error is reported by test case monitor
(the same would happened if an unexpected exception would happened in any
other place)

Do you think this particular tool needs to catch all unexpected exceptions?
But in this case no information for these exceptions would be reported.

Gennadiy


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