|
Boost Users : |
Subject: Re: [Boost-users] [Boost.Test] Using boost::exception
From: svarneticist (svarneticist_at_[hidden])
Date: 2012-03-06 14:53:53
I found it helpful to include this in my test cases:
#include "boost/test/unit_test_monitor.hpp"
#include "boost/exception/all.hpp"
void translate(boost::exception const& e) {
BOOST_FAIL(boost::diagnostic_information(e));
}
struct Exception_fixture {
Exception_fixture() {
::boost::unit_test::unit_test_monitor.register_exception_translator<boost::exception>(&translate);
}
};
BOOST_GLOBAL_FIXTURE( Exception_fixture );
BOOST_AUTO_TEST_CASE( case01 ) {
//test body
}
-- View this message in context: http://boost.2283326.n4.nabble.com/Boost-Test-Using-boost-exception-tp4447404p4451141.html Sent from the Boost - Users mailing list archive at Nabble.com.
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