MCPcopy Create free account
hub / github.com/Icinga/icinga2 / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

test/base-stream.cpp:13–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11BOOST_AUTO_TEST_SUITE(base_stream)
12
13BOOST_AUTO_TEST_CASE(readline_stdio)
14{
15 std::stringstream msgbuf;
16 msgbuf << "Hello\nWorld\n\n";
17
18 StdioStream::Ptr stdstream = new StdioStream(&msgbuf, false);
19
20 StreamReadContext rlc;
21
22 String line;
23 BOOST_CHECK(stdstream->ReadLine(&line, rlc) == StatusNewItem);
24 BOOST_CHECK(line == "Hello");
25
26 BOOST_CHECK(stdstream->ReadLine(&line, rlc) == StatusNewItem);
27 BOOST_CHECK(line == "World");
28
29 BOOST_CHECK(stdstream->ReadLine(&line, rlc) == StatusNewItem);
30 BOOST_CHECK(line == "");
31
32 BOOST_CHECK(stdstream->ReadLine(&line, rlc) == StatusNewItem);
33 BOOST_CHECK(line == "");
34
35 BOOST_CHECK(stdstream->ReadLine(&line, rlc) == StatusEof);
36
37 stdstream->Close();
38}
39
40BOOST_AUTO_TEST_SUITE_END()

Callers

nothing calls this directly

Calls 2

ReadLineMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected