aboutsummaryrefslogtreecommitdiffstats
path: root/x11-toolkits/libj2dplot
diff options
context:
space:
mode:
Diffstat (limited to 'x11-toolkits/libj2dplot')
0 files changed, 0 insertions, 0 deletions
">* _aStr, unsigned _line, char const* _file, char const* _func) { bool ret = _a; if (!ret) { std::cerr << "Assertion failed:" << _aStr << " [func=" << _func << ", line=" << _line << ", file=" << _file << "]" << std::endl; #if ETH_DEBUG debug_break(); #endif } return !ret; } template<class A, class B> inline bool assertEqualAux(A const& _a, B const& _b, char const* _aStr, char const* _bStr, unsigned _line, char const* _file, char const* _func) { bool ret = _a == _b; if (!ret) { std::cerr << "Assertion failed: " << _aStr << " == " << _bStr << " [func=" << _func << ", line=" << _line << ", file=" << _file << "]" << std::endl; std::cerr << " Fail equality: " << _a << "==" << _b << std::endl; #if ETH_DEBUG debug_break(); #endif } return !ret; } /// Assertion that throws an exception containing the given description if it is not met. /// Use it as assertThrow(1 == 1, ExceptionType, "Mathematics is wrong."); /// Do NOT supply an exception object as the second parameter. #define assertThrow(_condition, _ExceptionType, _description) \ ::dev::assertThrowAux<_ExceptionType>(!!(_condition), _description, __LINE__, __FILE__, ETH_FUNC) using errinfo_comment = boost::error_info<struct tag_comment, std::string>; template <class _ExceptionType> inline void assertThrowAux( bool _condition, ::std::string const& _errorDescription, unsigned _line, char const* _file, char const* _function ) { if (!_condition) ::boost::throw_exception( _ExceptionType() << ::dev::errinfo_comment(_errorDescription) << ::boost::throw_function(_function) << ::boost::throw_file(_file) << ::boost::throw_line(_line) ); } }