]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/core/test/lightweight_test_all_eq_test.cpp
2 // Negative test for BOOST_TEST_ALL_EQ
4 // Copyright (c) 2017 Bjorn Reese
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
13 #include <boost/core/lightweight_test.hpp>
24 BOOST_TEST_ALL_EQ( x
, x
+ sizeof(x
)/sizeof(x
[0]), y
, y
+ sizeof(y
)/sizeof(y
[0]) );
31 BOOST_TEST_ALL_EQ( x
, x
+ sizeof(x
)/sizeof(x
[0]), y
, y
+ sizeof(y
)/sizeof(y
[0]) );
38 BOOST_TEST_ALL_EQ( x
, x
+ sizeof(x
)/sizeof(x
[0]), y
, y
+ sizeof(y
)/sizeof(y
[0]) );
43 int x
[] = { 1, 2, 3, 4 };
44 int y
[] = { 1, 3, 2, 4 };
45 BOOST_TEST_ALL_EQ( x
, x
+ sizeof(x
)/sizeof(x
[0]), y
, y
+ sizeof(y
)/sizeof(y
[0]) );
52 std::vector
<int> x
, y
;
54 BOOST_TEST_ALL_EQ( x
.begin(), x
.end(), y
.begin(), y
.end() );
59 std::vector
<int> x
, y
;
61 BOOST_TEST_ALL_EQ( x
.begin(), x
.end(), y
.begin(), y
.end() );
66 std::vector
<int> x
, y
;
67 x
.push_back( 1 ); x
.push_back( 2 ); x
.push_back( 3 ); x
.push_back( 4 );
68 y
.push_back( 1 ); y
.push_back( 3 ); y
.push_back( 2 ); y
.push_back( 4 );
69 BOOST_TEST_ALL_EQ( x
.begin(), x
.end(), y
.begin(), y
.end() );
74 std::vector
<float> x
, y
;
75 x
.push_back( 1.0f
); x
.push_back( 2.0f
); x
.push_back( 3.0f
); x
.push_back( 4.0f
);
76 y
.push_back( 4.0f
); y
.push_back( 2.0f
); y
.push_back( 3.0f
); y
.push_back( 1.0f
);
77 BOOST_TEST_ALL_EQ( x
.begin(), x
.end(), y
.begin(), y
.end() );
82 std::vector
<int> x
, y
;
83 x
.push_back( 1 ); x
.push_back( 2 ); x
.push_back( 3 );
84 y
.push_back( 1 ); y
.push_back( 3 ); y
.push_back( 2 ); y
.push_back( 4 );
85 BOOST_TEST_ALL_EQ( x
.begin(), x
.end(), y
.begin(), y
.end() );
90 std::vector
<int> x
, y
;
91 x
.push_back( 1 ); x
.push_back( 2 ); x
.push_back( 3 ); x
.push_back( 4 );
92 y
.push_back( 1 ); y
.push_back( 3 ); y
.push_back( 2 );;
93 BOOST_TEST_ALL_EQ( x
.begin(), x
.end(), y
.begin(), y
.end() );
102 y
.insert(1); y
.insert(3);
103 BOOST_TEST_ALL_EQ( x
.begin(), x
.end(), y
.begin(), y
.end() );
109 x
.insert(1); x
.insert(2);
111 BOOST_TEST_ALL_EQ( x
.begin(), x
.end(), y
.begin(), y
.end() );
117 x
.insert(1); x
.insert(2);
118 y
.insert(1); y
.insert(3);
119 BOOST_TEST_ALL_EQ( x
.begin(), x
.end(), y
.begin(), y
.end() );
123 boost::report_errors();
125 return boost::detail::test_errors() != test_cases
;