Skip to content

Commit

Permalink
Fix test stream naming
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
laudrup committed Jan 30, 2024
1 parent 46eae4e commit b840d96
Show file tree
Hide file tree
Showing 17 changed files with 81 additions and 81 deletions.
11 changes: 5 additions & 6 deletions test/test_stream/allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <memory>

Expand All @@ -22,9 +22,8 @@ namespace test {
template<class Alloc>
using allocator_traits = std::allocator_traits<Alloc>;


} // test
} // wintls
} // boost
} // namespace test
} // namespace wintls
} // namespace boost

#endif
4 changes: 2 additions & 2 deletions test/test_stream/config.hpp
Original file line number Diff line number Diff line change
@@ -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 <system_error>
Expand Down
13 changes: 7 additions & 6 deletions test/test_stream/empty_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <utility>

namespace boost {
namespace wintls {
namespace test {

template<class T>
struct use_empty_value_base {
enum {
Expand Down Expand Up @@ -75,12 +76,12 @@ class empty_value<T, N, true>
}
};

} /* empty_ */
} // namespace empty_

using empty_::empty_value;

} /* test */
} /* wintls */
} /* boost */
} // namespace test
} // namespace wintls
} // namespace boost

#endif
11 changes: 5 additions & 6 deletions test/test_stream/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions test/test_stream/fail_count.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"

Expand Down
10 changes: 5 additions & 5 deletions test/test_stream/flat_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -523,9 +523,9 @@ class basic_flat_buffer
using flat_buffer =
basic_flat_buffer<std::allocator<char>>;

} // test
} // wintls
} // boost
} // namespace test
} // namespace wintls
} // namespace boost

#include "impl/flat_buffer.hpp"

Expand Down
10 changes: 5 additions & 5 deletions test/test_stream/impl/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <type_traits>

Expand Down Expand Up @@ -42,8 +42,8 @@ inline
error_code
make_error_code(error e) noexcept;

} // test
} // wintls
} // boost
} // namespace test
} // namespace wintls
} // namespace boost

#endif
10 changes: 5 additions & 5 deletions test/test_stream/impl/error.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -55,8 +55,8 @@ make_error_code(boost::wintls::test::error e) noexcept
std::underlying_type<error>::type>(e), cat};
}

} // test
} // wintls
} // boost
} // namespace test
} // namespace wintls
} // namespace boost

#endif
10 changes: 5 additions & 5 deletions test/test_stream/impl/fail_count.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -48,8 +48,8 @@ fail(error_code& ec)
return false;
}

} // test
} // wintls
} // boost
} // namespace test
} // namespace wintls
} // namespace boost

#endif
10 changes: 5 additions & 5 deletions test/test_stream/impl/flat_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <memory>
#include <stdexcept>
Expand Down Expand Up @@ -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
10 changes: 5 additions & 5 deletions test/test_stream/impl/is_invocable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <type_traits>
#include <utility>
Expand Down Expand Up @@ -51,8 +51,8 @@ struct is_invocable<C, R(A...)>
};
/** @} */

} // test
} // wintls
} // boost
} // namespace test
} // namespace wintls
} // namespace boost

#endif
10 changes: 5 additions & 5 deletions test/test_stream/impl/service_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -29,8 +29,8 @@ struct service_base : net::execution_context::service
template<class T>
net::execution_context::id const service_base<T>::id;

} // test
} // wintls
} // boost
} // namespace test
} // namespace wintls
} // namespace boost

#endif
10 changes: 5 additions & 5 deletions test/test_stream/impl/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -448,8 +448,8 @@ connect(stream& to, Arg1&& arg1, ArgN&&... argn)
return from;
}

} // test
} // wintls
} // boost
} // namespace test
} // namespace wintls
} // namespace boost

#endif
10 changes: 5 additions & 5 deletions test/test_stream/impl/stream.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <memory>
#include <stdexcept>
Expand Down Expand Up @@ -366,8 +366,8 @@ connect(stream& s1, stream& s2)
s1.connect(s2);
}

} // test
} // wintls
} // boost
} // namespace test
} // namespace wintls
} // namespace boost

#endif
10 changes: 5 additions & 5 deletions test/test_stream/role.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -43,8 +43,8 @@ enum class role_type
server
};

} // test
} // wintls
} // boost
} // namespace test
} // namespace wintls
} // namespace boost

#endif
10 changes: 5 additions & 5 deletions test/test_stream/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <system_error>
Expand Down Expand Up @@ -624,9 +624,9 @@ template<class Arg1, class... ArgN>
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"
Expand Down
3 changes: 2 additions & 1 deletion test/unittest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

#include <boost/wintls/detail/config.hpp>

#include "utils/stream.hpp"
#include "test_stream/stream.hpp"

#ifdef WINTLS_USE_STANDALONE_ASIO
#include <asio/ssl.hpp>
#else
Expand Down

0 comments on commit b840d96

Please sign in to comment.