|
Boost Users : |
Subject: [Boost-users] boost test with assert()
From: Hicham Mouline (hicham_at_[hidden])
Date: 2008-11-18 12:44:05
Hello,
I use this test class:
class SimulationIdTest
{
public:
static void TestDestructorAfterAddRemoveSimulation();
static void TestDestructorAfterAddRemoveContractSimulation();
static void AddTests(boost::unit_test::test_suite* suite);
};
TestDestructorxxx() are written so that the code inside,
indirectly, throws an assert(false) (not my code)
I would like to test that indeed, it does throw the assert(false).
void SimulationIdTest::AddTests(boost::unit_test::test_suite* suite)
{
suite->add(BOOST_TEST_CASE(TestDestructorAfterAddRemoveSimulation), 1);
}
I tried the above by saying there would be 1 failure, however the test suite
stops
on that failure ( the assert(false) ), even the second argument of
suite->add is 1.
Is there a solution to this case?
Regards,
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