// // 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 // #ifndef BOOST_BEAST_STREAM_TESTS_HPP #define BOOST_BEAST_STREAM_TESTS_HPP #include #include #include #include #include #include namespace boost { namespace beast { template void test_sync_read_stream() { BOOST_ASSERT(is_sync_read_stream::value); BEAST_EXPECT(static_cast< std::size_t(SyncReadStream::*)(net::mutable_buffer const&)>( &SyncReadStream::template read_some)); BEAST_EXPECT(static_cast< std::size_t(SyncReadStream::*)(net::mutable_buffer const&, error_code&)>( &SyncReadStream::template read_some)); } template void test_sync_write_stream() { BOOST_ASSERT(is_sync_write_stream::value); BEAST_EXPECT(static_cast< std::size_t(SyncWriteStream::*)(net::const_buffer const&)>( &SyncWriteStream::template write_some)); BEAST_EXPECT(static_cast< std::size_t(SyncWriteStream::*)(net::const_buffer const&, error_code&)>( &SyncWriteStream::template write_some)); } template void test_sync_stream() { test_sync_read_stream(); test_sync_write_stream(); } template void test_async_read_stream() { struct handler { void operator()(error_code, std::size_t) { } }; BOOST_ASSERT(is_async_read_stream::value); BEAST_EXPECT(&AsyncReadStream::get_executor); // VFALCO These stopped working because of enable_if as the last parameter //BEAST_EXPECT((&AsyncReadStream::template async_read_some)); //BEAST_EXPECT((&AsyncReadStream::template async_read_some>)); //BEAST_EXPECT((&AsyncReadStream::template async_read_some)); } template void test_async_write_stream() { struct handler { void operator()(error_code, std::size_t) { } }; BOOST_ASSERT(is_async_write_stream::value); BEAST_EXPECT(&AsyncWriteStream::get_executor); // VFALCO These stopped working because of enable_if as the last parameter //BEAST_EXPECT((&AsyncWriteStream::template async_write_some)); //BEAST_EXPECT((&AsyncWriteStream::template async_write_some>)); //BEAST_EXPECT((&AsyncWriteStream::template async_write_some)); } template void test_async_stream() { test_async_read_stream(); test_async_write_stream(); } } // beast } // boost #endif