| 28 | { |
| 29 | public: |
| 30 | void |
| 31 | testMembers() |
| 32 | { |
| 33 | net::io_context ioc; |
| 34 | |
| 35 | test_sync_stream<flat_stream<test::stream>>(); |
| 36 | |
| 37 | test_async_stream<flat_stream<test::stream>>(); |
| 38 | |
| 39 | // read/write |
| 40 | |
| 41 | { |
| 42 | error_code ec; |
| 43 | flat_stream<test::stream> s(ioc); |
| 44 | { |
| 45 | // VFALCO Hack to make test stream code = eof |
| 46 | test::stream ts(ioc); |
| 47 | s.next_layer().connect(ts); |
| 48 | } |
| 49 | char buf[1]; |
| 50 | net::mutable_buffer m1 = net::buffer(buf); |
| 51 | |
| 52 | BEAST_EXPECT(s.read_some(net::mutable_buffer{}) == 0); |
| 53 | BEAST_EXPECT(s.read_some(net::mutable_buffer{}, ec) == 0); |
| 54 | BEAST_EXPECTS(! ec, ec.message()); |
| 55 | |
| 56 | try |
| 57 | { |
| 58 | s.read_some(m1); |
| 59 | BEAST_FAIL(); |
| 60 | } |
| 61 | catch(std::exception const&) |
| 62 | { |
| 63 | BEAST_PASS(); |
| 64 | } |
| 65 | catch(...) |
| 66 | { |
| 67 | BEAST_FAIL(); |
| 68 | } |
| 69 | |
| 70 | BEAST_EXPECT(s.write_some(net::const_buffer{}) == 0); |
| 71 | BEAST_EXPECT(s.write_some(net::const_buffer{}, ec) == 0); |
| 72 | BEAST_EXPECTS(! ec, ec.message()); |
| 73 | |
| 74 | try |
| 75 | { |
| 76 | s.write_some(m1); |
| 77 | BEAST_FAIL(); |
| 78 | } |
| 79 | catch(std::exception const&) |
| 80 | { |
| 81 | BEAST_PASS(); |
| 82 | } |
| 83 | catch(...) |
| 84 | { |
| 85 | BEAST_FAIL(); |
| 86 | } |
| 87 |
nothing calls this directly
no test coverage detected