]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/beast/test/beast/websocket/stream.cpp
2 // Copyright (w) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/beast
10 // Test that header file is self-contained.
11 #include <boost/beast/websocket/stream.hpp>
19 class stream_test
: public websocket_test_suite
25 stream
<test::stream
> ws
{ioc_
};
26 ws
.auto_fragment(true);
27 ws
.write_buffer_size(2048);
29 ws
.read_message_max(1 * 1024 * 1024);
32 ws
.write_buffer_size(7);
35 catch(std::exception
const&)
41 [&](permessage_deflate
const& pmd
)
43 stream
<test::stream
> ws
{ioc_
};
47 fail("", __FILE__
, __LINE__
);
49 catch(std::exception
const&)
56 permessage_deflate pmd
;
57 pmd
.server_max_window_bits
= 16;
62 permessage_deflate pmd
;
63 pmd
.server_max_window_bits
= 8;
68 permessage_deflate pmd
;
69 pmd
.client_max_window_bits
= 16;
74 permessage_deflate pmd
;
75 pmd
.client_max_window_bits
= 8;
80 permessage_deflate pmd
;
86 permessage_deflate pmd
;
92 permessage_deflate pmd
;
98 permessage_deflate pmd
;
107 BOOST_STATIC_ASSERT(std::is_constructible
<
108 stream
<test::stream
>, boost::asio::io_context
&>::value
);
110 BOOST_STATIC_ASSERT(std::is_move_constructible
<
111 stream
<test::stream
>>::value
);
113 BOOST_STATIC_ASSERT(std::is_move_assignable
<
114 stream
<test::stream
>>::value
);
116 BOOST_STATIC_ASSERT(std::is_constructible
<
117 stream
<test::stream
&>, test::stream
&>::value
);
119 BOOST_STATIC_ASSERT(std::is_move_constructible
<
120 stream
<test::stream
&>>::value
);
122 BOOST_STATIC_ASSERT(! std::is_move_assignable
<
123 stream
<test::stream
&>>::value
);
125 log
<< "sizeof(websocket::stream) == " <<
126 sizeof(websocket::stream
<test::stream
&>) << std::endl
;
132 BEAST_DEFINE_TESTSUITE(beast
,websocket
,stream
);