boost_test_container_default.run-fail.cpp 724 B

123456789101112131415161718192021222324252627
  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_sequence
  8. #include <boost/test/included/unit_test.hpp>
  9. #include <vector>
  10. BOOST_AUTO_TEST_CASE( test_collections_vectors )
  11. {
  12. std::vector<int> a{1,2,3}, c{1,5,3,4};
  13. std::vector<long> b{1,5,3};
  14. // the following does not compile
  15. //BOOST_TEST(a == b);
  16. //BOOST_TEST(a <= b);
  17. // stl defaults to lexicographical comparison
  18. BOOST_TEST(a < c);
  19. BOOST_TEST(a >= c);
  20. BOOST_TEST(a != c);
  21. }
  22. //]