MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / TEST

Function TEST

lib/mdflib/mdflib_test/src/testiostream.cpp:33–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32namespace mdf::test {
33TEST(BoostIostreams, SimpleFile) {
34
35 const std::string test_file = MakeFilePath("simple_file.txt");
36
37 stream_buffer<file_sink> out_buffer(test_file);
38
39 std::ostream out_file(&out_buffer);
40 constexpr std::string_view test_text = "Hello Boost IO-streams.";
41 out_file << test_text << std::endl;
42
43 stream_buffer<file_source> input_buffer(test_file);
44 std::istream input_file(&input_buffer);
45 while (!input_file.eof()) {
46 std::string input_text;
47 input_file >> input_text;
48 std::cout << input_text << std::endl;
49 }
50}
51
52TEST(BoostIostreams, SimpleByteArray) {
53 std::vector<uint8_t> data_list(256,0);

Callers

nothing calls this directly

Calls 5

MakeFilePathFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45
closeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected