[unit-test] Can'f find boost::unit_test::register_exception_translator

I'm trying to register some user exceptions on the unit_test framework so I did the following: #include <boost/test/unit_test.hpp> using boost::unit_test::register_exception_translator; . . . void translate_InvalidInterval(const Interval::InvalidInterval& e) { } void translate_NotIntercept(const Interval::NotIntercept& e) { } interval_test_suite::interval_test_suite() : test_suite ("interval_test_suite") { boost::unit_test::register_exception_translator<Interval::InvalidInterval> (translate_InvalidInterval); boost::unit_test::register_exception_translator< Interval::NotIntercept> (translate_NotIntercept); . . . } I get the following compile error: error: 'boost::unit_test::register_exception_translator' has not been declared I tried to grep all .hpp files on /boost/test to find if some of them have this function. The only one (execution_monitor.hpp) I found has it as part of a class. I was expecting it as a template function in the framework. So, how what do I have to include to make this work?

I'm trying to register some user exceptions on the unit_test framework so I did the following:
#include <boost/test/unit_test.hpp> using boost::unit_test::register_exception_translator;
. . . void translate_InvalidInterval(const Interval::InvalidInterval& e) { }
void translate_NotIntercept(const Interval::NotIntercept& e) { }
[...]
So, how what do I have to include to make this work?
What you need to say is: boost::unit_test::unit_test_monitor.register_exception_translator< Interval::NotIntercept>(translate_NotIntercept) Gennadiy
participants (2)
-
Gennadiy Rozental
-
Gustavo Ribeiro Alves