From 08dfff379865656e94b31fd565a4b13b4609ea63 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 1 Nov 2010 18:56:38 -0700 Subject: uhd: created a meta range that is a range of ranges for gains and freqs created a templated range that that holds a start, stop, and step created a meta-range template that is a vector of ranges meta-range can calculate the overall start, stop, step or be indexed to get at components replaced instances of range.min, max, step with the functions start() stop() and step() the xcvr frequency range is now expressed in as two ranges (have to fix its clip function though) --- host/test/gain_group_test.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'host/test/gain_group_test.cpp') diff --git a/host/test/gain_group_test.cpp b/host/test/gain_group_test.cpp index 555ccaed3..dbb585987 100644 --- a/host/test/gain_group_test.cpp +++ b/host/test/gain_group_test.cpp @@ -40,7 +40,7 @@ public: } void set_value(float gain){ - float step = get_range().step; + float step = get_range().step(); _gain = step*rint(gain/step); } @@ -60,7 +60,7 @@ public: } void set_value(float gain){ - float step = get_range().step; + float step = get_range().step(); _gain = step*rint(gain/step); } @@ -102,9 +102,9 @@ BOOST_AUTO_TEST_CASE(test_gain_group_overall){ //test the overall stuff gg->set_value(80); BOOST_CHECK_CLOSE(gg->get_value(), float(80), tolerance); - BOOST_CHECK_CLOSE(gg->get_range().min, float(-20), tolerance); - BOOST_CHECK_CLOSE(gg->get_range().max, float(100), tolerance); - BOOST_CHECK_CLOSE(gg->get_range().step, float(0.1), tolerance); + BOOST_CHECK_CLOSE(gg->get_range().start(), float(-20), tolerance); + BOOST_CHECK_CLOSE(gg->get_range().stop(), float(100), tolerance); + BOOST_CHECK_CLOSE(gg->get_range().step(), float(0.1), tolerance); } BOOST_AUTO_TEST_CASE(test_gain_group_priority){ @@ -113,10 +113,10 @@ BOOST_AUTO_TEST_CASE(test_gain_group_priority){ //test the overall stuff gg->set_value(80); BOOST_CHECK_CLOSE(gg->get_value(), float(80), tolerance); - BOOST_CHECK_CLOSE(gg->get_range().min, float(-20), tolerance); - BOOST_CHECK_CLOSE(gg->get_range().max, float(100), tolerance); - BOOST_CHECK_CLOSE(gg->get_range().step, float(0.1), tolerance); + BOOST_CHECK_CLOSE(gg->get_range().start(), float(-20), tolerance); + BOOST_CHECK_CLOSE(gg->get_range().stop(), float(100), tolerance); + BOOST_CHECK_CLOSE(gg->get_range().step(), float(0.1), tolerance); //test the the higher priority gain got filled first (gain 2) - BOOST_CHECK_CLOSE(g2.get_value(), g2.get_range().max, tolerance); + BOOST_CHECK_CLOSE(g2.get_value(), g2.get_range().stop(), tolerance); } -- cgit v1.2.3