From 570b4c6ab30be081a0119a2bf2f1d8ee7fb7f5b9 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 30 Aug 2021 17:28:28 +0200 Subject: 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. --- host/tests/link_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/tests') 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(new uint8_t[packet_size]); - packet_data[0] = i; + packet_data[0] = static_cast(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(buff->data()); - ptr[0] = i; + BOOST_CHECK_EQUAL(ptr[0], static_cast(i)); xport->release_recv_buff(std::move(buff)); BOOST_CHECK(!buff); -- cgit v1.2.3