aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-06-07 21:37:15 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:27 -0800
commit6bd43946a71173cbf0f1d318843ba34d6849dc30 (patch)
tree35e0b46fc8e399718d6adafcda0929c86e0035ad /host/tests
parent491a74269e7d7d7589119c22f229c994d8a2c3f8 (diff)
downloaduhd-6bd43946a71173cbf0f1d318843ba34d6849dc30.tar.gz
uhd-6bd43946a71173cbf0f1d318843ba34d6849dc30.tar.bz2
uhd-6bd43946a71173cbf0f1d318843ba34d6849dc30.zip
rfnoc: Add shutdown feature to blocks
On destruction, the rfnoc_graph will call shutdown() on all blocks. This allows a safe de-initialization of blocks independent of the lifetime of the noc_block_base::sptr. Also adds the shutdown feature to null_block_control.
Diffstat (limited to 'host/tests')
-rw-r--r--host/tests/CMakeLists.txt1
-rw-r--r--host/tests/rfnoc_blocks_test.cpp6
2 files changed, 7 insertions, 0 deletions
diff --git a/host/tests/CMakeLists.txt b/host/tests/CMakeLists.txt
index df891b7e2..d6ad6d777 100644
--- a/host/tests/CMakeLists.txt
+++ b/host/tests/CMakeLists.txt
@@ -252,6 +252,7 @@ UHD_ADD_NONAPI_TEST(
${CMAKE_SOURCE_DIR}/lib/rfnoc/ddc_block_control.cpp
${CMAKE_SOURCE_DIR}/lib/rfnoc/null_block_control.cpp
${CMAKE_SOURCE_DIR}/lib/rfnoc/radio_control_impl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/rfnoc/register_iface_holder.cpp
${CMAKE_SOURCE_DIR}/lib/usrp/cores/dsp_core_utils.cpp
)
diff --git a/host/tests/rfnoc_blocks_test.cpp b/host/tests/rfnoc_blocks_test.cpp
index 1832fc6ae..b69b6f9f8 100644
--- a/host/tests/rfnoc_blocks_test.cpp
+++ b/host/tests/rfnoc_blocks_test.cpp
@@ -125,6 +125,12 @@ BOOST_AUTO_TEST_CASE(test_null_block)
stream_cmd.stream_mode = stream_cmd_t::STREAM_MODE_START_CONTINUOUS;
test_null->issue_stream_cmd(stream_cmd);
BOOST_CHECK_EQUAL(get_mem(null_block_control::REG_CTRL_STATUS) & 0x2, 0x2);
+ node_accessor.shutdown(test_null.get());
+ BOOST_CHECK_EQUAL(get_mem(null_block_control::REG_CTRL_STATUS) & 0x2, 0x0);
+ test_null->issue_stream_cmd(stream_cmd);
+ UHD_LOG_INFO("TEST", "Expected error message here ^^^");
+ // The last issue_stream_cmd should do nothing b/c we called shutdown
+ BOOST_CHECK_EQUAL(get_mem(null_block_control::REG_CTRL_STATUS) & 0x2, 0x0);
}
BOOST_AUTO_TEST_CASE(test_ddc_block)