18 #ifndef HH_SENF_Utils_auto_unit_test_ 19 #define HH_SENF_Utils_auto_unit_test_ 1 27 #include <boost/test/auto_unit_test.hpp> 28 #include <boost/test/test_tools.hpp> 59 #define COMPILE_FAIL(n) void n() 68 #define SENF_CHECK_NO_THROW(expr) \ 69 BOOST_CHECK_NO_THROW( \ 71 catch (std::exception & e) { std::cerr << e.what() << std::endl; throw; } ) 73 #define SENF_REQUIRE_NO_THROW(expr) \ 74 BOOST_REQUIRE_NO_THROW( \ 76 catch (std::exception & e) { std::cerr << e.what() << std::endl; throw; } ) 81 template <
class Iterator>
82 typename detail::NoCharIterator<Iterator>::type
nocharIterator(Iterator i);
96 #define SENF_CHECK_EQUAL_COLLECTIONS(left_begin, left_end, right_begin, right_end) \ 97 BOOST_CHECK_EQUAL_COLLECTIONS( \ 98 senf::test::nocharIterator(left_begin), senf::test::nocharIterator(left_end), \ 99 senf::test::nocharIterator(right_begin), senf::test::nocharIterator(right_end)) 110 #define SENF_AUTO_TEST_CASE(name) \ 111 void senf_test_body_##name(); \ 112 BOOST_AUTO_TEST_CASE(name) \ 115 senf_test_body_##name(); \ 117 catch (std::exception & e) { \ 118 std::cerr << e.what() << std::endl; \ 122 void senf_test_body_##name() 132 #define SENF_CHECK_NOT_EQUAL( Left, Rigth) 134 #ifdef BOOST_CHECK_NE 135 #define SENF_CHECK_NOT_EQUAL( Left, Right) BOOST_CHECK_NE( Left, Right) 137 #define SENF_CHECK_NOT_EQUAL( Left, Right) BOOST_CHECK( Left != Right) 141 #define SENF_RETURN_NO_ROOT_PRIVILEGES(msg) \ 142 if (getuid() != 0) { \ 143 BOOST_WARN_MESSAGE(false, msg); \
detail::NoCharIterator< Iterator >::type nocharIterator(Iterator i)