diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-07-23 10:13:38 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:32 -0800 |
commit | 83abb81e61beec213f9f83843d6fab637a578f4a (patch) | |
tree | c3b95387f4251138f9374cd49b834b04ee10e408 /host/tests | |
parent | 053306f2934e6ac61f03783c36eeff6b2c5ffe0f (diff) | |
download | uhd-83abb81e61beec213f9f83843d6fab637a578f4a.tar.gz uhd-83abb81e61beec213f9f83843d6fab637a578f4a.tar.bz2 uhd-83abb81e61beec213f9f83843d6fab637a578f4a.zip |
rfnoc: actions: Allow sending actions to self
Sending actions to self is useful because calling post_action() from
within an action handler will not actually trigger the action. Instead,
it will defer delivery of the action. Allowing sending actions to self
will allow to add another action, in deterministic order, and the
execution of another action handler.
Diffstat (limited to 'host/tests')
-rw-r--r-- | host/tests/actions_test.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/host/tests/actions_test.cpp b/host/tests/actions_test.cpp index 2f9d9a702..20e2bdf6e 100644 --- a/host/tests/actions_test.cpp +++ b/host/tests/actions_test.cpp @@ -43,11 +43,14 @@ BOOST_AUTO_TEST_CASE(test_actions_single_node) mock_radio.update_fwd_policy(node_t::forwarding_policy_t::ONE_TO_ALL_OUT); node_accessor.send_action(&mock_radio, {res_source_info::INPUT_EDGE, 0}, other_cmd); + uhd::rfnoc::detail::graph_t graph{}; + graph.connect(&mock_radio, &mock_radio, {0, 0, graph_edge_t::DYNAMIC, false}); + graph.commit(); stream_cmd = stream_cmd_action_info::make(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE); stream_cmd->stream_cmd.num_samps = 37; - node_accessor.send_action(&mock_radio, {res_source_info::USER, 0}, stream_cmd); - BOOST_CHECK_EQUAL(mock_radio.last_num_samps, 37); + node_accessor.post_action(&mock_radio, {res_source_info::USER, 0}, stream_cmd); + BOOST_REQUIRE_EQUAL(mock_radio.last_num_samps, 37); } BOOST_AUTO_TEST_CASE(test_actions_simple_graph) |