From b840d96d3076bf4131e7fc7e7bc5e018df12a117 Mon Sep 17 00:00:00 2001 From: Kasper Laudrup Date: Tue, 30 Jan 2024 18:10:16 +0100 Subject: [PATCH] Fix test stream naming Move the test stream code to test_stream directory instead of a very generic utils directory since it now only contains code related to the test stream. The test stream is still more or less a copy of the same stream from Boost.Beast test code with a few additional headers as needed. Update the header guards to reflect that this code belongs here and change the end of namespace comments to be consistent with the rest of the code in this repository. --- test/test_stream/allocator.hpp | 11 +++++------ test/test_stream/config.hpp | 4 ++-- test/test_stream/empty_value.hpp | 13 +++++++------ test/test_stream/error.hpp | 11 +++++------ test/test_stream/fail_count.hpp | 10 +++++----- test/test_stream/flat_buffer.hpp | 10 +++++----- test/test_stream/impl/error.hpp | 10 +++++----- test/test_stream/impl/error.ipp | 10 +++++----- test/test_stream/impl/fail_count.ipp | 10 +++++----- test/test_stream/impl/flat_buffer.hpp | 10 +++++----- test/test_stream/impl/is_invocable.hpp | 10 +++++----- test/test_stream/impl/service_base.hpp | 10 +++++----- test/test_stream/impl/stream.hpp | 10 +++++----- test/test_stream/impl/stream.ipp | 10 +++++----- test/test_stream/role.hpp | 10 +++++----- test/test_stream/stream.hpp | 10 +++++----- test/unittest.hpp | 3 ++- 17 files changed, 81 insertions(+), 81 deletions(-) diff --git a/test/test_stream/allocator.hpp b/test/test_stream/allocator.hpp index f96db0f0..b7dd50b0 100644 --- a/test/test_stream/allocator.hpp +++ b/test/test_stream/allocator.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_DETAIL_ALLOCATOR_HPP -#define BOOST_BEAST_DETAIL_ALLOCATOR_HPP +#ifndef BOOST_WINTLS_TEST_STREAM_ALLOCATOR_HPP +#define BOOST_WINTLS_TEST_STREAM_ALLOCATOR_HPP #include @@ -22,9 +22,8 @@ namespace test { template using allocator_traits = std::allocator_traits; - -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #endif diff --git a/test/test_stream/config.hpp b/test/test_stream/config.hpp index faf65514..b0f9b1a8 100644 --- a/test/test_stream/config.hpp +++ b/test/test_stream/config.hpp @@ -1,5 +1,5 @@ -#ifndef WINTLS_TEST_UTILS_CONFIG_HPP -#define WINTLS_TEST_UTILS_CONFIG_HPP +#ifndef BOOST_WINTLS_TEST_STREAM_CONFIG_HPP +#define BOOST_WINTLS_TEST_STREAM_CONFIG_HPP #ifdef WINTLS_USE_STANDALONE_ASIO #include diff --git a/test/test_stream/empty_value.hpp b/test/test_stream/empty_value.hpp index f00abf36..b895c32a 100644 --- a/test/test_stream/empty_value.hpp +++ b/test/test_stream/empty_value.hpp @@ -5,14 +5,15 @@ Copyright 2018 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_CORE_EMPTY_VALUE_HPP -#define BOOST_CORE_EMPTY_VALUE_HPP +#ifndef BOOST_WINTLS_TEST_STREAM_EMPTY_VALUE_HPP +#define BOOST_WINTLS_TEST_STREAM_EMPTY_VALUE_HPP #include namespace boost { namespace wintls { namespace test { + template struct use_empty_value_base { enum { @@ -75,12 +76,12 @@ class empty_value } }; -} /* empty_ */ +} // namespace empty_ using empty_::empty_value; -} /* test */ -} /* wintls */ -} /* boost */ +} // namespace test +} // namespace wintls +} // namespace boost #endif diff --git a/test/test_stream/error.hpp b/test/test_stream/error.hpp index 99b11520..4d8aad51 100644 --- a/test/test_stream/error.hpp +++ b/test/test_stream/error.hpp @@ -7,9 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_TEST_ERROR_HPP -#define BOOST_BEAST_TEST_ERROR_HPP - +#ifndef BOOST_WINTLS_TEST_STREAM_ERROR_HPP +#define BOOST_WINTLS_TEST_STREAM_ERROR_HPP namespace boost { namespace wintls { @@ -26,9 +25,9 @@ enum class error test_failure = 1 }; -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #include "impl/error.ipp" #include "impl/error.hpp" diff --git a/test/test_stream/fail_count.hpp b/test/test_stream/fail_count.hpp index 7c739cbc..95ff1247 100644 --- a/test/test_stream/fail_count.hpp +++ b/test/test_stream/fail_count.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_TEST_FAIL_COUNT_HPP -#define BOOST_BEAST_TEST_FAIL_COUNT_HPP +#ifndef BOOST_WINTLS_TEST_STREAM_FAIL_COUNT_HPP +#define BOOST_WINTLS_TEST_STREAM_FAIL_COUNT_HPP #include "config.hpp" #include "error.hpp" @@ -59,9 +59,9 @@ class fail_count fail(error_code& ec); }; -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #include "impl/fail_count.ipp" diff --git a/test/test_stream/flat_buffer.hpp b/test/test_stream/flat_buffer.hpp index 331db58d..42a64d76 100644 --- a/test/test_stream/flat_buffer.hpp +++ b/test/test_stream/flat_buffer.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_FLAT_BUFFER_HPP -#define BOOST_BEAST_FLAT_BUFFER_HPP +#ifndef BOOST_WINTLS_TEST_STREAM_FLAT_BUFFER_HPP +#define BOOST_WINTLS_TEST_STREAM_FLAT_BUFFER_HPP #include "empty_value.hpp" #include "allocator.hpp" @@ -523,9 +523,9 @@ class basic_flat_buffer using flat_buffer = basic_flat_buffer>; -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #include "impl/flat_buffer.hpp" diff --git a/test/test_stream/impl/error.hpp b/test/test_stream/impl/error.hpp index 61a5da65..23e5da27 100644 --- a/test/test_stream/impl/error.hpp +++ b/test/test_stream/impl/error.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_TEST_IMPL_ERROR_HPP -#define BOOST_BEAST_TEST_IMPL_ERROR_HPP +#ifndef BOOST_WINTLS_TEST_STREAM_IMPL_ERROR_HPP +#define BOOST_WINTLS_TEST_STREAM_IMPL_ERROR_HPP #include @@ -42,8 +42,8 @@ inline error_code make_error_code(error e) noexcept; -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #endif diff --git a/test/test_stream/impl/error.ipp b/test/test_stream/impl/error.ipp index e74b519e..3f5be0a6 100644 --- a/test/test_stream/impl/error.ipp +++ b/test/test_stream/impl/error.ipp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_TEST_IMPL_ERROR_IPP -#define BOOST_BEAST_TEST_IMPL_ERROR_IPP +#ifndef BOOST_WINTLS_TEST_STREAM_IMPL_ERROR_IPP +#define BOOST_WINTLS_TEST_STREAM_IMPL_ERROR_IPP #include "error.hpp" @@ -55,8 +55,8 @@ make_error_code(boost::wintls::test::error e) noexcept std::underlying_type::type>(e), cat}; } -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #endif diff --git a/test/test_stream/impl/fail_count.ipp b/test/test_stream/impl/fail_count.ipp index 37ecd1bf..221f4079 100644 --- a/test/test_stream/impl/fail_count.ipp +++ b/test/test_stream/impl/fail_count.ipp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_TEST_IMPL_FAIL_COUNT_IPP -#define BOOST_BEAST_TEST_IMPL_FAIL_COUNT_IPP +#ifndef BOOST_WINTLS_TEST_STREAM_IMPL_FAIL_COUNT_IPP +#define BOOST_WINTLS_TEST_STREAM_IMPL_FAIL_COUNT_IPP namespace boost { namespace wintls { @@ -48,8 +48,8 @@ fail(error_code& ec) return false; } -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #endif diff --git a/test/test_stream/impl/flat_buffer.hpp b/test/test_stream/impl/flat_buffer.hpp index 7e9f9ffe..f4a8c5c1 100644 --- a/test/test_stream/impl/flat_buffer.hpp +++ b/test/test_stream/impl/flat_buffer.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_IMPL_FLAT_BUFFER_HPP -#define BOOST_BEAST_IMPL_FLAT_BUFFER_HPP +#ifndef BOOST_WINTLS_TEST_STREAM_IMPL_FLAT_BUFFER_HPP +#define BOOST_WINTLS_TEST_STREAM_IMPL_FLAT_BUFFER_HPP #include #include @@ -525,8 +525,8 @@ alloc(std::size_t n) return alloc_traits::allocate(this->get(), n); } -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #endif diff --git a/test/test_stream/impl/is_invocable.hpp b/test/test_stream/impl/is_invocable.hpp index e20545f0..dcafb68d 100644 --- a/test/test_stream/impl/is_invocable.hpp +++ b/test/test_stream/impl/is_invocable.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_DETAIL_IS_INVOCABLE_HPP -#define BOOST_BEAST_DETAIL_IS_INVOCABLE_HPP +#ifndef BOOST_WINTLS_TEST_STREAM_IMPL_IS_INVOCABLE_HPP +#define BOOST_WINTLS_TEST_STREAM_IMPL_IS_INVOCABLE_HPP #include #include @@ -51,8 +51,8 @@ struct is_invocable }; /** @} */ -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #endif diff --git a/test/test_stream/impl/service_base.hpp b/test/test_stream/impl/service_base.hpp index a25b7cbf..4a9791c8 100644 --- a/test/test_stream/impl/service_base.hpp +++ b/test/test_stream/impl/service_base.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_DETAIL_SERVICE_BASE_HPP -#define BOOST_BEAST_DETAIL_SERVICE_BASE_HPP +#ifndef BOOST_WINTLS_TEST_STREAM_IMPL_SERVICE_BASE_HPP +#define BOOST_WINTLS_TEST_STREAM_IMPL_SERVICE_BASE_HPP namespace boost { namespace wintls { @@ -29,8 +29,8 @@ struct service_base : net::execution_context::service template net::execution_context::id const service_base::id; -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #endif diff --git a/test/test_stream/impl/stream.hpp b/test/test_stream/impl/stream.hpp index 3d0a06e3..11f41734 100644 --- a/test/test_stream/impl/stream.hpp +++ b/test/test_stream/impl/stream.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_IMPL_STREAM_HPP -#define BOOST_WINTLS_TEST_IMPL_STREAM_HPP +#ifndef BOOST_WINTLS_TEST_STREAM_IMPL_STREAM_HPP +#define BOOST_WINTLS_TEST_STREAM_IMPL_STREAM_HPP #include "service_base.hpp" #include "is_invocable.hpp" @@ -448,8 +448,8 @@ connect(stream& to, Arg1&& arg1, ArgN&&... argn) return from; } -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #endif diff --git a/test/test_stream/impl/stream.ipp b/test/test_stream/impl/stream.ipp index 7b366123..12b6e401 100644 --- a/test/test_stream/impl/stream.ipp +++ b/test/test_stream/impl/stream.ipp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_TEST_IMPL_STREAM_IPP -#define BOOST_BEAST_TEST_IMPL_STREAM_IPP +#ifndef BOOST_WINTLS_TEST_STREAM_IMPL_STREAM_IPP +#define BOOST_WINTLS_TEST_STREAM_IMPL_STREAM_IPP #include #include @@ -366,8 +366,8 @@ connect(stream& s1, stream& s2) s1.connect(s2); } -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #endif diff --git a/test/test_stream/role.hpp b/test/test_stream/role.hpp index a986b62e..e68bf8f6 100644 --- a/test/test_stream/role.hpp +++ b/test/test_stream/role.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_ROLE_HPP -#define BOOST_BEAST_ROLE_HPP +#ifndef BOOST_WINTLS_TEST_STREAM_ROLE_HPP +#define BOOST_WINTLS_TEST_STREAM_ROLE_HPP namespace boost { namespace wintls { @@ -43,8 +43,8 @@ enum class role_type server }; -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #endif diff --git a/test/test_stream/stream.hpp b/test/test_stream/stream.hpp index ca81b037..4f0e99a2 100644 --- a/test/test_stream/stream.hpp +++ b/test/test_stream/stream.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_BEAST_TEST_STREAM_HPP -#define BOOST_BEAST_TEST_STREAM_HPP +#ifndef BOOST_WINTLS_TEST_STREAM_STREAM_HPP +#define BOOST_WINTLS_TEST_STREAM_STREAM_HPP #ifdef WINTLS_USE_STANDALONE_ASIO #include @@ -624,9 +624,9 @@ template stream connect(stream& to, Arg1&& arg1, ArgN&&... argn); -} // test -} // wintls -} // boost +} // namespace test +} // namespace wintls +} // namespace boost #include "impl/stream.hpp" #include "impl/stream.ipp" diff --git a/test/unittest.hpp b/test/unittest.hpp index 3dd26b93..16c3038d 100644 --- a/test/unittest.hpp +++ b/test/unittest.hpp @@ -9,7 +9,8 @@ #include -#include "utils/stream.hpp" +#include "test_stream/stream.hpp" + #ifdef WINTLS_USE_STANDALONE_ASIO #include #else