]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/phoenix/test/container/container_tests.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / phoenix / test / container / container_tests.hpp
1 /*=============================================================================
2 Copyright (c) 2004 Angus Leeming
3
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(CONTAINER_TESTS_HPP)
8 #define CONTAINER_TESTS_HPP
9
10 #include <boost/detail/lightweight_test.hpp>
11 #include <boost/phoenix/core.hpp>
12 #include <boost/phoenix/stl/container/container.hpp>
13
14 #include <iostream>
15 #include <typeinfo>
16 #include <deque>
17 #include <list>
18 #include <map>
19 #include <vector>
20 #include <utility>
21
22 #ifdef BOOST_MSVC
23 #pragma warning(disable : 4800)
24 #endif
25
26 using std::cerr;
27 namespace phx = boost::phoenix;
28
29 std::deque<int> const build_deque();
30 std::list<int> const build_list();
31 std::map<int, int> const build_map();
32 std::multimap<int, int> const build_multimap();
33 std::vector<int> const build_vector();
34
35 inline bool
36 test(bool fail)
37 {
38 BOOST_TEST(!fail);
39 return fail;
40 }
41
42 template <typename Container>
43 void test_assign(Container c)
44 {
45 using phx::arg_names::arg1;
46
47 typename Container::size_type count = 2;
48 typename Container::const_iterator first = c.begin();
49 typename Container::const_iterator second = first;
50 typename Container::value_type value = *first;
51
52 phx::assign(arg1, count, value)(c);
53
54 // iterators may be invalidated!
55 first = c.begin();
56 second = first;
57
58 std::advance(second, 1);
59 if (test(*first != *second)) {
60 cerr << "Failed " << typeid(Container).name() << " test_assign 1\n";
61 return;
62 }
63 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
64 // Should not --- does not, Yay! --- compile.
65 Container const const_c = c;
66 phx::assign(const_c, count, value);
67 #endif
68 }
69
70 template <typename Container>
71 void test_assign2(Container c)
72 {
73 using phx::arg_names::arg1;
74 using phx::arg_names::arg2;
75 using phx::arg_names::arg3;
76
77 Container c2 = c;
78 typename Container::const_iterator first = c2.begin();
79 typename Container::const_iterator last = c2.end();
80 typename Container::size_type size = c2.size();
81
82 c.clear();
83 phx::assign(arg1, arg2, arg3)(c, first, last);
84 if (test(c.size() != size)) {
85 cerr << "Failed " << typeid(Container).name()
86 << " test_assign2 1\n"
87 << "size == " << c.size() << '\n';
88 return;
89 }
90
91 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
92 // Should not --- does not, Yay! --- compile.
93 Container const const_c = c;
94 phx::assign(const_c, first, second);
95 #endif
96 }
97
98 template <typename Container>
99 void test_at(Container c)
100 {
101 using phx::arg_names::arg1;
102 using phx::at;
103
104 typename Container::reference r1 = at(arg1, 0)(c);
105 if (test(r1 != c.at(0))) {
106 cerr << "Failed " << typeid(Container).name() << " test_at 1\n";
107 return;
108 }
109
110 typename Container::const_reference r2 = at(arg1, 0)(c);
111 if (test(r2 != c.at(0))) {
112 cerr << "Failed " << typeid(Container).name() << " test_at 2\n";
113 return;
114 }
115
116 Container const const_c = c;
117 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
118 // Should not --- does not, Yay! --- compile.
119 typename Container::reference r3 = at(arg1, 0)(const_c);
120 #endif
121
122 typename Container::const_reference r4 = at(arg1, 0)(const_c);
123 if (test(r4 != c.at(0))) {
124 cerr << "Failed " << typeid(Container).name() << " test_at 4\n";
125 return;
126 }
127 }
128
129 template <typename Container>
130 void test_back(Container c)
131 {
132 using phx::arg_names::arg1;
133 using phx::back;
134
135 typename Container::reference r1 = back(arg1)(c);
136 if (test(r1 != c.back())) {
137 cerr << "Failed " << typeid(Container).name() << " test_back 1\n";
138 return;
139 }
140 typename Container::const_reference r2 = back(arg1)(c);
141 if (test(r2 != c.back())) {
142 cerr << "Failed " << typeid(Container).name() << " test_back 2\n";
143 return;
144 }
145
146 Container const const_c = c;
147 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
148 // Should not --- does not, Yay! --- compile.
149 typename Container::reference r3 = back(arg1)(const_c);
150 #endif
151
152 typename Container::const_reference r4 = back(arg1)(const_c);
153 if (test(r4 != c.back())) {
154 cerr << "Failed " << typeid(Container).name() << " test_back 4\n";
155 return;
156 }
157 }
158
159 template <typename Container>
160 void test_begin(Container c)
161 {
162 using phx::arg_names::arg1;
163 using phx::begin;
164
165 typename Container::iterator it1 = begin(arg1)(c);
166 if (test(it1 != c.begin())) {
167 cerr << "Failed " << typeid(Container).name() << " test_begin 1\n";
168 return;
169 }
170 typename Container::const_iterator it2 = begin(arg1)(c);
171 if (test(it2 != c.begin())) {
172 cerr << "Failed " << typeid(Container).name() << " test_begin 2\n";
173 return;
174 }
175
176 Container const const_c = c;
177 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
178 // Should not --- does not, Yay! --- compile.
179 typename Container::iterator it3 = begin(arg1)(const_c);
180 #endif
181
182 typename Container::const_iterator it4 = begin(arg1)(const_c);
183 if (test(it4 != const_c.begin())) {
184 cerr << "Failed " << typeid(Container).name() << " test_begin 4\n";
185 return;
186 }
187 }
188
189 template <typename Container>
190 void test_capacity(Container c)
191 {
192 using phx::arg_names::arg1;
193 using phx::capacity;
194
195 typename Container::size_type s1 = capacity(arg1)(c);
196 if (test(s1 != c.capacity())) {
197 cerr << "Failed " << typeid(Container).name() << " test_capacity 1\n";
198 return;
199 }
200
201 Container const const_c = c;
202 typename Container::size_type s2 = capacity(arg1)(const_c);
203 if (test(s2 != const_c.capacity())) {
204 cerr << "Failed " << typeid(Container).name() << " test_capacity 2\n";
205 return;
206 }
207 }
208
209 template <typename Container>
210 void test_clear(Container c)
211 {
212 using phx::arg_names::arg1;
213 using phx::clear;
214
215 clear(arg1)(c);
216 if (test(!c.empty())) {
217 cerr << "Failed " << typeid(Container).name() << " test_clear 1\n";
218 return;
219 }
220
221 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
222 Container const const_c = c;
223 clear(arg1)(const_c);
224 #endif
225 }
226
227 template <typename Container>
228 void test_empty(Container c)
229 {
230 using phx::arg_names::arg1;
231 using phx::empty;
232
233 typename Container::size_type s1 = empty(arg1)(c);
234 if (test(bool(s1) != c.empty())) {
235 cerr << "Failed " << typeid(Container).name() << " test_empty 1\n";
236 return;
237 }
238
239 Container const const_c = c;
240 typename Container::size_type s2 = empty(arg1)(const_c);
241 if (test(bool(s2) != const_c.empty())) {
242 cerr << "Failed " << typeid(Container).name() << " test_empty 2\n";
243 return;
244 }
245 }
246
247 template <typename Container>
248 void test_end(Container c)
249 {
250 using phx::arg_names::arg1;
251 using phx::end;
252
253 typename Container::iterator it1 = end(arg1)(c);
254 if (test(it1 != c.end())) {
255 cerr << "Failed " << typeid(Container).name() << " test_end 1\n";
256 return;
257 }
258 typename Container::const_iterator it2 = end(arg1)(c);
259 if (test(it2 != c.end())) {
260 cerr << "Failed " << typeid(Container).name() << " test_end 2\n";
261 return;
262 }
263
264 Container const const_c = c;
265 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
266 // Should not --- does not, Yay! --- compile.
267 typename Container::iterator it3 = end(arg1)(const_c);
268 #endif
269
270 typename Container::const_iterator it4 = end(arg1)(const_c);
271 if (test(it4 != const_c.end())) {
272 cerr << "Failed " << typeid(Container).name() << " test_end 4\n";
273 return;
274 }
275 }
276
277 template <typename Container>
278 void test_erase(Container c)
279 {
280 using phx::arg_names::arg1;
281 using phx::arg_names::arg2;
282 using phx::arg_names::arg3;
283 using phx::erase;
284
285 Container const const_c = c;
286
287 typename Container::size_type size = c.size();
288 typename Container::iterator c_begin = c.begin();
289 erase(arg1, arg2)(c, c_begin);
290 if (test(c.size() + 1 != size)) {
291 cerr << "Failed " << typeid(Container).name() << " test_erase 1\n";
292 return;
293 }
294
295 c_begin = c.begin();
296 typename Container::iterator c_end = c.end();
297 erase(arg1, arg2, arg3)(c, c_begin, c_end);
298 if (test(!c.empty())) {
299 cerr << "Failed " << typeid(Container).name() << " test_erase 2\n";
300 return;
301 }
302
303 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
304 erase(arg1, const_c.begin())(const_c);
305 erase(arg1, const_c.begin(), const_c.end())(const_c);
306 #endif
307 }
308
309 template <typename Container>
310 void test_map_erase(Container c)
311 {
312 test_erase(c);
313 if (boost::report_errors() != 0)
314 return;
315
316 using phx::arg_names::arg1;
317 using phx::arg_names::arg2;
318 using phx::erase;
319
320 typename Container::value_type const value = *c.begin();
321 typename Container::key_type const key = value.first;
322 typename Container::size_type const removed =
323 erase(arg1, arg2)(c, key);
324 if (test(removed != 1)) {
325 cerr << "Failed " << typeid(Container).name() << " test_map_erase 1\n";
326 return;
327 }
328 }
329
330 template <typename Container>
331 void test_front(Container c)
332 {
333 using phx::arg_names::arg1;
334 using phx::front;
335
336 typename Container::reference r1 = front(arg1)(c);
337 if (test(r1 != c.front())) {
338 cerr << "Failed " << typeid(Container).name() << " test_front 1\n";
339 return;
340 }
341 typename Container::const_reference r2 = front(arg1)(c);
342 if (test(r2 != c.front())) {
343 cerr << "Failed " << typeid(Container).name() << " test_front 2\n";
344 return;
345 }
346
347 Container const const_c = c;
348 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
349 // Should not --- does not, Yay! --- compile.
350 typename Container::reference r3 = front(arg1)(const_c);
351 #endif
352
353 typename Container::const_reference r4 = front(arg1)(const_c);
354 if (test(r4 != c.front())) {
355 cerr << "Failed " << typeid(Container).name() << " test_front 4\n";
356 return;
357 }
358 }
359
360 template <typename Container>
361 void test_get_allocator(Container c)
362 {
363 using phx::arg_names::arg1;
364 using phx::get_allocator;
365
366 Container const const_c = c;
367
368 typename Container::allocator_type a1 = get_allocator(arg1)(c);
369 if (test(a1 != c.get_allocator())) {
370 cerr << "Failed " << typeid(Container).name() << " test_get_allocator 1\n";
371 return;
372 }
373
374 typename Container::allocator_type a2 = get_allocator(arg1)(const_c);
375 if (test(a2 != const_c.get_allocator())) {
376 cerr << "Failed " << typeid(Container).name() << " test_get_allocator 2\n";
377 return;
378 }
379 }
380
381 template <typename Container>
382 void test_insert(Container c)
383 {
384 using phx::arg_names::arg1;
385 using phx::insert;
386
387 typename Container::value_type const value = *c.begin();
388 typename Container::iterator it = insert(arg1, c.begin(), value)(c);
389 if (test(it != c.begin() || *it != *(++it))) {
390 cerr << "Failed " << typeid(Container).name() << " test_insert 1\n";
391 return;
392 }
393
394 typename Container::size_type size = c.size();
395 insert(arg1, c.begin(), 3, value)(c);
396 if (test(c.size() != size + 3)) {
397 cerr << "Failed " << typeid(Container).name() << " test_insert 2\n";
398 return;
399 }
400
401 Container const const_c = c;
402 size = c.size();
403 insert(arg1, c.begin(), const_c.begin(), const_c.end())(c);
404 if (test(c.size() != 2 * size)) {
405 cerr << "Failed " << typeid(Container).name() << " test_insert 3\n";
406 return;
407 }
408 }
409
410 inline void test_map_insert(std::map<int, int> c)
411 {
412 using phx::arg_names::arg1;
413 using phx::arg_names::arg2;
414 using phx::arg_names::arg3;
415
416 typedef std::map<int, int> Map;
417
418 Map::value_type const value = *c.begin();
419 Map::iterator c_begin = c.begin();
420 // wrapper for
421 // iterator insert(iterator where, const value_type& val);
422 Map::iterator it =
423 phx::insert(arg1, arg2, arg3)(c, c_begin, value);
424
425 if (test(it != c.begin() /*|| *it != *(++it)*/)) {
426 cerr << "Failed " << typeid(Map).name() << " test_map_insert 1\n";
427 return;
428 }
429
430 // wrapper for
431 // pair<iterator, bool> insert(const value_type& val);
432 Map::value_type const value2(1400, 2200);
433 std::pair<Map::iterator, bool> result =
434 phx::insert(arg1, arg2)(c, value2);
435 if (test(!result.second)) {
436 cerr << "Failed " << typeid(Map).name() << " test_map_insert 2\n";
437 return;
438 }
439
440 // wrapper for
441 // template<class InIt>
442 // void insert(InIt first, InIt last);
443 Map const const_c = build_map();
444 Map::size_type size = c.size();
445 phx::insert(arg1, const_c.begin(), const_c.end())(c);
446 if (test(c.size() != size + const_c.size())) {
447 cerr << "Failed " << typeid(Map).name() << " test_map_insert 3\n";
448 return;
449 }
450 }
451
452 inline void test_multimap_insert(std::multimap<int, int> c)
453 {
454 using phx::arg_names::arg1;
455 using phx::arg_names::arg2;
456 using phx::arg_names::arg3;
457
458 typedef std::multimap<int, int> Multimap;
459
460 Multimap::value_type const value = *c.begin();
461 Multimap::iterator c_begin = c.begin();
462 std::size_t old_size = c.size();
463 // wrapper for
464 // iterator insert(iterator where, const value_type& val);
465 Multimap::iterator it =
466 phx::insert(arg1, arg2, arg3)(c, c_begin, value);
467
468 if (test(*it != value || c.size() != old_size + 1)) {
469 cerr << "Failed " << typeid(Multimap).name()
470 << " test_multimap_insert 1\n";
471 return;
472 }
473
474 // wrapper for
475 // iterator insert(const value_type& val);
476 Multimap::value_type const value2(1400, 2200);
477 it = phx::insert(arg1, arg2)(c, value2);
478 if (test(it == c.end())) {
479 cerr << "Failed " << typeid(Multimap).name()
480 << " test_multimap_insert 2\n";
481 return;
482 }
483
484 // wrapper for
485 // template<class InIt>
486 // void insert(InIt first, InIt last);
487 Multimap const const_c = build_multimap();
488 Multimap::size_type size = c.size();
489 phx::insert(arg1, const_c.begin(), const_c.end())(c);
490 if (test(c.size() != size + const_c.size())) {
491 cerr << "Failed " << typeid(Multimap).name()
492 << " test_multimap_insert 3\n";
493 return;
494 }
495 }
496
497 template <typename Container>
498 void test_key_comp(Container c)
499 {
500 using phx::arg_names::arg1;
501 using phx::key_comp;
502
503 typename Container::key_compare comp = key_comp(arg1)(c);
504
505 Container const const_c = c;
506 comp = key_comp(arg1)(const_c);
507 }
508
509 template <typename Container>
510 void test_max_size(Container c)
511 {
512 using phx::arg_names::arg1;
513 using phx::max_size;
514
515 Container const const_c = c;
516
517 typename Container::size_type s1 = max_size(arg1)(c);
518 if (test(s1 != c.max_size())) {
519 cerr << "Failed " << typeid(Container).name() << " test_max_size 1\n";
520 return;
521 }
522
523 typename Container::size_type s2 = max_size(arg1)(const_c);
524 if (test(s2 != const_c.max_size())) {
525 cerr << "Failed " << typeid(Container).name() << " test_max_size 2\n";
526 return;
527 }
528 }
529
530 template <typename Container>
531 void test_pop_back(Container c)
532 {
533 using phx::arg_names::arg1;
534 using phx::pop_back;
535
536 Container const const_c = c;
537
538 typename Container::size_type size = c.size();
539
540 pop_back(arg1)(c);
541 if (test(c.size() + 1 != size)) {
542 cerr << "Failed " << typeid(Container).name() << " test_pop_back 1\n";
543 return;
544 }
545
546 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
547 pop_back(arg1)(const_c);
548 #endif
549 }
550
551 template <typename Container>
552 void test_pop_front(Container c)
553 {
554 using phx::arg_names::arg1;
555 using phx::pop_front;
556
557 Container const const_c = c;
558
559 typename Container::size_type size = c.size();
560
561 pop_front(arg1)(c);
562 if (test(c.size() + 1 != size)) {
563 cerr << "Failed " << typeid(Container).name() << " test_pop_front 1\n";
564 return;
565 }
566 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
567 pop_front(arg1)(const_c);
568 #endif
569 }
570
571 template <typename Container>
572 void test_push_back(Container c)
573 {
574 using phx::arg_names::arg1;
575 using phx::arg_names::arg2;
576 using phx::push_back;
577
578 Container const const_c = c;
579
580 typename Container::value_type data = *c.begin();
581 typename Container::size_type size = c.size();
582 push_back(arg1, arg2)(c, data);
583 if (test(c.size() != size + 1)) {
584 cerr << "Failed " << typeid(Container).name() << " test_push_back 1\n";
585 return;
586 }
587 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
588 push_back(arg1, arg2)(const_c, data);
589 #endif
590 }
591
592 template <typename Container>
593 void test_push_front(Container c)
594 {
595 using phx::arg_names::arg1;
596 using phx::arg_names::arg2;
597 using phx::push_front;
598
599 Container const const_c = c;
600
601 typename Container::value_type data = *c.begin();
602 typename Container::size_type size = c.size();
603 push_front(arg1, arg2)(c, data);
604 if (test(c.size() != size + 1)) {
605 cerr << "Failed " << typeid(Container).name() << " test_push_front 1\n";
606 return;
607 }
608 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
609 push_front(arg1, arg2)(const_c, data);
610 #endif
611 }
612
613 template <typename Container>
614 void test_rbegin(Container c)
615 {
616 using phx::arg_names::arg1;
617 using phx::rbegin;
618
619 typename Container::reverse_iterator it1 = rbegin(arg1)(c);
620 typename Container::reverse_iterator it1_test = c.rbegin();
621 if (test(it1 != it1_test)) {
622 cerr << "Failed " << typeid(Container).name() << " test_rbegin 1\n";
623 return;
624 }
625 typename Container::const_reverse_iterator it2 = rbegin(arg1)(c);
626 typename Container::const_reverse_iterator it2_test = c.rbegin();
627 if (test(it2 != it2_test)) {
628 cerr << "Failed " << typeid(Container).name() << " test_rbegin 2\n";
629 return;
630 }
631
632 Container const const_c = c;
633 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
634 // Should not --- does not, Yay! --- compile.
635 typename Container::reverse_iterator it3 = rbegin(arg1)(const_c);
636 #endif
637
638 typename Container::const_reverse_iterator it4 = rbegin(arg1)(const_c);
639 it2_test = const_c.rbegin();
640 if (test(it4 != it2_test)) {
641 cerr << "Failed " << typeid(Container).name() << " test_rbegin 4\n";
642 return;
643 }
644 }
645
646 template <typename Container>
647 void test_rend(Container c)
648 {
649 using phx::arg_names::arg1;
650 using phx::rend;
651
652 typename Container::reverse_iterator it1 = rend(arg1)(c);
653 typename Container::reverse_iterator it1_test = c.rend();
654 if (test(it1 != it1_test)) {
655 cerr << "Failed " << typeid(Container).name() << " test_rend 1\n";
656 return;
657 }
658 typename Container::const_reverse_iterator it2 = rend(arg1)(c);
659 typename Container::const_reverse_iterator it2_test = c.rend();
660 if (test(it2 != it2_test)) {
661 cerr << "Failed " << typeid(Container).name() << " test_rend 2\n";
662 return;
663 }
664
665 Container const const_c = c;
666 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
667 // Should not --- does not, Yay! --- compile.
668 typename Container::reverse_iterator it3 = rend(arg1)(const_c);
669 #endif
670
671 typename Container::const_reverse_iterator it4 = rend(arg1)(const_c);
672 it2_test = const_c.rend();
673 if (test(it4 != it2_test)) {
674 cerr << "Failed " << typeid(Container).name() << " test_rend 4\n";
675 return;
676 }
677 }
678
679 template <typename Container>
680 void test_reserve(Container c)
681 {
682 using phx::arg_names::arg1;
683 using phx::reserve;
684
685 Container const const_c = c;
686
687 typename Container::size_type count = 2 * c.size();
688 reserve(arg1, count)(c);
689 if (test(c.capacity() < count)) {
690 cerr << "Failed " << typeid(Container).name() << " test_reserve 1\n";
691 return;
692 }
693 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
694 reserve(arg1, count)(const_c)(const_c);
695 #endif
696 }
697
698 template <typename Container>
699 void test_resize(Container c)
700 {
701 using phx::arg_names::arg1;
702 using phx::resize;
703
704 Container const const_c = c;
705
706 typename Container::size_type new_size = 2 * c.size();
707 resize(arg1, new_size)(c);
708 if (test(c.size() != new_size)) {
709 cerr << "Failed " << typeid(Container).name() << " test_resize 1\n";
710 return;
711 }
712
713 new_size = 2 * c.size();
714 typename Container::value_type value = *c.begin();
715 resize(arg1, new_size, value)(c);
716 if (test(c.size() != new_size)) {
717 cerr << "Failed " << typeid(Container).name() << " test_resize 2\n";
718 return;
719 }
720 #if defined(BOOST_PHOENIX_COMPILE_FAIL_TEST)
721 new_size = 2 * const_c.size();
722 resize(arg1, new_size)(const_c);
723
724 new_size = 2 * const_c.size();
725 resize(arg1, new_size, value)(const_c);
726 #endif
727 }
728
729 template <typename Container>
730 void test_size(Container c)
731 {
732 using phx::arg_names::arg1;
733 using phx::size;
734
735 Container const const_c = c;
736
737 typename Container::size_type s1 = size(arg1)(c);
738 if (test(s1 != c.size())) {
739 cerr << "Failed " << typeid(Container).name() << " test_size 1\n";
740 return;
741 }
742
743 typename Container::size_type s2 = size(arg1)(const_c);
744 if (test(s2 != const_c.size())) {
745 cerr << "Failed " << typeid(Container).name() << " test_size 2\n";
746 return;
747 }
748 }
749
750 template <typename Container>
751 void test_splice(Container c)
752 {
753 using phx::arg_names::arg1;
754 using phx::arg_names::arg2;
755 using phx::arg_names::arg3;
756 using phx::arg_names::arg4;
757 using phx::arg_names::arg5;
758 using phx::splice;
759
760 typename Container::iterator c_end;
761 typename Container::iterator c2_begin;
762 typename Container::iterator c2_end;
763 typename Container::size_type size = c.size();
764
765 Container const copy = c;
766 Container const copy2 = build_list();
767 Container c2 = copy2;
768
769 size = c.size();
770 c_end = c.end();
771 splice(arg1, arg2, arg3)(c, c_end, c2);
772 if (test(c.size() != 2 * size)) {
773 cerr << "Failed " << typeid(Container).name() << " test_splice 1\n";
774 return;
775 }
776
777 c = copy;
778 c_end = c.end();
779 c2 = copy2;
780 c2_begin = c2.begin();
781 size = c.size() + 1;
782 splice(arg1, arg2, arg3, arg4)(c, c_end, c2, c2_begin);
783 if (test(c.size() != size)) {
784 cerr << "Failed " << typeid(Container).name() << " test_splice 2\n";
785 return;
786 }
787
788 c = copy;
789 c_end = c.end();
790 c2 = copy2;
791 c2_begin = c2.begin();
792 c2_end = c2.end();
793 size = c.size() + c2.size();
794 /*
795 splice(arg1, arg2, arg3, arg4, arg5)(c, c_end, c2, c2_begin, c2_end);
796 if (test(c.size() != size)) {
797 cerr << "Failed " << typeid(Container).name() << " test_splice 3\n";
798 return;
799 }
800 */
801 }
802
803 template <typename Container>
804 void test_value_comp(Container c)
805 {
806 using phx::arg_names::arg1;
807 using phx::value_comp;
808
809 typename Container::value_compare comp = value_comp(arg1)(c);
810
811 Container const const_c = c;
812 comp = value_comp(arg1)(const_c);
813 }
814
815 #endif