boost_test_bitwise.run-fail.cpp 675 B

1234567891011121314151617181920212223
  1. // (C) Copyright Raffi Enficiaud 2014.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/test for the library home page.
  6. //[example_code
  7. #define BOOST_TEST_MODULE boost_test_bitwise
  8. #include <boost/test/included/unit_test.hpp>
  9. #include <sstream>
  10. BOOST_AUTO_TEST_CASE(test_bitwise)
  11. {
  12. namespace tt = boost::test_tools;
  13. int a = 0xAB;
  14. BOOST_TEST( a == (a & ~1), tt::bitwise() );
  15. BOOST_TEST( a == a + 1, tt::bitwise() );
  16. BOOST_TEST( a != a + 1, tt::bitwise() );
  17. int b = 0x88;
  18. BOOST_TEST( a == b, tt::bitwise() );
  19. }
  20. //]