diff options
author | Martin Braun <martin.braun@ettus.com> | 2021-08-30 17:28:28 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-08-31 07:32:55 -0500 |
commit | 570b4c6ab30be081a0119a2bf2f1d8ee7fb7f5b9 (patch) | |
tree | fb18979816e8b27decdfac123f8976fba7f45134 | |
parent | f8d8c23e701b5e1bc2c18d1a0f28b7a2699afbac (diff) | |
download | uhd-570b4c6ab30be081a0119a2bf2f1d8ee7fb7f5b9.tar.gz uhd-570b4c6ab30be081a0119a2bf2f1d8ee7fb7f5b9.tar.bz2 uhd-570b4c6ab30be081a0119a2bf2f1d8ee7fb7f5b9.zip |
tests: Fix check in link_test
The test_recv_get_release test should be checking received packets had
the same content as they did on send(), but was instead assigning to the
received buffer.
Shoutouts to GitHub user johnwstanford for pointing out the issue.
-rw-r--r-- | host/tests/link_test.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/host/tests/link_test.cpp b/host/tests/link_test.cpp index bcd3c3860..dd147686e 100644 --- a/host/tests/link_test.cpp +++ b/host/tests/link_test.cpp @@ -101,7 +101,7 @@ BOOST_AUTO_TEST_CASE(test_recv_get_release) for (size_t i = 0; i < 5; i++) { size_t packet_size = sizeof(uint8_t); auto packet_data = boost::shared_array<uint8_t>(new uint8_t[packet_size]); - packet_data[0] = i; + packet_data[0] = static_cast<uint8_t>(i); xport->push_back_recv_packet(packet_data, packet_size); auto buff = xport->get_recv_buff(timeout_ms); @@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE(test_recv_get_release) BOOST_CHECK(buff->data()); auto* ptr = static_cast<uint8_t*>(buff->data()); - ptr[0] = i; + BOOST_CHECK_EQUAL(ptr[0], static_cast<uint8_t>(i)); xport->release_recv_buff(std::move(buff)); BOOST_CHECK(!buff); |