From 91663758dac8e1dd1cd8372af0d155ee9789c7be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 20 Jan 2026 01:02:35 +0100 Subject: [PATCH] Add testcase for node allocator testing list/vector x v2/v1 x int/overaligned_int --- test/node_allocator_test.cpp | 72 ++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 test/node_allocator_test.cpp diff --git a/test/node_allocator_test.cpp b/test/node_allocator_test.cpp new file mode 100644 index 0000000..832cbc0 --- /dev/null +++ b/test/node_allocator_test.cpp @@ -0,0 +1,72 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2025-2026. 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/container for documentation. +// +////////////////////////////////////////////////////////////////////////////// +#include +#include +#include +#include "movable_int.hpp" +#include "list_test.hpp" +#include "vector_test.hpp" + +using namespace boost::container; + +typedef test::overaligned_copyable_int oint_t; + +//Alias adaptive pools that allocates ints +typedef node_allocator node_allocator_t; +typedef node_allocator adapt_onode_allocator_t; + +typedef node_allocator node_allocator_v1_t; +typedef node_allocator adapt_onode_allocator_v1_t; + +namespace boost { +namespace container { + +//Explicit instantiations to catch compilation errors +template class node_allocator; +template class node_allocator; + +}} //boost::container + +//Alias list types +typedef boost::container::list MyList; +typedef boost::container::list MyOList; + +typedef boost::container::list MyListV1; +typedef boost::container::list MyOListV1; + +//Alias vector types +typedef boost::container::vector MyVector; +typedef boost::container::vector MyOVector; + +typedef boost::container::vector MyVectorV1; +typedef boost::container::vector MyOVectorV1; + +int main () +{ + if(test::list_test()) + return 1; + if(test::list_test()) + return 1; + if(test::list_test()) + return 1; + if(test::list_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; + + return 0; +}