]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/container/test/vector_test.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / container / test / vector_test.hpp
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) Copyright Ion Gaztanaga 2004-2013. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // See http://www.boost.org/libs/container for documentation.
8 //
9 //////////////////////////////////////////////////////////////////////////////
10
11 #ifndef BOOST_CONTAINER_TEST_VECTOR_TEST_HEADER
12 #define BOOST_CONTAINER_TEST_VECTOR_TEST_HEADER
13
14 #include <boost/container/detail/config_begin.hpp>
15
16 #include <vector>
17 #include <iostream>
18 #include <list>
19
20 #include <boost/move/utility_core.hpp>
21 #include <boost/container/detail/mpl.hpp>
22 #include <boost/move/utility_core.hpp>
23 #include <boost/move/iterator.hpp>
24 #include <boost/move/make_unique.hpp>
25 #include <boost/core/no_exceptions_support.hpp>
26 #include <boost/static_assert.hpp>
27
28 #include "print_container.hpp"
29 #include "check_equal_containers.hpp"
30 #include "movable_int.hpp"
31 #include "emplace_test.hpp"
32 #include "input_from_forward_iterator.hpp"
33 #include "insert_test.hpp"
34 #include "container_common_tests.hpp"
35
36 #include <cstddef>
37 #include <string>
38 #include <vector>
39
40
41 namespace boost{
42 namespace container {
43 namespace test{
44
45 template<class Vector>
46 struct vector_hash_function_capacity
47 {
48 typedef typename Vector::size_type size_type;
49 template <typename U, size_type (U::*)() const> struct Check;
50 template <typename U> static char func(Check<U, &U::capacity> *);
51 template <typename U> static int func(...);
52
53 public:
54 static const bool value = sizeof(func<Vector>(0)) == sizeof(char);
55 };
56
57 template<class V1, class V2>
58 bool vector_vector_hash_function_capacity_only(V1&, V2&, boost::container::dtl::false_type)
59 {
60 return true;
61 }
62
63 template<class MyBoostVector, class MyStdVector>
64 bool vector_vector_hash_function_capacity_only(MyBoostVector&boostvector, MyStdVector&stdvector, boost::container::dtl::true_type)
65 {
66 //deque has no reserve
67 boostvector.reserve(boostvector.size()*2);
68 stdvector.reserve(stdvector.size()*2);
69 if(!test::CheckEqualContainers(boostvector, stdvector)) return false;
70
71 std::size_t cap = boostvector.capacity();
72 boostvector.reserve(cap*2);
73 stdvector.reserve(cap*2);
74 if(!test::CheckEqualContainers(boostvector, stdvector)) return false;
75 boostvector.resize(0);
76 stdvector.resize(0);
77 if(!test::CheckEqualContainers(boostvector, stdvector)) return false;
78
79 boostvector.resize(cap*2);
80 stdvector.resize(cap*2);
81 if(!test::CheckEqualContainers(boostvector, stdvector)) return false;
82
83 boostvector.resize(cap*2);
84 stdvector.resize(cap*2);
85 if(!test::CheckEqualContainers(boostvector, stdvector)) return false;
86
87 return true;
88 }
89
90
91 template<class V1, class V2>
92 bool vector_copyable_only(V1&, V2&, boost::container::dtl::false_type)
93 {
94 return true;
95 }
96
97 //Function to check if both sets are equal
98 template<class MyBoostVector, class MyStdVector>
99 bool vector_copyable_only(MyBoostVector &boostvector, MyStdVector &stdvector, boost::container::dtl::true_type)
100 {
101 typedef typename MyBoostVector::value_type IntType;
102 std::size_t size = boostvector.size();
103 boostvector.insert(boostvector.end(), 50, IntType(1));
104 stdvector.insert(stdvector.end(), 50, 1);
105 if(!test::CheckEqualContainers(boostvector, stdvector)) return false;
106
107 {
108 IntType move_me(1);
109 boostvector.insert(boostvector.begin()+size/2, 50, boost::move(move_me));
110 stdvector.insert(stdvector.begin()+size/2, 50, 1);
111 if(!test::CheckEqualContainers(boostvector, stdvector)) return false;
112 }
113 {
114 IntType move_me(2);
115 boostvector.assign(boostvector.size()/2, boost::move(move_me));
116 stdvector.assign(stdvector.size()/2, 2);
117 if(!test::CheckEqualContainers(boostvector, stdvector)) return false;
118 }
119 {
120 IntType move_me(3);
121 boostvector.assign(boostvector.size()*3-1, boost::move(move_me));
122 stdvector.assign(stdvector.size()*3-1, 3);
123 if(!test::CheckEqualContainers(boostvector, stdvector)) return false;
124 }
125
126 {
127 IntType copy_me(3);
128 const IntType ccopy_me(3);
129 boostvector.push_back(copy_me);
130 stdvector.push_back(int(3));
131 boostvector.push_back(ccopy_me);
132 stdvector.push_back(int(3));
133 if(!test::CheckEqualContainers(boostvector, stdvector)) return false;
134 }
135 { //Vector(const Vector &)
136 ::boost::movelib::unique_ptr<MyBoostVector> const pv1 =
137 ::boost::movelib::make_unique<MyBoostVector>(boostvector);
138 ::boost::movelib::unique_ptr<MyStdVector> const pv2 =
139 ::boost::movelib::make_unique<MyStdVector>(stdvector);
140
141 MyBoostVector &v1 = *pv1;
142 MyStdVector &v2 = *pv2;
143
144 boostvector.clear();
145 stdvector.clear();
146 boostvector.assign(v1.begin(), v1.end());
147 stdvector.assign(v2.begin(), v2.end());
148 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
149 }
150 { //Vector(const Vector &, alloc)
151 ::boost::movelib::unique_ptr<MyBoostVector> const pv1 =
152 ::boost::movelib::make_unique<MyBoostVector>(boostvector, typename MyBoostVector::allocator_type());
153 ::boost::movelib::unique_ptr<MyStdVector> const pv2 =
154 ::boost::movelib::make_unique<MyStdVector>(stdvector);
155
156 MyBoostVector &v1 = *pv1;
157 MyStdVector &v2 = *pv2;
158
159 boostvector.clear();
160 stdvector.clear();
161 boostvector.assign(v1.begin(), v1.end());
162 stdvector.assign(v2.begin(), v2.end());
163 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
164 }
165 { //Vector(n, T)
166 ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp =
167 ::boost::movelib::make_unique<MyStdVector>(100, int(5));
168 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp =
169 ::boost::movelib::make_unique<MyBoostVector>(100, IntType(5));
170 if(!test::CheckEqualContainers(*boostvectorp, *stdvectorp)) return 1;
171 }
172 { //Vector(n, T, alloc)
173 ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp =
174 ::boost::movelib::make_unique<MyStdVector>(100, int(5));
175 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp =
176 ::boost::movelib::make_unique<MyBoostVector>(100, IntType(5), typename MyBoostVector::allocator_type());
177 if(!test::CheckEqualContainers(*boostvectorp, *stdvectorp)) return 1;
178 }
179 { //Vector(It, It)
180 ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp =
181 ::boost::movelib::make_unique<MyStdVector>(100);
182 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp =
183 ::boost::movelib::make_unique<MyBoostVector>(100);
184 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp2 =
185 ::boost::movelib::make_unique<MyBoostVector>(boostvectorp->begin(), boostvectorp->end());
186 if(!test::CheckEqualContainers(*boostvectorp2, *stdvectorp)) return 1;
187 }
188 { //Vector(It, It, alloc)
189 ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp =
190 ::boost::movelib::make_unique<MyStdVector>(100);
191 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp =
192 ::boost::movelib::make_unique<MyBoostVector>(100);
193 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp2 =
194 ::boost::movelib::make_unique<MyBoostVector>(boostvectorp->begin(), boostvectorp->end(), typename MyBoostVector::allocator_type());
195 if(!test::CheckEqualContainers(*boostvectorp2, *stdvectorp)) return 1;
196 }
197 { //resize(n, T)
198 ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp =
199 ::boost::movelib::make_unique<MyStdVector>();
200 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp =
201 ::boost::movelib::make_unique<MyBoostVector>();
202 stdvectorp->resize(100, int(9));
203 boostvectorp->resize(100, IntType(9));
204 if(!test::CheckEqualContainers(*boostvectorp, *stdvectorp)) return 1;
205 }
206 //operator=
207 {
208 //Copy constructor test
209 MyBoostVector bcopy((const MyBoostVector&) boostvector);
210 MyStdVector scopy((const MyStdVector&) stdvector);
211 MyBoostVector bcopy2(boostvector);
212 MyStdVector scopy2(stdvector);
213
214 if(!test::CheckEqualContainers(bcopy, scopy)) return false;
215 if(!test::CheckEqualContainers(bcopy2, scopy2)) return false;
216
217 //Assignment from a smaller vector
218 bcopy2.erase(bcopy2.begin() + bcopy2.size()/2, bcopy2.end());
219 scopy2.erase(scopy2.begin() + scopy2.size()/2, scopy2.end());
220 bcopy = bcopy2;
221 scopy = scopy2;
222 if(!test::CheckEqualContainers(bcopy, scopy)) return false;
223
224 //Assignment from a bigger vector with capacity
225 bcopy2 = boostvector;
226 scopy2 = stdvector;
227 if(!test::CheckEqualContainers(bcopy2, scopy2)) return false;
228
229 //Assignment from bigger vector with no capacity
230 bcopy2.erase(bcopy2.begin() + bcopy2.size()/2, bcopy2.end());
231 scopy2.erase(scopy2.begin() + scopy2.size()/2, scopy2.end());
232 bcopy2.shrink_to_fit();
233 MyStdVector(scopy2).swap(scopy2);
234
235 bcopy2 = boostvector;
236 scopy2 = stdvector;
237 if(!test::CheckEqualContainers(bcopy, scopy)) return false;
238
239 //Assignment with equal capacity
240 bcopy2 = boostvector;
241 scopy2 = stdvector;
242 if(!test::CheckEqualContainers(bcopy2, scopy2)) return false;
243 }
244
245 return true;
246 }
247
248 template<class MyBoostVector>
249 int vector_test()
250 {
251 typedef std::vector<int> MyStdVector;
252 typedef typename MyBoostVector::value_type IntType;
253 const int max = 100;
254
255 if(!test_range_insertion<MyBoostVector>()){
256 return 1;
257 }
258 { //Vector(n)
259 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp =
260 ::boost::movelib::make_unique<MyBoostVector>(100);
261 ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp =
262 ::boost::movelib::make_unique<MyStdVector>(100);
263 if(!test::CheckEqualContainers(*boostvectorp, *stdvectorp)) return 1;
264 }
265 { //Vector(n, alloc)
266 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp =
267 ::boost::movelib::make_unique<MyBoostVector>(100, typename MyBoostVector::allocator_type());
268 ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp =
269 ::boost::movelib::make_unique<MyStdVector>(100);
270 if(!test::CheckEqualContainers(*boostvectorp, *stdvectorp)) return 1;
271 }
272 { //Vector(Vector &&)
273 ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp =
274 ::boost::movelib::make_unique<MyStdVector>(100);
275 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp =
276 ::boost::movelib::make_unique<MyBoostVector>(100);
277 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp2 =
278 ::boost::movelib::make_unique<MyBoostVector>(::boost::move(*boostvectorp));
279 if(!test::CheckEqualContainers(*boostvectorp2, *stdvectorp)) return 1;
280 }
281 { //Vector(Vector &&, alloc)
282 ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp =
283 ::boost::movelib::make_unique<MyStdVector>(100);
284 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp =
285 ::boost::movelib::make_unique<MyBoostVector>(100);
286 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp2 =
287 ::boost::movelib::make_unique<MyBoostVector>
288 (::boost::move(*boostvectorp), typename MyBoostVector::allocator_type());
289 if(!test::CheckEqualContainers(*boostvectorp2, *stdvectorp)) return 1;
290 }
291 { //Vector operator=(Vector &&)
292 ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp =
293 ::boost::movelib::make_unique<MyStdVector>(100);
294 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp =
295 ::boost::movelib::make_unique<MyBoostVector>(100);
296 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp2 =
297 ::boost::movelib::make_unique<MyBoostVector>();
298 *boostvectorp2 = ::boost::move(*boostvectorp);
299 if(!test::CheckEqualContainers(*boostvectorp2, *stdvectorp)) return 1;
300 }
301 {
302 ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp = ::boost::movelib::make_unique<MyBoostVector>();
303 ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp = ::boost::movelib::make_unique<MyStdVector>();
304
305 MyBoostVector & boostvector = *boostvectorp;
306 MyStdVector & stdvector = *stdvectorp;
307
308 boostvector.resize(100);
309 stdvector.resize(100);
310 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
311
312 boostvector.resize(200);
313 stdvector.resize(200);
314 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
315
316 boostvector.resize(0);
317 stdvector.resize(0);
318 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
319
320 for(int i = 0; i < max; ++i){
321 IntType new_int(i);
322 boostvector.insert(boostvector.end(), boost::move(new_int));
323 stdvector.insert(stdvector.end(), i);
324 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
325 }
326 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
327
328 typename MyBoostVector::iterator boostit(boostvector.begin());
329 typename MyStdVector::iterator stdit(stdvector.begin());
330 typename MyBoostVector::const_iterator cboostit = boostit;
331 (void)cboostit;
332 ++boostit; ++stdit;
333 boostvector.erase(boostit);
334 stdvector.erase(stdit);
335 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
336
337 boostvector.erase(boostvector.begin());
338 stdvector.erase(stdvector.begin());
339 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
340
341 boostvector.erase(boostvector.end()-1);
342 stdvector.erase(stdvector.end()-1);
343 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
344
345 {
346 //Initialize values
347 IntType aux_vect[50];
348 for(int i = 0; i < 50; ++i){
349 IntType new_int(-1);
350 BOOST_STATIC_ASSERT((boost::container::test::is_copyable<boost::container::test::movable_int>::value == false));
351 aux_vect[i] = boost::move(new_int);
352 }
353 int aux_vect2[50];
354 for(int i = 0; i < 50; ++i){
355 aux_vect2[i] = -1;
356 }
357 typename MyBoostVector::iterator insert_it =
358 boostvector.insert(boostvector.end()
359 ,boost::make_move_iterator(&aux_vect[0])
360 ,boost::make_move_iterator(aux_vect + 50));
361 if(std::size_t(boost::container::iterator_distance(insert_it, boostvector.end())) != 50) return 1;
362 stdvector.insert(stdvector.end(), aux_vect2, aux_vect2 + 50);
363 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
364
365 for(int i = 0, j = static_cast<int>(boostvector.size()); i < j; ++i){
366 boostvector.erase(boostvector.begin());
367 stdvector.erase(stdvector.begin());
368 }
369 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
370 }
371 {
372 boostvector.resize(100);
373 stdvector.resize(100);
374 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
375
376 IntType aux_vect[50];
377 for(int i = 0; i < 50; ++i){
378 IntType new_int(-i);
379 aux_vect[i] = boost::move(new_int);
380 }
381 int aux_vect2[50];
382 for(int i = 0; i < 50; ++i){
383 aux_vect2[i] = -i;
384 }
385 typename MyBoostVector::size_type old_size = boostvector.size();
386 typename MyBoostVector::iterator insert_it =
387 boostvector.insert(boostvector.begin() + old_size/2
388 ,boost::make_move_iterator(&aux_vect[0])
389 ,boost::make_move_iterator(aux_vect + 50));
390 if(boostvector.begin() + old_size/2 != insert_it) return 1;
391 stdvector.insert(stdvector.begin() + old_size/2, aux_vect2, aux_vect2 + 50);
392 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
393
394 for(int i = 0; i < 50; ++i){
395 IntType new_int(-i);
396 aux_vect[i] = boost::move(new_int);
397 }
398
399 for(int i = 0; i < 50; ++i){
400 aux_vect2[i] = -i;
401 }
402 old_size = boostvector.size();
403 //Now try with input iterators instead
404 insert_it = boostvector.insert(boostvector.begin() + old_size/2
405 ,boost::make_move_iterator(make_input_from_forward_iterator(&aux_vect[0]))
406 ,boost::make_move_iterator(make_input_from_forward_iterator(aux_vect + 50))
407 );
408 if(boostvector.begin() + old_size/2 != insert_it) return 1;
409 stdvector.insert(stdvector.begin() + old_size/2, aux_vect2, aux_vect2 + 50);
410 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
411 }
412
413 boostvector.shrink_to_fit();
414 MyStdVector(stdvector).swap(stdvector);
415 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
416
417 boostvector.shrink_to_fit();
418 MyStdVector(stdvector).swap(stdvector);
419 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
420
421 { //push_back with not enough capacity
422 IntType push_back_this(1);
423 boostvector.push_back(boost::move(push_back_this));
424 stdvector.push_back(int(1));
425 boostvector.push_back(IntType(1));
426 stdvector.push_back(int(1));
427 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
428 }
429
430 { //test back()
431 const IntType test_this(1);
432 if(test_this != boostvector.back()) return 1;
433 }
434 { //pop_back with enough capacity
435 boostvector.pop_back();
436 boostvector.pop_back();
437 stdvector.pop_back();
438 stdvector.pop_back();
439
440 IntType push_back_this(1);
441 boostvector.push_back(boost::move(push_back_this));
442 stdvector.push_back(int(1));
443 boostvector.push_back(IntType(1));
444 stdvector.push_back(int(1));
445 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
446 }
447
448 if(!vector_copyable_only(boostvector, stdvector
449 ,dtl::bool_<boost::container::test::is_copyable<IntType>::value>())){
450 return 1;
451 }
452
453 boostvector.erase(boostvector.begin());
454 stdvector.erase(stdvector.begin());
455 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
456
457 for(int i = 0; i < max; ++i){
458 IntType insert_this(i);
459 boostvector.insert(boostvector.begin(), boost::move(insert_this));
460 stdvector.insert(stdvector.begin(), i);
461 boostvector.insert(boostvector.begin(), IntType(i));
462 stdvector.insert(stdvector.begin(), int(i));
463 }
464 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
465
466 //some comparison operators
467 if(!(boostvector == boostvector))
468 return 1;
469 if(boostvector != boostvector)
470 return 1;
471 if(boostvector < boostvector)
472 return 1;
473 if(boostvector > boostvector)
474 return 1;
475 if(!(boostvector <= boostvector))
476 return 1;
477 if(!(boostvector >= boostvector))
478 return 1;
479
480 //Test insertion from list
481 {
482 std::list<int> l(50, int(1));
483 typename MyBoostVector::iterator it_insert =
484 boostvector.insert(boostvector.begin(), l.begin(), l.end());
485 if(boostvector.begin() != it_insert) return 1;
486 stdvector.insert(stdvector.begin(), l.begin(), l.end());
487 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
488 boostvector.assign(l.begin(), l.end());
489 stdvector.assign(l.begin(), l.end());
490 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
491
492 boostvector.clear();
493 stdvector.clear();
494 boostvector.assign(make_input_from_forward_iterator(l.begin()), make_input_from_forward_iterator(l.end()));
495 stdvector.assign(l.begin(), l.end());
496 if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
497 }
498
499 if(!vector_vector_hash_function_capacity_only(boostvector, stdvector, dtl::bool_<vector_hash_function_capacity<MyBoostVector>::value>()))
500 return 1;
501
502 boostvector.clear();
503 stdvector.clear();
504 boostvector.shrink_to_fit();
505 MyStdVector(stdvector).swap(stdvector);
506 if(!test::CheckEqualContainers(boostvector, stdvector)) return false;
507
508 boostvector.resize(100);
509 if(!test_nth_index_of(boostvector))
510 return 1;
511
512 }
513 std::cout << std::endl << "Test OK!" << std::endl;
514 return 0;
515 }
516
517 template<typename VectorContainerType>
518 bool test_vector_methods_with_initializer_list_as_argument_for()
519 {
520 #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
521 typedef typename VectorContainerType::allocator_type allocator_type;
522 {
523 const VectorContainerType testedVector = {1, 2, 3};
524 const std::vector<int> expectedVector = {1, 2, 3};
525 if(!test::CheckEqualContainers(testedVector, expectedVector)) return false;
526 }
527 {
528 const VectorContainerType testedVector( { 1, 2, 3 }, allocator_type() );
529 const std::vector<int> expectedVector = {1, 2, 3};
530 if(!test::CheckEqualContainers(testedVector, expectedVector)) return false;
531 }
532 {
533 VectorContainerType testedVector = {1, 2, 3};
534 testedVector = {11, 12, 13};
535
536 const std::vector<int> expectedVector = {11, 12, 13};
537 if(!test::CheckEqualContainers(testedVector, expectedVector)) return false;
538 }
539
540 {
541 VectorContainerType testedVector = {1, 2, 3};
542 testedVector.assign({5, 6, 7});
543
544 const std::vector<int> expectedVector = {5, 6, 7};
545 if(!test::CheckEqualContainers(testedVector, expectedVector)) return false;
546 }
547
548 {
549 VectorContainerType testedVector = {1, 2, 3};
550 testedVector.insert(testedVector.cend(), {5, 6, 7});
551
552 const std::vector<int> expectedVector = {1, 2, 3, 5, 6, 7};
553 if(!test::CheckEqualContainers(testedVector, expectedVector)) return false;
554 }
555 return true;
556 #else
557 return true;
558 #endif
559 }
560
561 } //namespace test{
562 } //namespace container {
563 } //namespace boost{
564
565 #include <boost/container/detail/config_end.hpp>
566
567 #endif //BOOST_CONTAINER_TEST_VECTOR_TEST_HEADER