lightweight_test_lt_le_test.cpp 666 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // Test for BOOST_TEST_LT, BOOST_TEST_LE
  3. //
  4. // Copyright 2014, 2017 Peter Dimov
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt
  9. //
  10. #include <boost/core/lightweight_test.hpp>
  11. int main()
  12. {
  13. int x = 0;
  14. BOOST_TEST_LT( x, 1 );
  15. BOOST_TEST_LT( ++x, 2 );
  16. BOOST_TEST_LT( x++, 3 );
  17. BOOST_TEST_LE( x, 2 );
  18. BOOST_TEST_LE( ++x, 3 );
  19. BOOST_TEST_LE( x++, 4 );
  20. int y = 3;
  21. BOOST_TEST_LT( ++y, ++x );
  22. BOOST_TEST_LT( y++, x++ );
  23. BOOST_TEST_LE( ++y, x );
  24. BOOST_TEST_LE( y++, x++ );
  25. return boost::report_errors();
  26. }