Files
boost_beast/test/beast/core/make_strand.cpp

50 lines
1.1 KiB
C++
Raw Permalink Normal View History

2019-02-18 13:38:40 -08:00
//
2019-02-21 07:00:31 -08:00
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
2019-02-18 13:38:40 -08:00
//
// 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
//
// Test that header file is self-contained.
2019-03-02 05:22:02 -08:00
#include <boost/beast/core/net::make_strand.hpp>
2019-02-18 13:38:40 -08:00
#include <boost/beast/_experimental/unit_test/suite.hpp>
#include <boost/asio/executor.hpp>
#include <boost/asio/io_context.hpp>
namespace boost {
namespace beast {
class make_strand_test : public beast::unit_test::suite
{
public:
void
testFunction()
{
net::io_context ioc;
2019-03-02 05:22:02 -08:00
net::make_strand(ioc);
net::make_strand(ioc.get_executor());
net::make_strand(net::make_strand(ioc));
2019-02-18 13:38:40 -08:00
net::any_io_executor ex(ioc.get_executor());
2019-03-02 05:22:02 -08:00
net::make_strand(ex);
2019-02-18 13:38:40 -08:00
// this *should-not* compile
2019-03-02 05:22:02 -08:00
//net::make_strand(ex.context());
2019-02-18 13:38:40 -08:00
}
void
run() override
{
testFunction();
pass();
}
};
2019-03-02 05:22:02 -08:00
BEAST_DEFINE_TESTSUITE(beast,core,net::make_strand);
2019-02-18 13:38:40 -08:00
} // beast
} // boost