]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/interprocess/test/slist_test.cpp
1 //////////////////////////////////////////////////////////////////////////////
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)
7 // See http://www.boost.org/libs/interprocess for documentation.
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"
19 using namespace boost::interprocess
;
21 typedef allocator
<int, managed_shared_memory::segment_manager
> ShmemAllocator
;
22 typedef slist
<int, ShmemAllocator
> MyList
;
24 //typedef allocator<volatile int, managed_shared_memory::segment_manager> ShmemVolatileAllocator;
25 //typedef slist<volatile int, ShmemVolatileAllocator> MyVolatileList;
27 typedef allocator
<test::movable_int
, managed_shared_memory::segment_manager
> ShmemMoveAllocator
;
28 typedef slist
<test::movable_int
, ShmemMoveAllocator
> MyMoveList
;
30 typedef allocator
<test::movable_and_copyable_int
, managed_shared_memory::segment_manager
> ShmemCopyMoveAllocator
;
31 typedef slist
<test::movable_and_copyable_int
, ShmemCopyMoveAllocator
> MyCopyMoveList
;
33 typedef allocator
<test::copyable_int
, managed_shared_memory::segment_manager
> ShmemCopyAllocator
;
34 typedef slist
<test::copyable_int
, ShmemCopyAllocator
> MyCopyList
;
38 if(test::list_test
<managed_shared_memory
, MyList
, false>())
41 if(test::list_test
<managed_shared_memory
, MyMoveList
, false>())
44 if(test::list_test
<managed_shared_memory
, MyCopyMoveList
, false>())
47 if(test::list_test
<managed_shared_memory
, MyCopyList
, false>())
50 const test::EmplaceOptions Options
= (test::EmplaceOptions
)
51 (test::EMPLACE_FRONT
| test::EMPLACE_AFTER
| test::EMPLACE_BEFORE
| test::EMPLACE_AFTER
);
53 if(!boost::interprocess::test::test_emplace
54 < slist
<test::EmplaceInt
>, Options
>())