]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/interprocess/test/list_test.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / interprocess / test / list_test.cpp
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/detail/config_begin.hpp>
12 #include <boost/interprocess/managed_shared_memory.hpp>
13 #include <boost/interprocess/containers/list.hpp>
14 #include <boost/interprocess/allocators/allocator.hpp>
15 #include <boost/interprocess/offset_ptr.hpp>
16 #include "dummy_test_allocator.hpp"
17 #include "list_test.hpp"
18 #include "movable_int.hpp"
19 #include "emplace_test.hpp"
20
21 using namespace boost::interprocess;
22
23 typedef allocator<int, managed_shared_memory::segment_manager> ShmemAllocator;
24 typedef list<int, ShmemAllocator> MyList;
25
26 //typedef allocator<volatile int, managed_shared_memory::segment_manager> ShmemVolatileAllocator;
27 //typedef list<volatile int, ShmemVolatileAllocator> MyVolatileList;
28
29 typedef allocator<test::movable_int, managed_shared_memory::segment_manager> ShmemMoveAllocator;
30 typedef list<test::movable_int, ShmemMoveAllocator> MyMoveList;
31
32 typedef allocator<test::movable_and_copyable_int, managed_shared_memory::segment_manager> ShmemCopyMoveAllocator;
33 typedef list<test::movable_and_copyable_int, ShmemCopyMoveAllocator> MyCopyMoveList;
34
35 typedef allocator<test::copyable_int, managed_shared_memory::segment_manager> ShmemCopyAllocator;
36 typedef list<test::copyable_int, ShmemCopyAllocator> MyCopyList;
37
38 int main ()
39 {
40 if(test::list_test<managed_shared_memory, MyList, true>())
41 return 1;
42
43 // if(test::list_test<managed_shared_memory, MyVolatileList, true>())
44 // return 1;
45
46 if(test::list_test<managed_shared_memory, MyMoveList, true>())
47 return 1;
48
49 if(test::list_test<managed_shared_memory, MyCopyMoveList, true>())
50 return 1;
51
52 if(test::list_test<managed_shared_memory, MyCopyList, true>())
53 return 1;
54
55 const test::EmplaceOptions Options = (test::EmplaceOptions)(test::EMPLACE_BACK | test::EMPLACE_FRONT | test::EMPLACE_BEFORE);
56
57 if(!boost::interprocess::test::test_emplace<list<test::EmplaceInt>, Options>())
58 return 1;
59
60 return 0;
61 }
62
63 #include <boost/interprocess/detail/config_end.hpp>