TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/test/exceptionFormatting.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_TEST_EXCEPTIONFORMATTING_HPP_
00002 #define _TUTTLE_TEST_EXCEPTIONFORMATTING_HPP_
00003 
00004 #include "boost/test/unit_test_monitor.hpp"
00005 #include "boost/test/unit_test_suite.hpp"
00006 #include "boost/test/test_tools.hpp" 
00007 #include "boost/exception/exception.hpp" 
00008 #include "boost/exception/diagnostic_information.hpp"
00009 
00010 
00011 inline void translate(boost::exception const& e) { 
00012    BOOST_FAIL(boost::diagnostic_information(e)); 
00013 } 
00014 
00015 /**
00016  * Register a display function for boost_test to display boost_exception information.
00017  */
00018 struct Exception_fixture { 
00019    Exception_fixture() { 
00020       ::boost::unit_test::unit_test_monitor.register_exception_translator<boost::exception>(&translate); 
00021    } 
00022 }; 
00023 
00024 BOOST_GLOBAL_FIXTURE( Exception_fixture ); 
00025 
00026 #endif
00027