boost unit test

#include <string>
#include <boost/test/unit_test.hpp>
#include <boost/test/included/unit_test_framework.hpp>

using namespace std;
using namespace boost::unit_test;

void force_division_by_zero()
{
    BOOST_CHECKPOINT("About to force division by zero!");
    int i = 1, j = 0;
    i = i / j;
}

test_suite*
init_unit_test_suite(int, char**)
{
    test_suite* test = BOOST_TEST_SUITE("Unit test example2");

    test->add(BOOST_TEST_CASE(&force_division_by_zero), 1);

    return test;
}

Similar Posts:

Post a Comment

Your email is never published nor shared.