[Test] BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES => exceptions?
Hi, Does Boost.Test consider an exception as a failure? How can I make it expect an exception? Or is there another way to do this? Thanks, Sohail
"Sohail Somani"
Hi,
Does Boost.Test consider an exception as a failure?
In latest version answer is clear yes. In previos there maybe some bugs.
How can I make expect an exception?
Use BOOST_CHECK_THROW, BOOST_CHECK_EXCEPTION. If you want behavior similar to the "expected failures" feature it can't be done. Uncaught C++ exception is considered a fatal test case failure and can't be hidden (since the rest of the test case is skipped and we don't know how many failures actually occurs. Gennadiy
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Gennadiy Rozental
How can I make expect an exception?
Use BOOST_CHECK_THROW, BOOST_CHECK_EXCEPTION. If you want behavior similar to the "expected failures" feature it can't be done. Uncaught C++ exception is considered a fatal test case failure and can't be hidden (since the rest of the test case is skipped and we don't know how many failures actually occurs.
Ah, thanks Gennadiy, that works awesome.
participants (2)
-
Gennadiy Rozental
-
Sohail Somani