| 750 | |
| 751 | template <class CoupledTransports> |
| 752 | void test_borrow_none_available() { |
| 753 | CoupledTransports transports; |
| 754 | BOOST_REQUIRE(transports.in != nullptr); |
| 755 | BOOST_REQUIRE(transports.out != nullptr); |
| 756 | |
| 757 | uint8_t write_buf[16]; |
| 758 | memset(write_buf, 'a', sizeof(write_buf)); |
| 759 | |
| 760 | // Attempting to borrow when no data is available should fail immediately |
| 761 | set_trigger(1, transports.out, 10); |
| 762 | uint32_t borrow_len = 10; |
| 763 | const uint8_t* borrowed_buf = transports.in->borrow(nullptr, &borrow_len); |
| 764 | BOOST_CHECK(borrowed_buf == nullptr); |
| 765 | BOOST_CHECK_EQUAL(g_numTriggersFired, (unsigned int)0); |
| 766 | |
| 767 | clear_triggers(); |
| 768 | } |
| 769 | |
| 770 | /************************************************************************** |
| 771 | * Test case generation |
nothing calls this directly
no test coverage detected