From: =?utf-8?q?Timo_R=C3=B6hling?= Date: Wed, 2 Dec 2020 18:06:42 +0100 Subject: Fix includes so unit tests can be run in autopkgtest Forwarded: not-needed --- test/CMakeLists.txt | 4 ---- test/aligned_allocator.cpp | 8 ++++---- test/allocator_traits.cpp | 4 ++-- test/benchmark.hpp | 2 +- test/default_allocator.cpp | 8 ++++---- test/detail/align.cpp | 2 +- test/detail/debug_helpers.cpp | 4 ++-- test/detail/free_list.cpp | 8 ++++---- test/detail/free_list_array.cpp | 8 ++++---- test/detail/ilog2.cpp | 2 +- test/detail/memory_stack.cpp | 10 +++++----- test/fallback_allocator.cpp | 4 ++-- test/iteration_allocator.cpp | 4 ++-- test/joint_allocator.cpp | 4 ++-- test/memory_arena.cpp | 4 ++-- test/memory_pool.cpp | 4 ++-- test/memory_pool_collection.cpp | 4 ++-- test/memory_resource_adapter.cpp | 6 +++--- test/memory_stack.cpp | 4 ++-- test/profiling.cpp | 10 +++++----- test/segregator.cpp | 2 +- test/smart_ptr.cpp | 6 +++--- 22 files changed, 54 insertions(+), 58 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f269cfb..ad3351c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -5,8 +5,6 @@ add_executable(foonathan_memory_profiling benchmark.hpp profiling.cpp) target_link_libraries(foonathan_memory_profiling foonathan_memory) -target_include_directories(foonathan_memory_profiling PRIVATE - ${FOONATHAN_MEMORY_SOURCE_DIR}/include/foonathan/memory) find_package(doctest REQUIRED) @@ -35,8 +33,6 @@ set(tests add_executable(foonathan_memory_test ${tests}) target_link_libraries(foonathan_memory_test PRIVATE foonathan_memory doctest::doctest) -target_include_directories(foonathan_memory_test PRIVATE - ${FOONATHAN_MEMORY_SOURCE_DIR}/include/foonathan/memory) add_test(NAME test COMMAND foonathan_memory_test) diff --git a/test/aligned_allocator.cpp b/test/aligned_allocator.cpp index 05ee1f4..5b2fe6d 100644 --- a/test/aligned_allocator.cpp +++ b/test/aligned_allocator.cpp @@ -1,13 +1,13 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "aligned_allocator.hpp" +#include #include -#include "detail/align.hpp" -#include "allocator_storage.hpp" -#include "memory_stack.hpp" +#include +#include +#include using namespace foonathan::memory; diff --git a/test/allocator_traits.cpp b/test/allocator_traits.cpp index 4b253da..258ec40 100644 --- a/test/allocator_traits.cpp +++ b/test/allocator_traits.cpp @@ -1,13 +1,13 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "allocator_traits.hpp" +#include #include #include -#include "heap_allocator.hpp" +#include using namespace foonathan::memory; diff --git a/test/benchmark.hpp b/test/benchmark.hpp index 969e2d7..d4df5f9 100644 --- a/test/benchmark.hpp +++ b/test/benchmark.hpp @@ -11,7 +11,7 @@ #include #include -#include "allocator_traits.hpp" +#include "foonathan/memory/allocator_traits.hpp" using unit = std::chrono::nanoseconds; diff --git a/test/default_allocator.cpp b/test/default_allocator.cpp index d31e540..727ce07 100644 --- a/test/default_allocator.cpp +++ b/test/default_allocator.cpp @@ -1,15 +1,15 @@ -// Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib // tests all possible default allocator classes -#include "default_allocator.hpp" +#include #include #include -#include "detail/align.hpp" -#include "memory_arena.hpp" +#include +#include using namespace foonathan::memory; diff --git a/test/detail/align.cpp b/test/detail/align.cpp index c60dfcc..d51c270 100644 --- a/test/detail/align.cpp +++ b/test/detail/align.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "detail/align.hpp" +#include #include diff --git a/test/detail/debug_helpers.cpp b/test/detail/debug_helpers.cpp index a1d7b3c..ed6a597 100644 --- a/test/detail/debug_helpers.cpp +++ b/test/detail/debug_helpers.cpp @@ -1,11 +1,11 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "detail/debug_helpers.hpp" +#include #include -#include "debugging.hpp" +#include using namespace foonathan::memory; using namespace detail; diff --git a/test/detail/free_list.cpp b/test/detail/free_list.cpp index 214b536..69c2942 100644 --- a/test/detail/free_list.cpp +++ b/test/detail/free_list.cpp @@ -1,16 +1,16 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "detail/free_list.hpp" -#include "detail/small_free_list.hpp" +#include +#include #include #include #include #include -#include "detail/align.hpp" -#include "static_allocator.hpp" +#include +#include using namespace foonathan::memory; using namespace detail; diff --git a/test/detail/free_list_array.cpp b/test/detail/free_list_array.cpp index b404c82..9dd4cb3 100644 --- a/test/detail/free_list_array.cpp +++ b/test/detail/free_list_array.cpp @@ -1,13 +1,13 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "detail/free_list_array.hpp" +#include #include -#include "detail/free_list.hpp" -#include "detail/small_free_list.hpp" -#include "static_allocator.hpp" +#include +#include +#include using namespace foonathan::memory; using namespace detail; diff --git a/test/detail/ilog2.cpp b/test/detail/ilog2.cpp index 83db8ba..2747a36 100644 --- a/test/detail/ilog2.cpp +++ b/test/detail/ilog2.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "detail/ilog2.hpp" +#include #include diff --git a/test/detail/memory_stack.cpp b/test/detail/memory_stack.cpp index 5d322f5..f3cccac 100644 --- a/test/detail/memory_stack.cpp +++ b/test/detail/memory_stack.cpp @@ -1,14 +1,14 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "detail/memory_stack.hpp" +#include #include -#include "detail/align.hpp" -#include "detail/debug_helpers.hpp" -#include "detail/utility.hpp" -#include "static_allocator.hpp" +#include +#include +#include +#include using namespace foonathan::memory; using namespace detail; diff --git a/test/fallback_allocator.cpp b/test/fallback_allocator.cpp index 878648b..6e2d07f 100644 --- a/test/fallback_allocator.cpp +++ b/test/fallback_allocator.cpp @@ -1,11 +1,11 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "fallback_allocator.hpp" +#include #include -#include "allocator_storage.hpp" +#include #include "test_allocator.hpp" using namespace foonathan::memory; diff --git a/test/iteration_allocator.cpp b/test/iteration_allocator.cpp index 50f79aa..fda5e10 100644 --- a/test/iteration_allocator.cpp +++ b/test/iteration_allocator.cpp @@ -1,11 +1,11 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "iteration_allocator.hpp" +#include #include -#include "allocator_storage.hpp" +#include #include "test_allocator.hpp" using namespace foonathan::memory; diff --git a/test/joint_allocator.cpp b/test/joint_allocator.cpp index 1e33126..0149bfe 100644 --- a/test/joint_allocator.cpp +++ b/test/joint_allocator.cpp @@ -1,11 +1,11 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "joint_allocator.hpp" +#include #include -#include "container.hpp" +#include #include "test_allocator.hpp" using namespace foonathan::memory; diff --git a/test/memory_arena.cpp b/test/memory_arena.cpp index 41b4b00..fe8647f 100644 --- a/test/memory_arena.cpp +++ b/test/memory_arena.cpp @@ -1,11 +1,11 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "memory_arena.hpp" +#include #include -#include "static_allocator.hpp" +#include using namespace foonathan::memory; using namespace detail; diff --git a/test/memory_pool.cpp b/test/memory_pool.cpp index 6c980d3..832ddff 100644 --- a/test/memory_pool.cpp +++ b/test/memory_pool.cpp @@ -1,14 +1,14 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "memory_pool.hpp" +#include #include #include #include #include -#include "allocator_storage.hpp" +#include #include "test_allocator.hpp" using namespace foonathan::memory; diff --git a/test/memory_pool_collection.cpp b/test/memory_pool_collection.cpp index ad6e456..f7ed5cb 100644 --- a/test/memory_pool_collection.cpp +++ b/test/memory_pool_collection.cpp @@ -1,14 +1,14 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "memory_pool_collection.hpp" +#include #include #include #include #include -#include "allocator_storage.hpp" +#include #include "test_allocator.hpp" using namespace foonathan::memory; diff --git a/test/memory_resource_adapter.cpp b/test/memory_resource_adapter.cpp index 5a982f1..ad11ddf 100644 --- a/test/memory_resource_adapter.cpp +++ b/test/memory_resource_adapter.cpp @@ -1,13 +1,13 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "memory_resource_adapter.hpp" +#include #include #include -#include "allocator_storage.hpp" -#include "std_allocator.hpp" +#include +#include using namespace foonathan::memory; diff --git a/test/memory_stack.cpp b/test/memory_stack.cpp index 35f5534..3368e21 100644 --- a/test/memory_stack.cpp +++ b/test/memory_stack.cpp @@ -1,11 +1,11 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "memory_stack.hpp" +#include #include -#include "allocator_storage.hpp" +#include #include "test_allocator.hpp" using namespace foonathan::memory; diff --git a/test/profiling.cpp b/test/profiling.cpp index 823d58d..89e3d78 100644 --- a/test/profiling.cpp +++ b/test/profiling.cpp @@ -7,11 +7,11 @@ #include #include -#include "allocator_storage.hpp" -#include "heap_allocator.hpp" -#include "new_allocator.hpp" -#include "memory_pool.hpp" -#include "memory_stack.hpp" +#include +#include +#include +#include +#include using namespace foonathan::memory; diff --git a/test/segregator.cpp b/test/segregator.cpp index 1d9fffe..c8ea5cd 100644 --- a/test/segregator.cpp +++ b/test/segregator.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "segregator.hpp" +#include #include diff --git a/test/smart_ptr.cpp b/test/smart_ptr.cpp index 7c273b3..eb03e1e 100644 --- a/test/smart_ptr.cpp +++ b/test/smart_ptr.cpp @@ -1,12 +1,12 @@ // Copyright (C) 2015-2025 Jonathan Müller and foonathan/memory contributors // SPDX-License-Identifier: Zlib -#include "smart_ptr.hpp" +#include #include -#include "container.hpp" -#include "memory_pool.hpp" +#include +#include using namespace foonathan::memory;