| 31 | |
| 32 | namespace mdf::test { |
| 33 | TEST(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 | |
| 52 | TEST(BoostIostreams, SimpleByteArray) { |
| 53 | std::vector<uint8_t> data_list(256,0); |
nothing calls this directly
no test coverage detected