forked from boostorg/core
Add BOOST_TEST_LT, BOOST_TEST_LE
This commit is contained in:
1 parent
a49e7f2f87
commit
889502504d
6 files changed
+143
-5
No files matched your search
@@ -68,6 +68,7 @@ run lightweight_test_test2.cpp ;
|
||||
run lightweight_test_all_eq_test.cpp ;
|
||||
run lightweight_test_all_with_test.cpp ;
|
||||
run lightweight_test_all_with_fail.cpp ;
|
||||
run lightweight_test_lt_le_test.cpp ;
|
||||
|
||||
run-fail lightweight_test_fail.cpp ;
|
||||
run-fail lightweight_test_fail2.cpp ;
|
||||
@@ -81,6 +82,8 @@ run-fail lightweight_test_fail8.cpp ;
|
||||
run-fail lightweight_test_fail8.cpp : : : <rtti>off : lightweight_test_fail8_no_rtti ;
|
||||
run-fail lightweight_test_fail9.cpp ;
|
||||
run-fail lightweight_test_fail10.cpp ;
|
||||
run-fail lightweight_test_lt_fail.cpp ;
|
||||
run-fail lightweight_test_le_fail.cpp ;
|
||||
|
||||
run is_same_test.cpp ;
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Negative test for BOOST_TEST_LE
|
||||
//
|
||||
// Copyright 2017 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
int x = 1;
|
||||
|
||||
BOOST_TEST_LE( x, 0 );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Negative test for BOOST_TEST_LT
|
||||
//
|
||||
// Copyright 2014, 2017 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
int x = 0;
|
||||
|
||||
BOOST_TEST_LT( x, 0 );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Test for BOOST_TEST_LT, BOOST_TEST_LE
|
||||
//
|
||||
// Copyright 2014, 2017 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
int x = 0;
|
||||
|
||||
BOOST_TEST_LT( x, 1 );
|
||||
BOOST_TEST_LT( ++x, 2 );
|
||||
BOOST_TEST_LT( x++, 3 );
|
||||
|
||||
BOOST_TEST_LE( x, 2 );
|
||||
BOOST_TEST_LE( ++x, 3 );
|
||||
BOOST_TEST_LE( x++, 4 );
|
||||
|
||||
int y = 3;
|
||||
|
||||
BOOST_TEST_LT( ++y, ++x );
|
||||
BOOST_TEST_LT( y++, x++ );
|
||||
|
||||
BOOST_TEST_LE( ++y, x );
|
||||
BOOST_TEST_LE( y++, x++ );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
Reference in new issue
Block a user