mirror of
https://github.com/boostorg/core.git
synced 2025-11-29 22:00:17 +01:00
Add BOOST_TEST_LT, BOOST_TEST_LE
This commit is contained in:
@@ -147,6 +147,40 @@ template<class T, class U> inline void test_ne_impl( char const * expr1, char co
|
||||
}
|
||||
}
|
||||
|
||||
template<class T, class U> inline void test_lt_impl( char const * expr1, char const * expr2,
|
||||
char const * file, int line, char const * function, T const & t, U const & u )
|
||||
{
|
||||
if( t < u )
|
||||
{
|
||||
report_errors_remind();
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): test '" << expr1 << " < " << expr2
|
||||
<< "' failed in function '" << function << "': "
|
||||
<< "'" << test_output_impl(t) << "' >= '" << test_output_impl(u) << "'" << std::endl;
|
||||
++test_errors();
|
||||
}
|
||||
}
|
||||
|
||||
template<class T, class U> inline void test_le_impl( char const * expr1, char const * expr2,
|
||||
char const * file, int line, char const * function, T const & t, U const & u )
|
||||
{
|
||||
if( t <= u )
|
||||
{
|
||||
report_errors_remind();
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): test '" << expr1 << " <= " << expr2
|
||||
<< "' failed in function '" << function << "': "
|
||||
<< "'" << test_output_impl(t) << "' > '" << test_output_impl(u) << "'" << std::endl;
|
||||
++test_errors();
|
||||
}
|
||||
}
|
||||
|
||||
inline void test_cstr_eq_impl( char const * expr1, char const * expr2,
|
||||
char const * file, int line, char const * function, char const * const t, char const * const u )
|
||||
{
|
||||
@@ -360,6 +394,9 @@ inline int report_errors()
|
||||
#define BOOST_TEST_EQ(expr1,expr2) ( ::boost::detail::test_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
#define BOOST_TEST_NE(expr1,expr2) ( ::boost::detail::test_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
|
||||
#define BOOST_TEST_LT(expr1,expr2) ( ::boost::detail::test_lt_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
#define BOOST_TEST_LE(expr1,expr2) ( ::boost::detail::test_le_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
|
||||
#define BOOST_TEST_CSTR_EQ(expr1,expr2) ( ::boost::detail::test_cstr_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
#define BOOST_TEST_CSTR_NE(expr1,expr2) ( ::boost::detail::test_cstr_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user