summaryrefslogtreecommitdiffstats
path: root/host/test
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-01 18:56:38 -0700
committerJosh Blum <josh@joshknows.com>2010-11-10 19:29:06 -0800
commit08dfff379865656e94b31fd565a4b13b4609ea63 (patch)
tree271b37573198e2d0abcf7573c17a5953c3a2eb95 /host/test
parentb7b3e8288dcd64e47c242edbc5b009b9300615a2 (diff)
downloaduhd-08dfff379865656e94b31fd565a4b13b4609ea63.tar.gz
uhd-08dfff379865656e94b31fd565a4b13b4609ea63.tar.bz2
uhd-08dfff379865656e94b31fd565a4b13b4609ea63.zip
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)
Diffstat (limited to 'host/test')
-rw-r--r--host/test/gain_group_test.cpp18
1 files changed, 9 insertions, 9 deletions
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);
}