aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2021-07-13 12:28:11 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2021-07-20 07:20:47 -0500
commit0dc4d06450f9a39c780fc91ffb73317d606c5098 (patch)
tree1e1fe1eac8fb93408dc81423e01a6eb283ba9abd /host/tests
parent4e2d3a0aba20e99e6da41759212b2e2865c5c616 (diff)
downloaduhd-0dc4d06450f9a39c780fc91ffb73317d606c5098.tar.gz
uhd-0dc4d06450f9a39c780fc91ffb73317d606c5098.tar.bz2
uhd-0dc4d06450f9a39c780fc91ffb73317d606c5098.zip
rfnoc: allow find_blocks to search by device number or block count.
In current implementation it is not possible to find all blocks of a device by calling find_blocks("0/"). The same is true for the block count. This is caused by the valid block id regex which requires a block name. This regex is used to validate the block name as well as to match block ids in search. This fix looses the requirement for the block name to allow searches by device number and block count and also extends the is_valid_block_id method to require the block name match to be non empty (which restores the previous behaviour at this point).
Diffstat (limited to 'host/tests')
-rw-r--r--host/tests/block_id_test.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/host/tests/block_id_test.cpp b/host/tests/block_id_test.cpp
index 11c9d7123..cf819300a 100644
--- a/host/tests/block_id_test.cpp
+++ b/host/tests/block_id_test.cpp
@@ -29,6 +29,7 @@ BOOST_AUTO_TEST_CASE(test_block_id)
BOOST_CHECK(block_id_t::is_valid_block_id("0/Filter_Foo#1"));
BOOST_CHECK(not block_id_t::is_valid_block_id("x/FilterFoo#1"));
BOOST_CHECK(not block_id_t::is_valid_block_id("0/FilterFoo#x"));
+ BOOST_CHECK(not block_id_t::is_valid_block_id("0/#1"));
BOOST_REQUIRE_THROW(block_id_t invalid_block_id("0Filter/1"), uhd::value_error);