1 | ////////////////////////////////////////////////////////////////////////////// |
2 | // |
3 | // (C) Copyright Ion Gaztanaga 2004-2012. 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/interprocess for documentation. |
8 | // |
9 | ////////////////////////////////////////////////////////////////////////////// |
10 | |
11 | #include <boost/interprocess/managed_shared_memory.hpp> |
12 | #include <boost/interprocess/containers/stable_vector.hpp> |
13 | #include <boost/interprocess/allocators/allocator.hpp> |
14 | #include "allocator_v1.hpp" |
15 | #include "heap_allocator_v1.hpp" |
16 | #include "check_equal_containers.hpp" |
17 | #include "movable_int.hpp" |
18 | #include "expand_bwd_test_allocator.hpp" |
19 | #include "expand_bwd_test_template.hpp" |
20 | #include "dummy_test_allocator.hpp" |
21 | #include "vector_test.hpp" |
22 | |
23 | using namespace boost::interprocess; |
24 | |
25 | int main() |
26 | { |
27 | typedef allocator<int, managed_shared_memory::segment_manager> ShmemAllocator; |
28 | typedef stable_vector<int, ShmemAllocator> MyVector; |
29 | |
30 | typedef test::allocator_v1<int, managed_shared_memory::segment_manager> ShmemV1Allocator; |
31 | typedef stable_vector<int, ShmemV1Allocator> MyV1Vector; |
32 | |
33 | typedef test::heap_allocator_v1<int, managed_shared_memory::segment_manager> ShmemHeapV1Allocator; |
34 | typedef stable_vector<int, ShmemHeapV1Allocator> MyHeapV1Vector; |
35 | |
36 | typedef allocator<test::movable_int, managed_shared_memory::segment_manager> ShmemMoveAllocator; |
37 | typedef stable_vector<test::movable_int, ShmemMoveAllocator> MyMoveVector; |
38 | |
39 | typedef allocator<test::movable_and_copyable_int, managed_shared_memory::segment_manager> ShmemCopyMoveAllocator; |
40 | typedef stable_vector<test::movable_and_copyable_int, ShmemCopyMoveAllocator> MyCopyMoveVector; |
41 | |
42 | typedef allocator<test::copyable_int, managed_shared_memory::segment_manager> ShmemCopyAllocator; |
43 | typedef stable_vector<test::copyable_int, ShmemCopyAllocator> MyCopyVector; |
44 | |
45 | if(test::vector_test<managed_shared_memory, MyVector>()) |
46 | return 1; |
47 | |
48 | if(test::vector_test<managed_shared_memory, MyV1Vector>()) |
49 | return 1; |
50 | |
51 | if(test::vector_test<managed_shared_memory, MyHeapV1Vector>()) |
52 | return 1; |
53 | |
54 | if(test::vector_test<managed_shared_memory, MyMoveVector>()) |
55 | return 1; |
56 | |
57 | if(test::vector_test<managed_shared_memory, MyCopyMoveVector>()) |
58 | return 1; |
59 | |
60 | if(test::vector_test<managed_shared_memory, MyCopyVector>()) |
61 | return 1; |
62 | |
63 | const test::EmplaceOptions Options = (test::EmplaceOptions)(test::EMPLACE_BACK | test::EMPLACE_BEFORE); |
64 | if(!boost::interprocess::test::test_emplace |
65 | < stable_vector<test::EmplaceInt>, Options>()) |
66 | return 1; |
67 | |
68 | return 0; |
69 | } |
70 | |