From 60bfa5b935370bb1cc4a14bd47c6cf90a70343eb Mon Sep 17 00:00:00 2001 From: Hannes Rantzsch Date: Thu, 27 Jun 2019 11:01:35 +0200 Subject: Boost 1.70 compatibility in asio_stream unit test --- src/tests/unit_asio_stream.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/tests/unit_asio_stream.cpp') diff --git a/src/tests/unit_asio_stream.cpp b/src/tests/unit_asio_stream.cpp index 5fd67cbd4..c32cfb9d8 100644 --- a/src/tests/unit_asio_stream.cpp +++ b/src/tests/unit_asio_stream.cpp @@ -13,11 +13,19 @@ #include #include -// first boost version to include boost/beast/experimental/test/stream.hpp +// The boost::beast::test::stream we use is available starting from boost +// version 1.68, so we cannot run these tests with a smaller version. #include #if BOOST_VERSION >= 106800 +// boost::beast::test::stream's include path has been changed in boost version +// 1.70. +#if BOOST_VERSION < 107000 #include +#else +#include +#endif + #include namespace Botan_Tests { @@ -87,7 +95,15 @@ class ThrowingMockChannel : public MockChannel } }; -using TestStream = boost::beast::test::stream; +// Unfortunately, boost::beast::test::stream keeps lowest_layer_type private and +// only friends boost::asio::ssl::stream. We need to make our own. +class TestStream : public boost::beast::test::stream + { + public: + using boost::beast::test::stream::stream; + using lowest_layer_type = boost::beast::test::stream; + }; + using FailCount = boost::beast::test::fail_count; class AsioStream : public Botan::TLS::Stream -- cgit v1.2.3