forked from boostorg/beast
SSL teardowns are in an associated namespace
This commit is contained in:
1 parent
7f5a405e61
commit
e4342b51b2
6 files changed
+77
-4
No files matched your search
@@ -32,6 +32,7 @@ add_executable (tests-beast-websocket
|
||||
read2.cpp
|
||||
read3.cpp
|
||||
rfc6455.cpp
|
||||
ssl.cpp
|
||||
stream.cpp
|
||||
stream_base.cpp
|
||||
stream_explicit.cpp
|
||||
|
||||
@@ -22,6 +22,7 @@ local SOURCES =
|
||||
read2.cpp
|
||||
read3.cpp
|
||||
rfc6455.cpp
|
||||
ssl.cpp
|
||||
stream.cpp
|
||||
stream_base.cpp
|
||||
stream_explicit.cpp
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// Official repository: https://github.com/boostorg/beast
|
||||
//
|
||||
|
||||
// VFALCO This causes a compilation error
|
||||
#include <boost/beast/websocket/stream.hpp>
|
||||
|
||||
// Test that header file is self-contained.
|
||||
#include <boost/beast/websocket/ssl.hpp>
|
||||
|
||||
#include <boost/beast/websocket/stream.hpp>
|
||||
#include <boost/beast/_experimental/unit_test/suite.hpp>
|
||||
#include <boost/asio/executor.hpp>
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <boost/asio/ssl.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace beast {
|
||||
namespace websocket {
|
||||
|
||||
class ssl_test : public unit_test::suite
|
||||
{
|
||||
public:
|
||||
template<class Socket>
|
||||
void
|
||||
testTeardown()
|
||||
{
|
||||
net::io_context ioc;
|
||||
net::ssl::context ctx(net::ssl::context::sslv23);
|
||||
Socket ss(ioc, ctx);
|
||||
|
||||
struct handler
|
||||
{
|
||||
void
|
||||
operator()(error_code)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
websocket::stream<Socket> ws(ioc, ctx);
|
||||
|
||||
BEAST_EXPECT(static_cast<
|
||||
void(websocket::stream<Socket>::*)(
|
||||
close_reason const&)>(
|
||||
&websocket::stream<Socket>::close));
|
||||
|
||||
BEAST_EXPECT(static_cast<
|
||||
void(websocket::stream<Socket>::*)(
|
||||
close_reason const&, error_code&)>(
|
||||
&websocket::stream<Socket>::close));
|
||||
}
|
||||
|
||||
void
|
||||
run() override
|
||||
{
|
||||
testTeardown<
|
||||
boost::asio::ssl::stream<
|
||||
boost::asio::basic_stream_socket<
|
||||
boost::asio::ip::tcp,
|
||||
boost::asio::executor>>>();
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
BEAST_DEFINE_TESTSUITE(beast,websocket,ssl);
|
||||
|
||||
} // websocket
|
||||
} // beast
|
||||
} // boost
|
||||
Reference in new issue
Block a user