MCPcopy Create free account
hub / github.com/boostorg/beast / testMembers

Method testMembers

test/beast/core/flat_stream.cpp:30–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28{
29public:
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

Callers

nothing calls this directly

Calls 9

messageMethod · 0.80
async_read_someMethod · 0.80
async_write_someMethod · 0.80
teardownFunction · 0.50
async_teardownFunction · 0.50
read_someMethod · 0.45
write_someMethod · 0.45
runMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected