diff options
Diffstat (limited to 'host/test/gain_handler_test.cpp')
-rw-r--r-- | host/test/gain_handler_test.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/host/test/gain_handler_test.cpp b/host/test/gain_handler_test.cpp index 47acb30f0..76b065ce2 100644 --- a/host/test/gain_handler_test.cpp +++ b/host/test/gain_handler_test.cpp @@ -16,10 +16,10 @@ // #include <boost/test/unit_test.hpp> -#include <uhd/gain_handler.hpp> -#include <uhd/types.hpp> +#include <uhd/utils/gain_handler.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> @@ -46,8 +46,8 @@ public: ); _gain_values["g0"] = 0; _gain_values["g1"] = 0; - _gain_ranges["g0"] = gain_range_t(-10, 0, .1); - _gain_ranges["g1"] = gain_range_t(0, 100, 1.5); + _gain_ranges["g0"] = gain_range_t(-10, 0, float(.1)); + _gain_ranges["g1"] = gain_range_t(0, 100, float(1.5)); } ~gainful_obj(void){} @@ -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)); } |