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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Gustavo Ribeiro Alves-2
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?
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [unit-test] Can'f findboost::unit_test::register_exception_translator

Gennadiy Rozental
> 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



_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users