• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 #include <boost/core/lightweight_test.hpp>
12 
main()13 int main()
14 {
15     int x = 0;
16 
17     BOOST_TEST_LT( x, 1 );
18     BOOST_TEST_LT( ++x, 2 );
19     BOOST_TEST_LT( x++, 3 );
20 
21     BOOST_TEST_LE( x, 2 );
22     BOOST_TEST_LE( ++x, 3 );
23     BOOST_TEST_LE( x++, 4 );
24 
25     int y = 3;
26 
27     BOOST_TEST_LT( ++y, ++x );
28     BOOST_TEST_LT( y++, x++ );
29 
30     BOOST_TEST_LE( ++y, x );
31     BOOST_TEST_LE( y++, x++ );
32 
33     return boost::report_errors();
34 }
35