diff options
author | Alex Williams <alex.williams@ni.com> | 2019-06-19 17:40:46 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:29 -0800 |
commit | 52c38e3c22d7c83943c0e1fc0bc69a967d6fe25c (patch) | |
tree | 1fec490bc9297c21b43805f942cf8982b7c98260 /host/tests/rfnoc_detailgraph_test.cpp | |
parent | 50f8e9f35f776016ec8df7edad570d9d8084afdb (diff) | |
download | uhd-52c38e3c22d7c83943c0e1fc0bc69a967d6fe25c.tar.gz uhd-52c38e3c22d7c83943c0e1fc0bc69a967d6fe25c.tar.bz2 uhd-52c38e3c22d7c83943c0e1fc0bc69a967d6fe25c.zip |
rfnoc: Enable users to query connections in the graph
Implement uhd::rfnoc::rfnoc_graph::enumerate_*_connections()
Diffstat (limited to 'host/tests/rfnoc_detailgraph_test.cpp')
-rw-r--r-- | host/tests/rfnoc_detailgraph_test.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/host/tests/rfnoc_detailgraph_test.cpp b/host/tests/rfnoc_detailgraph_test.cpp index efae9ff4f..2e9abf39d 100644 --- a/host/tests/rfnoc_detailgraph_test.cpp +++ b/host/tests/rfnoc_detailgraph_test.cpp @@ -157,6 +157,13 @@ BOOST_AUTO_TEST_CASE(test_graph) graph.connect(&mock_rx_radio, &mock_tx_radio, edge_info); BOOST_CHECK_EQUAL(boost::num_vertices(bgl_graph), 2); + BOOST_REQUIRE_EQUAL(graph.enumerate_edges().size(), 1); + auto edge0_info = graph.enumerate_edges().at(0); + BOOST_CHECK_EQUAL(edge0_info.src_blockid, "MOCK_RADIO0"); + BOOST_CHECK_EQUAL(edge0_info.src_port, 0); + BOOST_CHECK_EQUAL(edge0_info.dst_blockid, "MOCK_RADIO1"); + BOOST_CHECK_EQUAL(edge0_info.dst_port, 0); + // Now attempt illegal connections (they must all fail) edge_info.src_port = 1; edge_info.dst_port = 0; @@ -171,6 +178,7 @@ BOOST_AUTO_TEST_CASE(test_graph) edge_info.property_propagation_active = false; BOOST_REQUIRE_THROW( graph.connect(&mock_rx_radio, &mock_tx_radio, edge_info), uhd::rfnoc_error); + BOOST_CHECK_EQUAL(graph.enumerate_edges().size(), 1); } BOOST_AUTO_TEST_CASE(test_graph_unresolvable) |