| 614 | |
| 615 | template <class CoupledTransports> |
| 616 | void test_read_part_available_in_chunks() { |
| 617 | CoupledTransports transports; |
| 618 | BOOST_REQUIRE(transports.in != nullptr); |
| 619 | BOOST_REQUIRE(transports.out != nullptr); |
| 620 | |
| 621 | uint8_t write_buf[16]; |
| 622 | uint8_t read_buf[16]; |
| 623 | memset(write_buf, 'a', sizeof(write_buf)); |
| 624 | |
| 625 | // Write 10 bytes (in a single frame, for transports that use framing) |
| 626 | transports.out->write(write_buf, 10); |
| 627 | transports.out->flush(); |
| 628 | |
| 629 | // Read 1 byte, to force the transport to read the frame |
| 630 | uint32_t bytes_read = transports.in->read(read_buf, 1); |
| 631 | BOOST_CHECK_EQUAL(bytes_read, 1u); |
| 632 | |
| 633 | // Read more than what is remaining and verify the transport does not block |
| 634 | set_trigger(3, transports.out, 1); |
| 635 | bytes_read = transports.in->read(read_buf, 10); |
| 636 | BOOST_CHECK_EQUAL(g_numTriggersFired, 0u); |
| 637 | BOOST_CHECK_EQUAL(bytes_read, 9u); |
| 638 | |
| 639 | clear_triggers(); |
| 640 | } |
| 641 | |
| 642 | template <class CoupledTransports> |
| 643 | void test_read_partial_midframe() { |
nothing calls this directly
no test coverage detected