Boost logo

Boost Users :

Subject: Re: [Boost-users] [Test] BOOST_CHECK_EXCEPTION error message still vague
From: Merrill Cornish (merrill.cornish_at_[hidden])
Date: 2016-02-16 20:19:12


Raffi,

>>> "...validation on the raised exception through predicate "fail_msg""
>>>
>>>which means that the predicate is not passing the test

If the message in the first line means "the predicate is not passing the
test," then the first line should say, "the predicate is not passing the
test." As it is, the first line only says that the predicate was named
"fail_msg."

The BOOST_CHECK_EXCEPTION is a little different in that it has a two
part pass/fail condition:
[1] was the correct exception raised or not, and [2] did the predicate
returned pass or fail.

Using the std::runtime_error exception and "fail_msg" predicate name
from my original post as an example, there would be three possible error
messages:

* Assertion failed: Exception "std::runtime_error" was not raised as
expected.
   < in this case, we do not care about the predicate >

* Assertion failed: Exception "std::runtime_error" was raised as expected.
    The predicate, "fail_msg", failed.

* Assertion passed: Exception "std::runtime_error" was raised as expected.
    The predicate, "fail_msg", passed.
    < you would need this message only if --log_level=all >

Merrill


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