diff options
author | Martin Braun <martin.braun@ettus.com> | 2022-03-16 16:50:16 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-03-30 10:28:07 -0700 |
commit | 1d2ec743170b03a1c1f9618cb48809b2d9794084 (patch) | |
tree | e5fb315c31efecdb31e6216269c3df8aebd025c2 /host/tests | |
parent | 4cd0d9bea9833872ce3ff7cf2999015d53ebabed (diff) | |
download | uhd-1d2ec743170b03a1c1f9618cb48809b2d9794084.tar.gz uhd-1d2ec743170b03a1c1f9618cb48809b2d9794084.tar.bz2 uhd-1d2ec743170b03a1c1f9618cb48809b2d9794084.zip |
rfnoc: replay: Add ability to capture and read async info
- Add action handlers to the replay block to store TX and RX events.
- Adds two new APIs: get_{record,play}_async_metadata() to read back
async info.
- Add unit tests.
Diffstat (limited to 'host/tests')
-rw-r--r-- | host/tests/rfnoc_block_tests/replay_block_test.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/host/tests/rfnoc_block_tests/replay_block_test.cpp b/host/tests/rfnoc_block_tests/replay_block_test.cpp index 11c621b5a..94f1ce882 100644 --- a/host/tests/rfnoc_block_tests/replay_block_test.cpp +++ b/host/tests/rfnoc_block_tests/replay_block_test.cpp @@ -749,8 +749,6 @@ BOOST_FIXTURE_TEST_CASE(replay_test_graph, replay_block_fixture) node_accessor.init_props(&mock_ddc_block); mock_sink_term.set_edge_property<std::string>( "type", "sc16", {res_source_info::INPUT_EDGE, 0}); - mock_sink_term.set_edge_property<std::string>( - "type", "sc16", {res_source_info::INPUT_EDGE, 1}); UHD_LOG_INFO("TEST", "Creating graph..."); graph.connect(&mock_radio_block, &mock_ddc_block, edge_port_info); @@ -758,7 +756,22 @@ BOOST_FIXTURE_TEST_CASE(replay_test_graph, replay_block_fixture) graph.connect(test_replay.get(), &mock_sink_term, edge_port_info); UHD_LOG_INFO("TEST", "Committing graph..."); graph.commit(); + mock_sink_term.set_edge_property<double>( + "tick_rate", 1.0, {res_source_info::INPUT_EDGE, 0}); UHD_LOG_INFO("TEST", "Commit complete."); + + mock_radio_block.generate_overrun(0); + uhd::rx_metadata_t rx_md; + BOOST_REQUIRE(test_replay->get_record_async_metadata(rx_md, 1.0)); + BOOST_CHECK(rx_md.error_code == uhd::rx_metadata_t::ERROR_CODE_OVERFLOW); + + mock_sink_term.post_action(res_source_info{res_source_info::INPUT_EDGE, 0}, + tx_event_action_info::make(uhd::async_metadata_t::EVENT_CODE_UNDERFLOW, 1234ul)); + uhd::async_metadata_t tx_md; + BOOST_REQUIRE(test_replay->get_play_async_metadata(tx_md, 1.0)); + BOOST_CHECK(tx_md.event_code == uhd::async_metadata_t::EVENT_CODE_UNDERFLOW); + BOOST_CHECK(tx_md.has_time_spec); + BOOST_CHECK(tx_md.time_spec == 1234.0); } /* |