aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/block_id_test.cpp
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2021-07-13 11:34:53 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2021-07-14 16:19:36 -0500
commit16137f1dd5390a2321b5597c3a820dee45c10526 (patch)
tree6ed5a1d07f0dc8708d02039ae50d1dd755ffbdf7 /host/tests/block_id_test.cpp
parentf47df4d1a83289043ef40469141aaa03d0c60d35 (diff)
downloaduhd-16137f1dd5390a2321b5597c3a820dee45c10526.tar.gz
uhd-16137f1dd5390a2321b5597c3a820dee45c10526.tar.bz2
uhd-16137f1dd5390a2321b5597c3a820dee45c10526.zip
rfnoc: fix block id check to allow underscore
We allow underscore in RFNoC's block names but the regular expressions only allowed the underscore in the block name RE. This fix adds the underscore to the block id RE as well as adapts the unit tests accordingly.
Diffstat (limited to 'host/tests/block_id_test.cpp')
-rw-r--r--host/tests/block_id_test.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/host/tests/block_id_test.cpp b/host/tests/block_id_test.cpp
index fb11daf1f..11c9d7123 100644
--- a/host/tests/block_id_test.cpp
+++ b/host/tests/block_id_test.cpp
@@ -23,6 +23,13 @@ BOOST_AUTO_TEST_CASE(test_block_id)
BOOST_CHECK(not block_id_t::is_valid_blockname("0Filter/Foo"));
BOOST_CHECK(not block_id_t::is_valid_blockname("0/Filter/Foo"));
+ BOOST_CHECK(block_id_t::is_valid_block_id("0/FilterFoo#1"));
+ BOOST_CHECK(block_id_t::is_valid_block_id("0/FilterFoo"));
+ BOOST_CHECK(block_id_t::is_valid_block_id("FilterFoo#1"));
+ 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_REQUIRE_THROW(block_id_t invalid_block_id("0Filter/1"), uhd::value_error);
block_id_t block_id("0/FFT#1");