| 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 | #include "container_tests.hpp" |
| 8 | |
| 9 | std::deque<int> const build_deque() |
| 10 | { |
| 11 | std::vector<int> const data = build_vector(); |
| 12 | return std::deque<int>(data.begin(), data.end()); |
| 13 | } |
| 14 | |
| 15 | std::vector<int> const init_vector() |
| 16 | { |
| 17 | typedef std::vector<int> int_vector; |
| 18 | int const data[] = { -4, -3, -2, -1, 0 }; |
| 19 | int_vector::size_type const data_size = sizeof(data) / sizeof(data[0]); |
| 20 | return int_vector(data, data + data_size); |
| 21 | } |
| 22 | |
| 23 | std::vector<int> const build_vector() |
| 24 | { |
| 25 | typedef std::vector<int> int_vector; |
| 26 | static int_vector data = init_vector(); |
| 27 | int_vector::size_type const size = data.size(); |
| 28 | int_vector::iterator it = data.begin(); |
| 29 | int_vector::iterator const end = data.end(); |
| 30 | for (; it != end; ++it) |
| 31 | *it += size; |
| 32 | return data; |
| 33 | } |
| 34 | |
| 35 | int |
| 36 | main() |
| 37 | { |
| 38 | BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::deque<int> >::value)); |
| 39 | BOOST_STATIC_ASSERT((!phx::stl::has_key_type<std::deque<int> >::value)); |
| 40 | |
| 41 | std::deque<int> const data = build_deque(); |
| 42 | test_insert(c: data); |
| 43 | test_max_size(c: data); |
| 44 | test_pop_back(c: data); |
| 45 | test_pop_front(c: data); |
| 46 | test_push_back(c: data); |
| 47 | test_push_front(c: data); |
| 48 | test_rbegin(c: data); |
| 49 | test_rend(c: data); |
| 50 | test_resize(c: data); |
| 51 | test_size(c: data); |
| 52 | return boost::report_errors(); |
| 53 | } |
| 54 | |
| 55 | |
| 56 |
