Boost logo

Boost Users :

Subject: Re: [Boost-users] Testing and faking ASIO I/O objects
From: Cristian Morales Vega (cristian_at_[hidden])
Date: 2018-08-31 20:43:50


On 31 August 2018 at 02:03, Vinnie Falco via Boost-users
<boost-users_at_[hidden]> wrote:
> 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.

This is really useful!

I guess the main things people will miss are:
- Fake Timer: it must be extreme common, to implement network timeouts
- Fake Resolver/Acceptor/Connect to Protocol::endpoint

But it also gives an example of how to implement fakes, so people
should be able to do so for those extra things.

I see you don't allocate read_op using the handler associated
allocator. Is this on purpose? I don't see any problem with this but I
also fail to see other, real, problems when looking at ASIO code and
was afraid of doing it myself.


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