Boost logo

Boost Users :

Subject: [Boost-users] boost test with assert()
From: Hicham Mouline (hicham_at_[hidden])
Date: 2008-11-18 12:44:05


I use this test class:

class SimulationIdTest
    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
on that failure ( the assert(false) ), even the second argument of
suite->add is 1.

Is there a solution to this case?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at