From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/boost/libs/interprocess/test/vector_test.cpp | 103 +++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 src/boost/libs/interprocess/test/vector_test.cpp (limited to 'src/boost/libs/interprocess/test/vector_test.cpp') diff --git a/src/boost/libs/interprocess/test/vector_test.cpp b/src/boost/libs/interprocess/test/vector_test.cpp new file mode 100644 index 00000000..6a3931c2 --- /dev/null +++ b/src/boost/libs/interprocess/test/vector_test.cpp @@ -0,0 +1,103 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/interprocess for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include "allocator_v1.hpp" +#include "check_equal_containers.hpp" +#include "movable_int.hpp" +#include "expand_bwd_test_allocator.hpp" +#include "expand_bwd_test_template.hpp" +#include "dummy_test_allocator.hpp" +#include "vector_test.hpp" + +using namespace boost::interprocess; + +int test_expand_bwd() +{ + //Now test all back insertion possibilities + + //First raw ints + typedef test::expand_bwd_test_allocator + int_allocator_type; + typedef vector + int_vector; + + if(!test::test_all_expand_bwd()) + return 1; + + //Now user defined wrapped int + typedef test::expand_bwd_test_allocator + int_holder_allocator_type; + typedef vector + int_holder_vector; + + if(!test::test_all_expand_bwd()) + return 1; + + //Now user defined bigger wrapped int + typedef test::expand_bwd_test_allocator + triple_int_holder_allocator_type; + + typedef vector + triple_int_holder_vector; + + if(!test::test_all_expand_bwd()) + return 1; + + return 0; +} + +int main() +{ + typedef allocator ShmemAllocator; + typedef vector MyVector; + + typedef test::allocator_v1 ShmemV1Allocator; + typedef vector MyV1Vector; + + typedef allocator ShmemMoveAllocator; + typedef vector MyMoveVector; + + typedef allocator ShmemCopyMoveAllocator; + typedef vector MyCopyMoveVector; + + typedef allocator ShmemCopyAllocator; + typedef vector MyCopyVector; + + if(test::vector_test()) + return 1; + + if(test::vector_test()) + return 1; + + if(test::vector_test()) + return 1; + + if(test::vector_test()) + return 1; + + if(test::vector_test()) + return 1; + + if(test_expand_bwd()) + return 1; + + const test::EmplaceOptions Options = (test::EmplaceOptions)(test::EMPLACE_BACK | test::EMPLACE_BEFORE); + if(!boost::interprocess::test::test_emplace + < vector, Options>()) + return 1; + + return 0; +} + +#include -- cgit v1.2.3