diff options
Diffstat (limited to 'host/test')
-rw-r--r-- | host/test/addr_test.cpp | 5 | ||||
-rw-r--r-- | host/test/gain_handler_test.cpp | 22 |
2 files changed, 14 insertions, 13 deletions
diff --git a/host/test/addr_test.cpp b/host/test/addr_test.cpp index 148aee015..0c8f63b0a 100644 --- a/host/test/addr_test.cpp +++ b/host/test/addr_test.cpp @@ -16,13 +16,14 @@ // #include <boost/test/unit_test.hpp> -#include <uhd/device_addr.hpp> +#include <uhd/types/mac_addr.hpp> +#include <iostream> BOOST_AUTO_TEST_CASE(test_mac_addr){ std::cout << "Testing mac addr..." << std::endl; const std::string mac_addr_str("00:01:23:45:67:89"); uhd::mac_addr_t mac_addr(mac_addr_str); std::cout << "Input: " << mac_addr_str << std::endl; - std::cout << "Output: " << mac_addr << std::endl; + std::cout << "Output: " << mac_addr.to_string() << std::endl; BOOST_CHECK_EQUAL(mac_addr_str, mac_addr.to_string()); } diff --git a/host/test/gain_handler_test.cpp b/host/test/gain_handler_test.cpp index 47acb30f0..e13063e06 100644 --- a/host/test/gain_handler_test.cpp +++ b/host/test/gain_handler_test.cpp @@ -17,9 +17,9 @@ #include <boost/test/unit_test.hpp> #include <uhd/gain_handler.hpp> -#include <uhd/types.hpp> +#include <uhd/types/ranges.hpp> +#include <uhd/types/dict.hpp> #include <uhd/props.hpp> -#include <uhd/dict.hpp> #include <boost/bind.hpp> #include <iostream> @@ -84,7 +84,7 @@ private: //handle the get request conditioned on the key switch(key.as<prop_t>()){ case PROP_GAIN_VALUE: - _gain_values[name] = val.as<gain_t>(); + _gain_values[name] = val.as<float>(); return; case PROP_GAIN_RANGE: @@ -94,7 +94,7 @@ private: } gain_handler::sptr _gain_handler; - uhd::dict<std::string, gain_t> _gain_values; + uhd::dict<std::string, float> _gain_values; uhd::dict<std::string, gain_range_t> _gain_ranges; }; @@ -104,18 +104,18 @@ BOOST_AUTO_TEST_CASE(test_gain_handler){ gainful_obj go0; BOOST_CHECK_THROW( - go0[named_prop_t(PROP_GAIN_VALUE, "fail")].as<gain_t>(), + go0[named_prop_t(PROP_GAIN_VALUE, "fail")].as<float>(), std::exception ); std::cout << "verifying the overall min, max, step" << std::endl; gain_range_t gain = go0[PROP_GAIN_RANGE].as<gain_range_t>(); - BOOST_CHECK_EQUAL(gain.min, gain_t(-10)); - BOOST_CHECK_EQUAL(gain.max, gain_t(100)); - BOOST_CHECK_EQUAL(gain.step, gain_t(1.5)); + BOOST_CHECK_EQUAL(gain.min, float(-10)); + BOOST_CHECK_EQUAL(gain.max, float(100)); + BOOST_CHECK_EQUAL(gain.step, float(1.5)); std::cout << "verifying the overall gain" << std::endl; - go0[named_prop_t(PROP_GAIN_VALUE, "g0")] = gain_t(-5); - go0[named_prop_t(PROP_GAIN_VALUE, "g1")] = gain_t(30); - BOOST_CHECK_EQUAL(go0[PROP_GAIN_VALUE].as<gain_t>(), gain_t(25)); + go0[named_prop_t(PROP_GAIN_VALUE, "g0")] = float(-5); + go0[named_prop_t(PROP_GAIN_VALUE, "g1")] = float(30); + BOOST_CHECK_EQUAL(go0[PROP_GAIN_VALUE].as<float>(), float(25)); } |