2
0
mirror of https://github.com/boostorg/test.git synced 2026-01-25 06:42:22 +00:00
Files
test/doc/examples/boost_test_macro_sequence.cpp
Raffi Enficiaud ce20c17d9c renaming
2015-05-06 02:03:32 +02:00

26 lines
774 B
C++

// (C) Copyright Raffi Enficiaud 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//[example_code
#define BOOST_TEST_MODULE boost_test_sequence
#include <boost/test/included/unit_test.hpp>
#include <vector>
BOOST_AUTO_TEST_CASE( test_collections_vectors )
{
std::vector<int> a{1,2,3}, c{1,5,3,4};
std::vector<long> b{1,5,3};
BOOST_TEST(a == b); // nok: a[1] != b[1]
BOOST_TEST(a != b); // nok: a[0] == b[0] ...
BOOST_TEST(a <= b); // ok
BOOST_TEST(b < c); // nok: size mismatch
BOOST_TEST(b >= c); // nok: size mismatch
BOOST_TEST(b != c); // nok: size mismatch
}
//]