Boost logo

Boost Users :

Subject: Re: [Boost-users] Testing and faking ASIO I/O objects
From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2018-08-30 23:03:27


On Wed, Aug 29, 2018 at 2:03 PM Cristian Morales Vega via Boost-users
<boost-users_at_[hidden]> wrote:
> There is any good set of ASIO I/O object fakes available?

Beast experimental interfaces provide testing facilities which meet
the requirements of the following Asio concepts:

    SyncReadStream
    SyncWriteStream
    AsyncReadStream
    AsyncWriteStream

This is provided by the boost::beast::test::stream class, which works
with the test::fail_counter class to allow for automated failure
testing.

Docs:
<https://www.boost.org/doc/libs/1_68_0/libs/beast/doc/html/beast/ref/boost__beast__test__stream.html>
<https://www.boost.org/doc/libs/1_68_0/libs/beast/doc/html/beast/ref/boost__beast__test__fail_count.html>
<https://www.boost.org/doc/libs/1_68_0/libs/beast/doc/html/beast/ref/boost__beast__test__connect.html>
<https://www.boost.org/doc/libs/1_68_0/libs/beast/doc/html/beast/ref/boost__beast__test__error.html>

Includes:
<https://github.com/boostorg/beast/tree/develop/include/boost/beast/experimental/test>

The Beast unit tests make heavy use of the test::stream class. Example:
<https://github.com/boostorg/beast/blob/1da229a27c6f0539d422bcedbcf47cfe2517164a/test/beast/http/read.cpp#L258>

If you have questions feel free to open an issue.

Regards


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net