diff options
author | Josh Blum <josh@joshknows.com> | 2010-05-03 10:47:27 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-05-03 10:47:27 -0700 |
commit | 48c636ec9d9287303bf5a223b2dd600545933237 (patch) | |
tree | 0ec0fb0d630528b52fdc4a2cf72969a4defbe8f5 /host/test/addr_test.cpp | |
parent | 22b964a70a456c2fe9e3262668fd7e026e85b1a1 (diff) | |
parent | 4d5df2376b204afb724684d0d864ce0d93fe83fb (diff) | |
download | uhd-48c636ec9d9287303bf5a223b2dd600545933237.tar.gz uhd-48c636ec9d9287303bf5a223b2dd600545933237.tar.bz2 uhd-48c636ec9d9287303bf5a223b2dd600545933237.zip |
Merge branch 'work' of git@ettus.sourcerepo.com:ettus/uhdpriv
Diffstat (limited to 'host/test/addr_test.cpp')
-rw-r--r-- | host/test/addr_test.cpp | 17 |
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(); +} |