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