aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2020-03-02 15:25:13 -0800
committeratrnati <54334261+atrnati@users.noreply.github.com>2020-03-03 08:51:32 -0600
commit876d4150aa3da531ddd687b48afada6e43f79146 (patch)
treefd72a71419f4cd800d4e500cfcaded4dfc8dc367 /host/tests
parent1393553d623bdf4ba40d5435c9719b6ce990d9ac (diff)
downloaduhd-876d4150aa3da531ddd687b48afada6e43f79146.tar.gz
uhd-876d4150aa3da531ddd687b48afada6e43f79146.tar.bz2
uhd-876d4150aa3da531ddd687b48afada6e43f79146.zip
uhd: Apply clang-format against all .cpp and .hpp files in host/
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
Diffstat (limited to 'host/tests')
-rw-r--r--host/tests/actions_test.cpp13
-rw-r--r--host/tests/client_zero_test.cpp8
-rw-r--r--host/tests/common/mock_zero_copy.hpp3
-rw-r--r--host/tests/convert_test.cpp4
-rw-r--r--host/tests/dpdk_port_test.cpp52
-rw-r--r--host/tests/expert_test.cpp2
-rw-r--r--host/tests/gain_group_test.cpp6
-rw-r--r--host/tests/isatty_test.cpp3
-rw-r--r--host/tests/mb_controller_test.cpp34
-rw-r--r--host/tests/packet_handler_benchmark.cpp63
-rw-r--r--host/tests/property_test.cpp19
-rw-r--r--host/tests/rfnoc_blocks_test.cpp4
-rw-r--r--host/tests/rfnoc_chdr_test.cpp30
-rw-r--r--host/tests/rfnoc_detailgraph_test.cpp8
-rw-r--r--host/tests/rfnoc_graph_mock_nodes.hpp77
-rw-r--r--host/tests/rfnoc_node_test.cpp1
-rw-r--r--host/tests/rfnoc_property_test.cpp13
-rw-r--r--host/tests/rx_streamer_test.cpp19
-rw-r--r--host/tests/scope_exit_test.cpp5
-rw-r--r--host/tests/sph_send_test.cpp2
-rw-r--r--host/tests/streamer_benchmark.cpp1
-rw-r--r--host/tests/tx_streamer_test.cpp38
22 files changed, 212 insertions, 193 deletions
diff --git a/host/tests/actions_test.cpp b/host/tests/actions_test.cpp
index 20e2bdf6e..142e231cd 100644
--- a/host/tests/actions_test.cpp
+++ b/host/tests/actions_test.cpp
@@ -4,17 +4,16 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
-#include <uhd/rfnoc/node.hpp>
+#include "rfnoc_graph_mock_nodes.hpp"
#include <uhd/rfnoc/actions.hpp>
+#include <uhd/rfnoc/node.hpp>
#include <uhd/utils/log.hpp>
+#include <uhdlib/rfnoc/graph.hpp>
#include <uhdlib/rfnoc/node_accessor.hpp>
#include <uhdlib/rfnoc/prop_accessor.hpp>
-#include <uhdlib/rfnoc/graph.hpp>
#include <boost/test/unit_test.hpp>
#include <iostream>
-#include "rfnoc_graph_mock_nodes.hpp"
-
const std::string STREAM_CMD_KEY = "stream_cmd";
@@ -80,9 +79,9 @@ BOOST_AUTO_TEST_CASE(test_actions_simple_graph)
uhd::stream_cmd_t num_samps_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);
constexpr size_t NUM_SAMPS = 100;
- num_samps_cmd.num_samps = NUM_SAMPS;
+ num_samps_cmd.num_samps = NUM_SAMPS;
mock_streamer.issue_stream_cmd(num_samps_cmd, 0);
- BOOST_CHECK_EQUAL(NUM_SAMPS * mock_ddc.get_property<int>("decim", 0),
- mock_rx_radio.last_num_samps);
+ BOOST_CHECK_EQUAL(
+ NUM_SAMPS * mock_ddc.get_property<int>("decim", 0), mock_rx_radio.last_num_samps);
}
diff --git a/host/tests/client_zero_test.cpp b/host/tests/client_zero_test.cpp
index 927161418..20ce28e8a 100644
--- a/host/tests/client_zero_test.cpp
+++ b/host/tests/client_zero_test.cpp
@@ -4,8 +4,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
-#include <uhd/rfnoc/register_iface.hpp>
#include <uhd/rfnoc/mock_block.hpp>
+#include <uhd/rfnoc/register_iface.hpp>
#include <uhd/utils/log.hpp>
#include <uhdlib/rfnoc/client_zero.hpp>
#include <uhdlib/utils/narrow.hpp>
@@ -137,10 +137,10 @@ constexpr uint32_t client_zero_test_iface::SLOT_OFFSET;
BOOST_AUTO_TEST_CASE(simple_read_if_chdr_pkt)
{
- constexpr uint16_t DEVICE_ID = 0xBEEF;
- constexpr uint16_t CTRL_FIFO_SIZE = 5; // in words
+ constexpr uint16_t DEVICE_ID = 0xBEEF;
+ constexpr uint16_t CTRL_FIFO_SIZE = 5; // in words
constexpr uint16_t CTRL_MAX_ASYNC_MSGS = 2;
- constexpr uint16_t MTU = 40; // FIXME in words?
+ constexpr uint16_t MTU = 40; // FIXME in words?
auto mock_reg_iface = std::make_shared<client_zero_test_iface>(DEVICE_ID);
// Prime the pump: We add some blocks and connections
diff --git a/host/tests/common/mock_zero_copy.hpp b/host/tests/common/mock_zero_copy.hpp
index 16a64f5a1..038a8e73d 100644
--- a/host/tests/common/mock_zero_copy.hpp
+++ b/host/tests/common/mock_zero_copy.hpp
@@ -13,10 +13,9 @@
#include <uhd/transport/zero_copy.hpp>
#include <uhd/types/endianness.hpp>
#include <uhd/utils/byteswap.hpp>
-#include <memory>
#include <boost/shared_array.hpp>
-#include <memory>
#include <list>
+#include <memory>
#include <vector>
/***********************************************************************
diff --git a/host/tests/convert_test.cpp b/host/tests/convert_test.cpp
index 9bdfbef6c..ac0340cc1 100644
--- a/host/tests/convert_test.cpp
+++ b/host/tests/convert_test.cpp
@@ -714,8 +714,8 @@ BOOST_AUTO_TEST_CASE(test_convert_types_fc32_and_fc32_chdr)
convert::id_type id;
id.input_format = "fc32";
id.output_format = "fc32_chdr";
- id.num_inputs = 1;
- id.num_outputs = 1;
+ id.num_inputs = 1;
+ id.num_outputs = 1;
// try various lengths to test edge cases
for (size_t nsamps = 1; nsamps < 16; nsamps++) {
diff --git a/host/tests/dpdk_port_test.cpp b/host/tests/dpdk_port_test.cpp
index 8f6b20c34..323d02e48 100644
--- a/host/tests/dpdk_port_test.cpp
+++ b/host/tests/dpdk_port_test.cpp
@@ -13,16 +13,14 @@
#include <memory>
#include <thread>
-namespace po = boost::program_options;
+namespace po = boost::program_options;
namespace dpdk = uhd::transport::dpdk;
void requester(dpdk::service_queue* queue)
{
uint32_t count = 0;
std::chrono::seconds block(-1);
- auto req = dpdk::wait_req_alloc(
- dpdk::wait_type::WAIT_TYPE_COUNT, &count
- );
+ auto req = dpdk::wait_req_alloc(dpdk::wait_type::WAIT_TYPE_COUNT, &count);
std::cout << "Requesting count increment" << std::endl;
queue->submit(req, block);
if (count == 1) {
@@ -31,9 +29,7 @@ void requester(dpdk::service_queue* queue)
wait_req_put(req);
std::cout << "Requesting termination" << std::endl;
- req = dpdk::wait_req_alloc(
- dpdk::wait_type::WAIT_FLOW_CLOSE, NULL
- );
+ req = dpdk::wait_req_alloc(dpdk::wait_type::WAIT_FLOW_CLOSE, NULL);
queue->submit(req, block);
wait_req_put(req);
}
@@ -48,34 +44,34 @@ void servicer(uhd::transport::dpdk::service_queue* queue)
continue;
}
switch (req->reason) {
- case dpdk::wait_type::WAIT_TYPE_COUNT:
- (*(uint32_t *) req->data)++;
- break;
- case dpdk::wait_type::WAIT_FLOW_CLOSE:
- running = false;
- break;
- case dpdk::wait_type::WAIT_SIMPLE:
- break;
- default:
- std::cout << "ERROR: Received unexpected service request type" << std::endl;
- throw uhd::runtime_error("Unexpected service request type");
+ case dpdk::wait_type::WAIT_TYPE_COUNT:
+ (*(uint32_t*)req->data)++;
+ break;
+ case dpdk::wait_type::WAIT_FLOW_CLOSE:
+ running = false;
+ break;
+ case dpdk::wait_type::WAIT_SIMPLE:
+ break;
+ default:
+ std::cout << "ERROR: Received unexpected service request type"
+ << std::endl;
+ throw uhd::runtime_error("Unexpected service request type");
}
if (queue->complete(req) == -ENOBUFS) {
req->reason = dpdk::wait_type::WAIT_SIMPLE;
- while (queue->requeue(req) == -ENOBUFS);
+ while (queue->requeue(req) == -ENOBUFS)
+ ;
}
}
}
-int main(int argc, char **argv)
+int main(int argc, char** argv)
{
po::options_description desc("Allowed options");
int status = 0;
std::string args;
- desc.add_options()
- ("help", "help message")
- ("args", po::value<std::string>(&args)->default_value(""), "UHD-DPDK args")
- ;
+ desc.add_options()("help", "help message")(
+ "args", po::value<std::string>(&args)->default_value(""), "UHD-DPDK args");
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
@@ -86,7 +82,7 @@ int main(int argc, char **argv)
}
auto dpdk_args = uhd::device_addr_t(args);
- auto ctx = uhd::transport::dpdk::dpdk_ctx::get();
+ auto ctx = uhd::transport::dpdk::dpdk_ctx::get();
ctx->init(args);
uhd::transport::dpdk::dpdk_port* port = ctx->get_port(0);
@@ -107,7 +103,7 @@ int main(int argc, char **argv)
std::cout << "Starting up ARP thread..." << std::endl;
std::vector<uhd::transport::dpdk::dpdk_port*> ports;
ports.push_back(port);
- //auto io_srv = uhd::transport::dpdk_io_service::make(1, ports, 16);
+ // auto io_srv = uhd::transport::dpdk_io_service::make(1, ports, 16);
auto io_srv = ctx->get_io_service(1);
// Create link
@@ -117,8 +113,8 @@ int main(int argc, char **argv)
params.send_frame_size = 8000;
params.num_recv_frames = 511;
params.num_send_frames = 511;
- params.recv_buff_size = params.recv_frame_size*params.num_recv_frames;
- params.send_buff_size = params.send_frame_size*params.num_send_frames;
+ params.recv_buff_size = params.recv_frame_size * params.num_recv_frames;
+ params.send_buff_size = params.send_frame_size * params.num_send_frames;
auto link = uhd::transport::udp_dpdk_link::make("192.168.10.2", "49600", params);
// Attach link
diff --git a/host/tests/expert_test.cpp b/host/tests/expert_test.cpp
index 99e3c1100..34be807ab 100644
--- a/host/tests/expert_test.cpp
+++ b/host/tests/expert_test.cpp
@@ -9,9 +9,9 @@
#include <uhdlib/experts/expert_container.hpp>
#include <uhdlib/experts/expert_factory.hpp>
#include <boost/format.hpp>
-#include <memory>
#include <boost/test/unit_test.hpp>
#include <fstream>
+#include <memory>
using namespace uhd::experts;
diff --git a/host/tests/gain_group_test.cpp b/host/tests/gain_group_test.cpp
index 9680fa2a0..98a2516b8 100644
--- a/host/tests/gain_group_test.cpp
+++ b/host/tests/gain_group_test.cpp
@@ -77,12 +77,14 @@ static gain_group::sptr get_gain_group(size_t pri1 = 0, size_t pri2 = 0)
// load gain group with function sets
gain_fcns.get_range = std::bind(&gain_element1::get_range, &g1);
gain_fcns.get_value = std::bind(&gain_element1::get_value, &g1);
- gain_fcns.set_value = std::bind(&gain_element1::set_value, &g1, std::placeholders::_1);
+ gain_fcns.set_value =
+ std::bind(&gain_element1::set_value, &g1, std::placeholders::_1);
gg->register_fcns("g1", gain_fcns, pri1);
gain_fcns.get_range = std::bind(&gain_element2::get_range, &g2);
gain_fcns.get_value = std::bind(&gain_element2::get_value, &g2);
- gain_fcns.set_value = std::bind(&gain_element2::set_value, &g2, std::placeholders::_1);
+ gain_fcns.set_value =
+ std::bind(&gain_element2::set_value, &g2, std::placeholders::_1);
gg->register_fcns("g2", gain_fcns, pri2);
return gg;
diff --git a/host/tests/isatty_test.cpp b/host/tests/isatty_test.cpp
index dfeebfd25..786023dc3 100644
--- a/host/tests/isatty_test.cpp
+++ b/host/tests/isatty_test.cpp
@@ -5,9 +5,9 @@
//
#include <uhdlib/utils/isatty.hpp>
+#include <stdio.h>
#include <boost/test/unit_test.hpp>
#include <iostream>
-#include <stdio.h>
BOOST_AUTO_TEST_CASE(test_isatty)
{
@@ -29,4 +29,3 @@ BOOST_AUTO_TEST_CASE(test_isatty)
BOOST_REQUIRE(!uhd::is_a_tty(99));
#endif
}
-
diff --git a/host/tests/mb_controller_test.cpp b/host/tests/mb_controller_test.cpp
index 48baadf29..b6fb49371 100644
--- a/host/tests/mb_controller_test.cpp
+++ b/host/tests/mb_controller_test.cpp
@@ -14,13 +14,25 @@ using namespace uhd::rfnoc;
class mock_timekeeper : public mb_controller::timekeeper
{
public:
- uint64_t get_ticks_now() { return _ticks; }
+ uint64_t get_ticks_now()
+ {
+ return _ticks;
+ }
- uint64_t get_ticks_last_pps() { return _ticks; }
+ uint64_t get_ticks_last_pps()
+ {
+ return _ticks;
+ }
- void set_ticks_now(const uint64_t ticks) { _ticks = ticks; }
+ void set_ticks_now(const uint64_t ticks)
+ {
+ _ticks = ticks;
+ }
- void set_ticks_next_pps(const uint64_t ticks) { _ticks = ticks; }
+ void set_ticks_next_pps(const uint64_t ticks)
+ {
+ _ticks = ticks;
+ }
uint64_t _ticks;
uint64_t _period;
@@ -31,7 +43,10 @@ public:
}
private:
- void set_period(const uint64_t period_ns) { _period = period_ns; }
+ void set_period(const uint64_t period_ns)
+ {
+ _period = period_ns;
+ }
};
class mock_mb_controller : public mb_controller
@@ -124,9 +139,9 @@ public:
}
std::string clock_source = "internal";
- std::string time_source = "internal";
- bool clock_source_out = false;
- bool time_source_out = false;
+ std::string time_source = "internal";
+ bool clock_source_out = false;
+ bool time_source_out = false;
};
BOOST_AUTO_TEST_CASE(test_mb_controller)
@@ -134,7 +149,7 @@ BOOST_AUTO_TEST_CASE(test_mb_controller)
auto mmbc = std::make_shared<mock_mb_controller>();
BOOST_REQUIRE_EQUAL(mmbc->get_num_timekeepers(), 1);
- auto tk = mmbc->get_timekeeper(0);
+ auto tk = mmbc->get_timekeeper(0);
auto tk_mock = std::dynamic_pointer_cast<mock_timekeeper>(tk);
BOOST_REQUIRE(tk);
@@ -152,4 +167,3 @@ BOOST_AUTO_TEST_CASE(test_mb_controller)
tk->set_time_next_pps(uhd::time_spec_t(TIME_1));
BOOST_CHECK_EQUAL(tk->get_ticks_last_pps(), TIME_1 * TICK_RATE);
}
-
diff --git a/host/tests/packet_handler_benchmark.cpp b/host/tests/packet_handler_benchmark.cpp
index bf21b0c2b..e1fa95f63 100644
--- a/host/tests/packet_handler_benchmark.cpp
+++ b/host/tests/packet_handler_benchmark.cpp
@@ -28,7 +28,7 @@ namespace po = boost::program_options;
using namespace uhd::transport;
static constexpr size_t MAX_HEADER_LEN = 16;
-static constexpr size_t LINE_SIZE = 8;
+static constexpr size_t LINE_SIZE = 8;
//
// Old device3 rx flow control cache and procedures
@@ -75,7 +75,8 @@ inline bool rx_flow_ctrl(
// Update counters assuming the buffer is a consumed packet
if (not packet_info.error) {
- const size_t bytes = 4 * (packet_info.num_header_words32 + packet_info.num_payload_words32);
+ const size_t bytes =
+ 4 * (packet_info.num_header_words32 + packet_info.num_payload_words32);
fc_cache->total_bytes_consumed += bytes;
fc_cache->total_packets_consumed++;
}
@@ -104,12 +105,12 @@ inline void handle_rx_flowctrl_ack(
struct tx_fc_cache_t
{
uint32_t last_byte_ack = 0;
- uint32_t last_seq_ack = 0;
- uint32_t byte_count = 0;
- uint32_t pkt_count = 0;
- uint32_t window_size = 0;
+ uint32_t last_seq_ack = 0;
+ uint32_t byte_count = 0;
+ uint32_t pkt_count = 0;
+ uint32_t window_size = 0;
uint32_t fc_ack_seqnum = 0;
- bool fc_received = false;
+ bool fc_received = false;
std::function<uint32_t(uint32_t)> to_host;
std::function<uint32_t(uint32_t)> from_host;
std::function<void(
@@ -137,9 +138,9 @@ inline bool tx_flow_ctrl(std::shared_ptr<tx_fc_cache_t> fc_cache,
// Just zero out the counts here to avoid actually tring to read flow
// control packets in the benchmark
- fc_cache->byte_count = 0;
+ fc_cache->byte_count = 0;
fc_cache->last_byte_ack = 0;
- fc_cache->pkt_count = 0;
+ fc_cache->pkt_count = 0;
return true;
}
@@ -195,10 +196,9 @@ void benchmark_recv_packet_handler(const size_t spp, const std::string& format)
fc_cache->xport = xport;
fc_cache->interval = std::numeric_limits<std::size_t>::max();
- auto zero_copy_xport = zero_copy_flow_ctrl::make(
- xport, 0, [fc_cache](managed_buffer::sptr buff) {
- return rx_flow_ctrl(fc_cache, buff);
- });
+ auto zero_copy_xport = zero_copy_flow_ctrl::make(xport,
+ 0,
+ [fc_cache](managed_buffer::sptr buff) { return rx_flow_ctrl(fc_cache, buff); });
// Create streamer
auto streamer = std::make_shared<sph::recv_packet_streamer>(spp);
@@ -208,15 +208,15 @@ void benchmark_recv_packet_handler(const size_t spp, const std::string& format)
// Configure streamer xport
streamer->set_vrt_unpacker(&vrt::chdr::if_hdr_unpack_be);
streamer->set_xport_chan_get_buff(0,
- [zero_copy_xport](double timeout) { return zero_copy_xport->get_recv_buff(timeout); },
+ [zero_copy_xport](
+ double timeout) { return zero_copy_xport->get_recv_buff(timeout); },
false // flush
);
// Configure flow control ack
- streamer->set_xport_handle_flowctrl_ack(
- 0, [fc_cache](const uint32_t* payload) {
- handle_rx_flowctrl_ack(fc_cache, payload);
- });
+ streamer->set_xport_handle_flowctrl_ack(0, [fc_cache](const uint32_t* payload) {
+ handle_rx_flowctrl_ack(fc_cache, payload);
+ });
// Configure converter
uhd::convert::id_type id;
@@ -261,16 +261,15 @@ void benchmark_send_packet_handler(
// Configure flow control
std::shared_ptr<tx_fc_cache_t> fc_cache(new tx_fc_cache_t());
- fc_cache->to_host = uhd::ntohx<uint32_t>;
- fc_cache->from_host = uhd::htonx<uint32_t>;
- fc_cache->pack = vrt::chdr::if_hdr_pack_be;
- fc_cache->unpack = vrt::chdr::if_hdr_unpack_be;
+ fc_cache->to_host = uhd::ntohx<uint32_t>;
+ fc_cache->from_host = uhd::htonx<uint32_t>;
+ fc_cache->pack = vrt::chdr::if_hdr_pack_be;
+ fc_cache->unpack = vrt::chdr::if_hdr_unpack_be;
fc_cache->window_size = UINT32_MAX;
auto zero_copy_xport = zero_copy_flow_ctrl::make(xport,
- [fc_cache, xport](managed_buffer::sptr buff) {
- return tx_flow_ctrl(fc_cache, xport, buff);
- },
+ [fc_cache, xport](
+ managed_buffer::sptr buff) { return tx_flow_ctrl(fc_cache, xport, buff); },
0);
// Create streamer
@@ -287,13 +286,13 @@ void benchmark_send_packet_handler(
streamer->set_enable_trailer(false);
// Configure streamer xport
- streamer->set_xport_chan_get_buff(
- 0, [zero_copy_xport](double timeout) { return zero_copy_xport->get_send_buff(timeout); });
+ streamer->set_xport_chan_get_buff(0, [zero_copy_xport](double timeout) {
+ return zero_copy_xport->get_send_buff(timeout);
+ });
// Configure flow control ack
- streamer->set_xport_chan_post_send_cb(0, [fc_cache, zero_copy_xport]() {
- tx_flow_ctrl_ack(fc_cache, zero_copy_xport);
- });
+ streamer->set_xport_chan_post_send_cb(0,
+ [fc_cache, zero_copy_xport]() { tx_flow_ctrl_ack(fc_cache, zero_copy_xport); });
// Allocate buffer
std::vector<uint8_t> buffer(spp * bpi);
@@ -342,8 +341,8 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
return EXIT_FAILURE;
}
- const char* formats[] = {"sc16", "fc32", "fc64"};
- constexpr size_t spp = 1000;
+ const char* formats[] = {"sc16", "fc32", "fc64"};
+ constexpr size_t spp = 1000;
std::cout << "spp: " << spp << "\n";
std::cout << "----------------------------------------------------------\n";
diff --git a/host/tests/property_test.cpp b/host/tests/property_test.cpp
index ac5d489ae..dbd39000f 100644
--- a/host/tests/property_test.cpp
+++ b/host/tests/property_test.cpp
@@ -70,7 +70,8 @@ BOOST_AUTO_TEST_CASE(test_prop_with_desired_subscriber)
uhd::property<int>& prop = tree->create<int>("/");
setter_type setter;
- prop.add_desired_subscriber(std::bind(&setter_type::doit, &setter, std::placeholders::_1));
+ prop.add_desired_subscriber(
+ std::bind(&setter_type::doit, &setter, std::placeholders::_1));
prop.set(42);
BOOST_CHECK_EQUAL(prop.get_desired(), 42);
@@ -89,7 +90,8 @@ BOOST_AUTO_TEST_CASE(test_prop_with_coerced_subscriber)
uhd::property<int>& prop = tree->create<int>("/");
setter_type setter;
- prop.add_coerced_subscriber(std::bind(&setter_type::doit, &setter, std::placeholders::_1));
+ prop.add_coerced_subscriber(
+ std::bind(&setter_type::doit, &setter, std::placeholders::_1));
prop.set(42);
BOOST_CHECK_EQUAL(prop.get_desired(), 42);
@@ -108,8 +110,10 @@ BOOST_AUTO_TEST_CASE(test_prop_manual_coercion)
uhd::property<int>& prop = tree->create<int>("/", uhd::property_tree::MANUAL_COERCE);
setter_type dsetter, csetter;
- prop.add_desired_subscriber(std::bind(&setter_type::doit, &dsetter, std::placeholders::_1));
- prop.add_coerced_subscriber(std::bind(&setter_type::doit, &csetter, std::placeholders::_1));
+ prop.add_desired_subscriber(
+ std::bind(&setter_type::doit, &dsetter, std::placeholders::_1));
+ prop.add_coerced_subscriber(
+ std::bind(&setter_type::doit, &csetter, std::placeholders::_1));
BOOST_CHECK_EQUAL(dsetter._x, 0);
BOOST_CHECK_EQUAL(csetter._x, 0);
@@ -154,7 +158,8 @@ BOOST_AUTO_TEST_CASE(test_prop_with_publisher_and_subscriber)
prop.set_publisher(std::bind(&getter_type::doit, &getter));
setter_type setter;
- prop.add_coerced_subscriber(std::bind(&setter_type::doit, &setter, std::placeholders::_1));
+ prop.add_coerced_subscriber(
+ std::bind(&setter_type::doit, &setter, std::placeholders::_1));
getter._x = 42;
prop.set(0);
@@ -173,7 +178,8 @@ BOOST_AUTO_TEST_CASE(test_prop_with_coercion)
uhd::property<int>& prop = tree->create<int>("/");
setter_type setter;
- prop.add_coerced_subscriber(std::bind(&setter_type::doit, &setter, std::placeholders::_1));
+ prop.add_coerced_subscriber(
+ std::bind(&setter_type::doit, &setter, std::placeholders::_1));
coercer_type coercer;
prop.set_coercer(std::bind(&coercer_type::doit, &coercer, std::placeholders::_1));
@@ -277,4 +283,3 @@ BOOST_AUTO_TEST_CASE(test_mismatched_type_access)
BOOST_CHECK_THROW(tree->access<double>("/stringprop"), uhd::runtime_error);
BOOST_CHECK_THROW(tree->access<std::string>("/intprop"), uhd::runtime_error);
}
-
diff --git a/host/tests/rfnoc_blocks_test.cpp b/host/tests/rfnoc_blocks_test.cpp
index 92e9fc13c..72268b79f 100644
--- a/host/tests/rfnoc_blocks_test.cpp
+++ b/host/tests/rfnoc_blocks_test.cpp
@@ -5,11 +5,11 @@
//
#include "rfnoc_graph_mock_nodes.hpp"
-#include <uhd/rfnoc/mock_block.hpp>
#include <uhd/rfnoc/actions.hpp>
#include <uhd/rfnoc/ddc_block_control.hpp>
#include <uhd/rfnoc/defaults.hpp>
#include <uhd/rfnoc/duc_block_control.hpp>
+#include <uhd/rfnoc/mock_block.hpp>
#include <uhd/rfnoc/null_block_control.hpp>
#include <uhdlib/rfnoc/graph.hpp>
#include <uhdlib/rfnoc/node_accessor.hpp>
@@ -230,7 +230,7 @@ BOOST_AUTO_TEST_CASE(test_duc_block)
constexpr int TEST_INTERP = 20; // 2 halfbands, CIC==5
auto block_container = get_mock_block(noc_id, num_chans, num_chans);
- auto& duc_reg_iface = block_container.reg_iface;
+ auto& duc_reg_iface = block_container.reg_iface;
duc_reg_iface->read_memory[duc_block_control::RB_COMPAT_NUM] =
(duc_block_control::MAJOR_COMPAT << 16) | duc_block_control::MINOR_COMPAT;
duc_reg_iface->read_memory[duc_block_control::RB_NUM_HB] = num_hb;
diff --git a/host/tests/rfnoc_chdr_test.cpp b/host/tests/rfnoc_chdr_test.cpp
index 1c63d5976..747b3c6a4 100644
--- a/host/tests/rfnoc_chdr_test.cpp
+++ b/host/tests/rfnoc_chdr_test.cpp
@@ -226,28 +226,24 @@ BOOST_AUTO_TEST_CASE(chdr_strc_packet_no_swap_64)
BOOST_AUTO_TEST_CASE(chdr_generic_packet_calculate_pyld_offset_64)
{
// Check calculation without timestamp
- auto test_pyld_offset = [](chdr_packet::uptr& pkt,
- const packet_type_t pkt_type,
- const size_t num_mdata)
- {
- uint64_t buff[MAX_BUF_SIZE_WORDS];
- chdr_header header;
- header.set_pkt_type(pkt_type);
- header.set_num_mdata(num_mdata);
+ auto test_pyld_offset =
+ [](chdr_packet::uptr& pkt, const packet_type_t pkt_type, const size_t num_mdata) {
+ uint64_t buff[MAX_BUF_SIZE_WORDS];
+ chdr_header header;
+ header.set_pkt_type(pkt_type);
+ header.set_num_mdata(num_mdata);
- pkt->refresh(reinterpret_cast<void*>(buff), header, 0);
+ pkt->refresh(reinterpret_cast<void*>(buff), header, 0);
- const size_t pyld_offset = pkt->calculate_payload_offset(
- pkt_type, num_mdata);
+ const size_t pyld_offset = pkt->calculate_payload_offset(pkt_type, num_mdata);
- void* pyld_ptr = pkt->get_payload_ptr();
+ void* pyld_ptr = pkt->get_payload_ptr();
- const size_t non_pyld_bytes = static_cast<size_t>(
- reinterpret_cast<uint8_t*>(pyld_ptr) -
- reinterpret_cast<uint8_t*>(buff));
+ const size_t non_pyld_bytes = static_cast<size_t>(
+ reinterpret_cast<uint8_t*>(pyld_ptr) - reinterpret_cast<uint8_t*>(buff));
- BOOST_CHECK(pyld_offset == non_pyld_bytes);
- };
+ BOOST_CHECK(pyld_offset == non_pyld_bytes);
+ };
{
chdr_packet::uptr pkt = chdr64_be_factory.make_generic();
diff --git a/host/tests/rfnoc_detailgraph_test.cpp b/host/tests/rfnoc_detailgraph_test.cpp
index 2e9abf39d..9a2a57ce4 100644
--- a/host/tests/rfnoc_detailgraph_test.cpp
+++ b/host/tests/rfnoc_detailgraph_test.cpp
@@ -4,16 +4,15 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
+#include "rfnoc_graph_mock_nodes.hpp"
#include <uhd/rfnoc/node.hpp>
#include <uhd/utils/log.hpp>
+#include <uhdlib/rfnoc/graph.hpp>
#include <uhdlib/rfnoc/node_accessor.hpp>
#include <uhdlib/rfnoc/prop_accessor.hpp>
-#include <uhdlib/rfnoc/graph.hpp>
#include <boost/test/unit_test.hpp>
#include <iostream>
-#include "rfnoc_graph_mock_nodes.hpp"
-
using uhd::rfnoc::detail::graph_t;
using namespace uhd::rfnoc;
@@ -57,11 +56,12 @@ public:
{
return _graph_ptr->_vertices_to_nodes(_graph_ptr->_get_topo_sorted_nodes());
}
+
private:
graph_t* _graph_ptr;
};
-}}};
+}}}; // namespace uhd::rfnoc::detail
BOOST_AUTO_TEST_CASE(test_graph)
{
diff --git a/host/tests/rfnoc_graph_mock_nodes.hpp b/host/tests/rfnoc_graph_mock_nodes.hpp
index c28256b67..564858916 100644
--- a/host/tests/rfnoc_graph_mock_nodes.hpp
+++ b/host/tests/rfnoc_graph_mock_nodes.hpp
@@ -45,25 +45,24 @@ public:
UHD_LOG_INFO(get_unique_id(), " Calling resolver for `samp_rate_in'...");
samp_rate_in = master_clock_rate.get();
});
- add_property_resolver({&_samp_rate_out},
- {&_samp_rate_out},
- [this]() {
- UHD_LOG_INFO(get_unique_id(), " Calling resolver for `samp_rate_out'...");
- if (this->disable_samp_out_resolver) {
- _samp_rate_out = this->force_samp_out_value;
- UHD_LOG_DEBUG(get_unique_id(),
- "Forcing samp_rate_out to " << _samp_rate_out.get());
- return;
- }
- this->_samp_rate_out = this->_master_clock_rate.get();
- });
+ add_property_resolver({&_samp_rate_out}, {&_samp_rate_out}, [this]() {
+ UHD_LOG_INFO(get_unique_id(), " Calling resolver for `samp_rate_out'...");
+ if (this->disable_samp_out_resolver) {
+ _samp_rate_out = this->force_samp_out_value;
+ UHD_LOG_DEBUG(
+ get_unique_id(), "Forcing samp_rate_out to " << _samp_rate_out.get());
+ return;
+ }
+ this->_samp_rate_out = this->_master_clock_rate.get();
+ });
add_property_resolver({&_master_clock_rate},
{&_master_clock_rate, &_samp_rate_in, &_samp_rate_out},
[& samp_rate_out = _samp_rate_out,
&samp_rate_in = _samp_rate_in,
&master_clock_rate = _master_clock_rate,
this]() {
- UHD_LOG_INFO(get_unique_id(), " Calling resolver for `master_clock_rate'...");
+ UHD_LOG_INFO(
+ get_unique_id(), " Calling resolver for `master_clock_rate'...");
if (_master_clock_rate.get() > 150e6) {
_master_clock_rate = 200e6;
} else {
@@ -79,13 +78,11 @@ public:
}
});
// By depending on ALWAYS_DIRTY, this property is always updated:
- add_property_resolver({&ALWAYS_DIRTY},
- {&_rssi},
- [this]() {
- UHD_LOG_INFO(get_unique_id(), " Calling resolver for `rssi'...");
- rssi_resolver_count++;
- _rssi = static_cast<double>(rssi_resolver_count);
- });
+ add_property_resolver({&ALWAYS_DIRTY}, {&_rssi}, [this]() {
+ UHD_LOG_INFO(get_unique_id(), " Calling resolver for `rssi'...");
+ rssi_resolver_count++;
+ _rssi = static_cast<double>(rssi_resolver_count);
+ });
set_action_forwarding_policy(forwarding_policy_t::DROP);
@@ -102,11 +99,12 @@ public:
<< ", id==" << action->id);
if (stream_mode == uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS) {
UHD_LOG_INFO(get_unique_id(), "Starting Stream!");
- } else if (stream_mode == uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS) {
+ } else if (stream_mode
+ == uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS) {
UHD_LOG_INFO(get_unique_id(), "Stopping Stream!");
} else {
this->last_num_samps = stream_cmd_action->stream_cmd.num_samps;
- RFNOC_LOG_INFO("Streaming num samps: " << this->last_num_samps);
+ RFNOC_LOG_INFO("Streaming num samps: " << this->last_num_samps);
}
});
}
@@ -132,19 +130,17 @@ public:
}
// Some public attributes that help debugging
- size_t rssi_resolver_count = 0;
+ size_t rssi_resolver_count = 0;
bool disable_samp_out_resolver = false;
- double force_samp_out_value = 23e6;
+ double force_samp_out_value = 23e6;
size_t last_num_samps = 0;
private:
const size_t _radio_idx;
- property_t<double> _samp_rate_in{
- "samp_rate", 200e6, {res_source_info::INPUT_EDGE}};
- property_t<double> _samp_rate_out{
- "samp_rate", 200e6, {res_source_info::OUTPUT_EDGE}};
+ property_t<double> _samp_rate_in{"samp_rate", 200e6, {res_source_info::INPUT_EDGE}};
+ property_t<double> _samp_rate_out{"samp_rate", 200e6, {res_source_info::OUTPUT_EDGE}};
property_t<double> _master_clock_rate{
"master_clock_rate", 200e6, {res_source_info::USER}};
property_t<double> _rssi{"rssi", 0, {res_source_info::USER}};
@@ -200,8 +196,8 @@ public:
samp_rate_in = samp_rate_out.get() * decim.get();
});
- register_action_handler(
- ACTION_KEY_STREAM_CMD, [this](const res_source_info& src, action_info::sptr action) {
+ register_action_handler(ACTION_KEY_STREAM_CMD,
+ [this](const res_source_info& src, action_info::sptr action) {
res_source_info dst_edge{
res_source_info::invert_edge(src.type), src.instance};
stream_cmd_action_info::sptr stream_cmd_action =
@@ -212,7 +208,7 @@ public:
RFNOC_LOG_INFO("Received stream command: " << stream_mode << " to "
<< src.to_string()
<< ", id==" << action->id);
- auto new_action = stream_cmd_action_info::make(stream_mode);
+ auto new_action = stream_cmd_action_info::make(stream_mode);
new_action->stream_cmd = stream_cmd_action->stream_cmd;
if (stream_mode == uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE
|| stream_mode == uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_MORE) {
@@ -226,12 +222,16 @@ public:
}
RFNOC_LOG_INFO("Forwarding stream_cmd, num_samps is "
- << new_action->stream_cmd.num_samps << ", id==" << new_action->id);
+ << new_action->stream_cmd.num_samps
+ << ", id==" << new_action->id);
post_action(dst_edge, new_action);
});
}
- std::string get_unique_id() const { return "MOCK_DDC"; }
+ std::string get_unique_id() const
+ {
+ return "MOCK_DDC";
+ }
size_t get_num_input_ports() const
{
@@ -281,7 +281,10 @@ public:
set_action_forwarding_policy(forwarding_policy_t::ONE_TO_ONE);
}
- std::string get_unique_id() const { return "MOCK_FIFO"; }
+ std::string get_unique_id() const
+ {
+ return "MOCK_FIFO";
+ }
size_t get_num_input_ports() const
{
@@ -345,10 +348,8 @@ public:
}
private:
- property_t<double> _samp_rate_user{
- "samp_rate", 1e6, {res_source_info::USER}};
- property_t<double> _samp_rate_in{
- "samp_rate", 1e6, {res_source_info::INPUT_EDGE}};
+ property_t<double> _samp_rate_user{"samp_rate", 1e6, {res_source_info::USER}};
+ property_t<double> _samp_rate_in{"samp_rate", 1e6, {res_source_info::INPUT_EDGE}};
const size_t _num_ports;
};
diff --git a/host/tests/rfnoc_node_test.cpp b/host/tests/rfnoc_node_test.cpp
index 15597de16..b90835081 100644
--- a/host/tests/rfnoc_node_test.cpp
+++ b/host/tests/rfnoc_node_test.cpp
@@ -138,5 +138,4 @@ BOOST_AUTO_TEST_CASE(test_node_accessor)
BOOST_CHECK(!TN1.user_prop_cb_called);
node_accessor.init_props(&TN1);
BOOST_CHECK(TN1.user_prop_cb_called);
-
}
diff --git a/host/tests/rfnoc_property_test.cpp b/host/tests/rfnoc_property_test.cpp
index 7e5af20a2..eb22424b1 100644
--- a/host/tests/rfnoc_property_test.cpp
+++ b/host/tests/rfnoc_property_test.cpp
@@ -4,8 +4,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
-#include <uhd/rfnoc/property.hpp>
#include <uhd/rfnoc/dirtifier.hpp>
+#include <uhd/rfnoc/property.hpp>
#include <uhdlib/rfnoc/prop_accessor.hpp>
#include <boost/test/unit_test.hpp>
#include <iostream>
@@ -25,7 +25,7 @@ BOOST_AUTO_TEST_CASE(test_res_source_info)
BOOST_CHECK_EQUAL(S2.instance, 5);
// Check initializer
- auto src_info_printer = [](res_source_info rsi){
+ auto src_info_printer = [](res_source_info rsi) {
std::cout << static_cast<int>(rsi.type) << "::" << rsi.instance << std::endl;
};
src_info_printer({res_source_info::OUTPUT_EDGE, 5});
@@ -94,7 +94,8 @@ BOOST_AUTO_TEST_CASE(test_access)
// Now test the scoped access mode
{
- auto access_lock = prop_accessor.get_scoped_prop_access(prop_i, property_base_t::RW, property_base_t::NONE);
+ auto access_lock = prop_accessor.get_scoped_prop_access(
+ prop_i, property_base_t::RW, property_base_t::NONE);
prop_i.set(42);
BOOST_CHECK_EQUAL(prop_i.get(), 42);
}
@@ -145,8 +146,10 @@ BOOST_AUTO_TEST_CASE(test_dirtifier)
prop_accessor.mark_clean(dirtifier);
BOOST_CHECK(dirtifier.is_dirty());
property_t<int> prop_i{"int_prop", 5, {res_source_info::USER}};
- BOOST_REQUIRE_THROW(prop_accessor.forward<false>(&dirtifier, &prop_i), uhd::type_error);
- BOOST_REQUIRE_THROW(prop_accessor.forward<false>(&prop_i, &dirtifier), uhd::type_error);
+ BOOST_REQUIRE_THROW(
+ prop_accessor.forward<false>(&dirtifier, &prop_i), uhd::type_error);
+ BOOST_REQUIRE_THROW(
+ prop_accessor.forward<false>(&prop_i, &dirtifier), uhd::type_error);
BOOST_CHECK(!prop_accessor.are_compatible(&prop_i, &dirtifier));
BOOST_CHECK(!prop_accessor.are_compatible(&dirtifier, &prop_i));
}
diff --git a/host/tests/rx_streamer_test.cpp b/host/tests/rx_streamer_test.cpp
index 953b82028..f50fef613 100644
--- a/host/tests/rx_streamer_test.cpp
+++ b/host/tests/rx_streamer_test.cpp
@@ -6,9 +6,9 @@
#include "../common/mock_link.hpp"
#include <uhdlib/transport/rx_streamer_impl.hpp>
-#include <memory>
#include <boost/test/unit_test.hpp>
#include <iostream>
+#include <memory>
namespace uhd { namespace transport {
@@ -774,7 +774,7 @@ BOOST_AUTO_TEST_CASE(test_recv_one_channel_one_eov)
// only one, since filling the EOV vector results in an early
// termination of `recv()` (which we don't want here).
std::vector<size_t> eov_positions(2);
- metadata.eov_positions = eov_positions.data();
+ metadata.eov_positions = eov_positions.data();
metadata.eov_positions_size = eov_positions.size();
std::cout << "receiving packet " << i << std::endl;
@@ -805,8 +805,8 @@ BOOST_AUTO_TEST_CASE(test_recv_two_channel_aggregate_eov)
const std::vector<size_t> eov_every_nth_packet{3, 5};
const size_t num_chans = eov_every_nth_packet.size();
- auto recv_links = make_links(num_chans);
- auto streamer = make_rx_streamer(recv_links, format);
+ auto recv_links = make_links(num_chans);
+ auto streamer = make_rx_streamer(recv_links, format);
const size_t spp = streamer->get_max_num_samps();
const size_t num_samps = spp * NUM_PACKETS;
@@ -825,13 +825,13 @@ BOOST_AUTO_TEST_CASE(test_recv_two_channel_aggregate_eov)
for (size_t ch = 0; ch < num_chans; ch++) {
header.eob = false;
header.has_tsf = false;
- header.eov = ((i + 1) % eov_every_nth_packet[ch]) == 0;
+ header.eov = ((i + 1) % eov_every_nth_packet[ch]) == 0;
push_back_recv_packet(recv_links[ch], header, spp);
eov |= header.eov;
}
- if(eov) {
+ if (eov) {
expected_eov_offsets.push_back(spp * (i + 1));
}
}
@@ -839,15 +839,14 @@ BOOST_AUTO_TEST_CASE(test_recv_two_channel_aggregate_eov)
uhd::rx_metadata_t metadata;
std::vector<size_t> eov_positions(expected_eov_offsets.size() + 1);
- metadata.eov_positions = eov_positions.data();
+ metadata.eov_positions = eov_positions.data();
metadata.eov_positions_size = eov_positions.size();
- size_t num_samps_ret =
- streamer->recv(buffers, num_samps, metadata, 1.0, false);
+ size_t num_samps_ret = streamer->recv(buffers, num_samps, metadata, 1.0, false);
BOOST_CHECK_EQUAL(num_samps_ret, num_samps);
BOOST_CHECK_EQUAL(metadata.eov_positions_count, expected_eov_offsets.size());
- for(size_t i = 0; i < metadata.eov_positions_count; i++) {
+ for (size_t i = 0; i < metadata.eov_positions_count; i++) {
BOOST_CHECK_EQUAL(expected_eov_offsets[i], metadata.eov_positions[i]);
}
}
diff --git a/host/tests/scope_exit_test.cpp b/host/tests/scope_exit_test.cpp
index 7c05613a8..daadaf2fb 100644
--- a/host/tests/scope_exit_test.cpp
+++ b/host/tests/scope_exit_test.cpp
@@ -20,7 +20,7 @@ BOOST_AUTO_TEST_CASE(test_scope_exit)
BOOST_AUTO_TEST_CASE(test_scope_exit_function_object)
{
- bool flag = false;
+ bool flag = false;
std::function<void(void)> resetter = [&flag]() { flag = true; };
{
@@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE(test_scope_exit_function_object)
BOOST_AUTO_TEST_CASE(test_scope_exit_function_named_lambda)
{
- bool flag = false;
+ bool flag = false;
auto resetter = [&flag]() { flag = true; };
{
@@ -42,4 +42,3 @@ BOOST_AUTO_TEST_CASE(test_scope_exit_function_named_lambda)
}
BOOST_CHECK(flag);
}
-
diff --git a/host/tests/sph_send_test.cpp b/host/tests/sph_send_test.cpp
index 282d01da4..6fc7ddc3b 100644
--- a/host/tests/sph_send_test.cpp
+++ b/host/tests/sph_send_test.cpp
@@ -7,10 +7,10 @@
#include "../common/mock_zero_copy.hpp"
#include "../lib/transport/super_send_packet_handler.hpp"
-#include <functional>
#include <boost/shared_array.hpp>
#include <boost/test/unit_test.hpp>
#include <complex>
+#include <functional>
#include <list>
#include <vector>
diff --git a/host/tests/streamer_benchmark.cpp b/host/tests/streamer_benchmark.cpp
index 0c11441ed..9479d9be6 100644
--- a/host/tests/streamer_benchmark.cpp
+++ b/host/tests/streamer_benchmark.cpp
@@ -12,7 +12,6 @@
#include <uhdlib/transport/inline_io_service.hpp>
#include <uhdlib/transport/rx_streamer_impl.hpp>
#include <uhdlib/transport/tx_streamer_impl.hpp>
-#include <memory>
#include <boost/program_options.hpp>
#include <chrono>
#include <iostream>
diff --git a/host/tests/tx_streamer_test.cpp b/host/tests/tx_streamer_test.cpp
index 2288bd029..0016f596c 100644
--- a/host/tests/tx_streamer_test.cpp
+++ b/host/tests/tx_streamer_test.cpp
@@ -6,9 +6,9 @@
#include "../common/mock_link.hpp"
#include <uhdlib/transport/tx_streamer_impl.hpp>
-#include <memory>
#include <boost/test/unit_test.hpp>
#include <iostream>
+#include <memory>
namespace uhd { namespace transport {
@@ -88,8 +88,8 @@ public:
tx_streamer_impl::set_scale_factor(chan, scale_factor);
}
- bool recv_async_msg(uhd::async_metadata_t& /*async_metadata*/,
- double /*timeout = 0.1*/)
+ bool recv_async_msg(
+ uhd::async_metadata_t& /*async_metadata*/, double /*timeout = 0.1*/)
{
return false;
}
@@ -141,7 +141,10 @@ static std::shared_ptr<mock_tx_streamer> make_tx_streamer(
return streamer;
}
-std::tuple<mock_tx_data_xport::packet_info_t, std::complex<uint16_t>*, size_t, boost::shared_array<uint8_t>>
+std::tuple<mock_tx_data_xport::packet_info_t,
+ std::complex<uint16_t>*,
+ size_t,
+ boost::shared_array<uint8_t>>
pop_send_packet(mock_send_link::sptr send_link)
{
auto packet = send_link->pop_send_packet();
@@ -485,8 +488,7 @@ BOOST_AUTO_TEST_CASE(test_send_one_channel_eov_error_cases)
streamer->send(&buff.front(), num_samps, metadata, 1.0), uhd::value_error);
// Error case: EOV values greater than nsamps_per_buff
- BOOST_CHECK_THROW(
- streamer->send(&buff.front(), 1, metadata, 1.0), uhd::value_error);
+ BOOST_CHECK_THROW(streamer->send(&buff.front(), 1, metadata, 1.0), uhd::value_error);
}
BOOST_AUTO_TEST_CASE(test_send_one_channel_multi_packet)
@@ -529,7 +531,8 @@ BOOST_AUTO_TEST_CASE(test_send_one_channel_multi_packet)
size_t packet_samps;
boost::shared_array<uint8_t> frame_buff;
- std::tie(info, data, packet_samps, frame_buff) = pop_send_packet(send_links[0]);
+ std::tie(info, data, packet_samps, frame_buff) =
+ pop_send_packet(send_links[0]);
for (size_t j = 0; j < packet_samps; j++) {
const size_t n = j + samps_checked;
@@ -595,7 +598,8 @@ BOOST_AUTO_TEST_CASE(test_send_two_channel_one_packet)
size_t packet_samps;
boost::shared_array<uint8_t> frame_buff;
- std::tie(info, data, packet_samps, frame_buff) = pop_send_packet(send_links[ch]);
+ std::tie(info, data, packet_samps, frame_buff) =
+ pop_send_packet(send_links[ch]);
BOOST_CHECK_EQUAL(num_samps, packet_samps);
// Check data
@@ -639,7 +643,8 @@ BOOST_AUTO_TEST_CASE(test_meta_data_cache)
size_t packet_samps;
boost::shared_array<uint8_t> frame_buff;
- std::tie(info, std::ignore, packet_samps, frame_buff) = pop_send_packet(send_links[0]);
+ std::tie(info, std::ignore, packet_samps, frame_buff) =
+ pop_send_packet(send_links[0]);
BOOST_CHECK_EQUAL(packet_samps, num_sent);
BOOST_CHECK(info.has_tsf);
BOOST_CHECK(info.eob);
@@ -652,8 +657,10 @@ BOOST_AUTO_TEST_CASE(test_spp)
auto send_links = make_links(1);
uhd::stream_args_t stream_args("fc64", "sc16");
stream_args.args["spp"] = std::to_string(10);
- auto streamer = std::make_shared<mock_tx_streamer>(send_links.size(), stream_args);
- mock_tx_data_xport::uptr xport(std::make_unique<mock_tx_data_xport>(send_links[0]));
+ auto streamer =
+ std::make_shared<mock_tx_streamer>(send_links.size(), stream_args);
+ mock_tx_data_xport::uptr xport(
+ std::make_unique<mock_tx_data_xport>(send_links[0]));
streamer->connect_channel(0, std::move(xport));
BOOST_CHECK_EQUAL(streamer->get_max_num_samps(), 10);
}
@@ -663,10 +670,13 @@ BOOST_AUTO_TEST_CASE(test_spp)
auto send_links = make_links(1);
uhd::stream_args_t stream_args("fc64", "sc16");
stream_args.args["spp"] = std::to_string(10000);
- auto streamer = std::make_shared<mock_tx_streamer>(send_links.size(), stream_args);
- mock_tx_data_xport::uptr xport(std::make_unique<mock_tx_data_xport>(send_links[0]));
+ auto streamer =
+ std::make_shared<mock_tx_streamer>(send_links.size(), stream_args);
+ mock_tx_data_xport::uptr xport(
+ std::make_unique<mock_tx_data_xport>(send_links[0]));
const size_t max_pyld = xport->get_max_payload_size();
streamer->connect_channel(0, std::move(xport));
- BOOST_CHECK_EQUAL(streamer->get_max_num_samps(), max_pyld / sizeof(std::complex<uint16_t>));
+ BOOST_CHECK_EQUAL(
+ streamer->get_max_num_samps(), max_pyld / sizeof(std::complex<uint16_t>));
}
}