aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/common/mock_zero_copy.cpp
diff options
context:
space:
mode:
authorCiro Nishiguchi <ciro.nishiguchi@ni.com>2018-11-14 10:28:23 -0600
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-11-16 14:23:22 -0800
commit97935b15417697869b9633bc8fec552a57fb29ef (patch)
tree6f35c39255564a09b80344b57bf36ccd0c9b37de /host/tests/common/mock_zero_copy.cpp
parentc3680008cf46d3693bdd43ff2621492254c28849 (diff)
downloaduhd-97935b15417697869b9633bc8fec552a57fb29ef.tar.gz
uhd-97935b15417697869b9633bc8fec552a57fb29ef.tar.bz2
uhd-97935b15417697869b9633bc8fec552a57fb29ef.zip
tests: Retrofit sph test to use new mock transport
Diffstat (limited to 'host/tests/common/mock_zero_copy.cpp')
-rw-r--r--host/tests/common/mock_zero_copy.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/host/tests/common/mock_zero_copy.cpp b/host/tests/common/mock_zero_copy.cpp
index b1d384ec7..eee96234d 100644
--- a/host/tests/common/mock_zero_copy.cpp
+++ b/host/tests/common/mock_zero_copy.cpp
@@ -8,7 +8,17 @@
#include "mock_zero_copy.hpp"
#include <boost/shared_ptr.hpp>
+using namespace uhd::transport;
+
+mock_zero_copy::mock_zero_copy(
+ vrt::if_packet_info_t::link_type_t link_type
+) : _link_type(link_type) {
+}
+
uhd::transport::managed_recv_buffer::sptr mock_zero_copy::get_recv_buff(double) {
+ if (_simulate_io_error) {
+ throw uhd::io_error("IO error exception"); //simulate an IO error
+ }
if (_rx_mems.empty()) {
return uhd::transport::managed_recv_buffer::sptr(); // timeout
}