summaryrefslogtreecommitdiffstats
path: root/host/test/addr_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/test/addr_test.cpp')
-rw-r--r--host/test/addr_test.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/host/test/addr_test.cpp b/host/test/addr_test.cpp
index 93b7cc0df..0c50200d6 100644
--- a/host/test/addr_test.cpp
+++ b/host/test/addr_test.cpp
@@ -18,6 +18,7 @@
#include <boost/test/unit_test.hpp>
#include <uhd/types/mac_addr.hpp>
#include <uhd/types/device_addr.hpp>
+#include <uhd/usrp/dboard_id.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/foreach.hpp>
#include <algorithm>
@@ -41,8 +42,8 @@ BOOST_AUTO_TEST_CASE(test_device_addr){
dev_addr["key2"] = "val2";
//convert to and from args string
- std::cout << "Pretty Print: " << std::endl << dev_addr.to_string();
- std::string args_str = dev_addr.to_args_str();
+ std::cout << "Pretty Print: " << std::endl << dev_addr.to_pp_string();
+ std::string args_str = dev_addr.to_string();
std::cout << "Args String: " << args_str << std::endl;
uhd::device_addr_t new_dev_addr(args_str);
@@ -65,3 +66,15 @@ BOOST_AUTO_TEST_CASE(test_device_addr){
new_dev_addr_vals.begin(), new_dev_addr_vals.end()
);
}
+
+BOOST_AUTO_TEST_CASE(test_dboard_id){
+ std::cout << "Testing dboard id..." << std::endl;
+
+ using namespace uhd::usrp;
+
+ BOOST_CHECK(dboard_id_t() == dboard_id_t::none());
+ BOOST_CHECK_EQUAL(dboard_id_t().to_uint16(), dboard_id_t::none().to_uint16());
+ BOOST_CHECK_EQUAL(dboard_id_t::from_string("0x1234").to_uint16(), 0x1234);
+ BOOST_CHECK_EQUAL(dboard_id_t::from_string("1234").to_uint16(), 1234);
+ std::cout << "Pretty Print: " << std::endl << dboard_id_t::none().to_pp_string();
+}