lightweight_test_gt_ge_test.cpp 665 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // Test for BOOST_TEST_GT, BOOST_TEST_GE
  3. //
  4. // Copyright 2017 Kohei Takahashi
  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_GT( x, -1 );
  15. BOOST_TEST_GT( ++x, 0 );
  16. BOOST_TEST_GT( x++, 0 );
  17. BOOST_TEST_GE( x, 2 );
  18. BOOST_TEST_GE( ++x, 3 );
  19. BOOST_TEST_GE( x++, 3 );
  20. int y = 5;
  21. BOOST_TEST_GT( ++y, ++x );
  22. BOOST_TEST_GT( y++, x++ );
  23. BOOST_TEST_GE( ++y, x );
  24. BOOST_TEST_GE( y++, x++ );
  25. return boost::report_errors();
  26. }