Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

BOOST_level_THROW

BOOST_level_THROW(expression, exception) asserts that expression throws an exception of type exception or a type derived from exception.

Example

static void always_throws()
{
    throw std::runtime_error("whoops");
}

BOOST_AUTO_TEST_CASE(example_throw)
{
    BOOST_REQUIRE_THROW(always_throws(), std::runtime_error);
}


PrevUpHomeNext