aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/rfnoc/constants.hpp2
-rw-r--r--host/tests/block_id_test.cpp7
2 files changed, 8 insertions, 1 deletions
diff --git a/host/include/uhd/rfnoc/constants.hpp b/host/include/uhd/rfnoc/constants.hpp
index e059a5215..68833430c 100644
--- a/host/include/uhd/rfnoc/constants.hpp
+++ b/host/include/uhd/rfnoc/constants.hpp
@@ -90,6 +90,6 @@ static const size_t MAX_NUM_PORTS = 16;
// Regular expressions
static const std::string VALID_BLOCKNAME_REGEX = "[A-Za-z][A-Za-z0-9_]*";
static const std::string VALID_BLOCKID_REGEX =
- "(?:(\\d+)(?:/))?([A-Za-z][A-Za-z0-9]*)(?:(?:#)(\\d\\d?))?";
+ "(?:(\\d+)(?:/))?([A-Za-z][A-Za-z0-9_]*)(?:(?:#)(\\d\\d?))?";
}} /* namespace uhd::rfnoc */
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");