diff options
author | Josh Blum <josh@joshknows.com> | 2011-01-05 12:17:06 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-01-05 12:17:06 -0800 |
commit | 283067dea28c2082b71793706f582ce96e667370 (patch) | |
tree | 2e728f479a2c64e4afc91ec264bd5d8822efb057 /host/test/gain_group_test.cpp | |
parent | 03f4ce0fb260b8ebf7982a896fbd2ce8ab4c9c5a (diff) | |
download | uhd-283067dea28c2082b71793706f582ce96e667370.tar.gz uhd-283067dea28c2082b71793706f582ce96e667370.tar.bz2 uhd-283067dea28c2082b71793706f582ce96e667370.zip |
uhd: replaced templated ranges with one range thing using doubles only to avoid trouble with compiler portability
Diffstat (limited to 'host/test/gain_group_test.cpp')
-rw-r--r-- | host/test/gain_group_test.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/host/test/gain_group_test.cpp b/host/test/gain_group_test.cpp index dbb585987..79487b2ba 100644 --- a/host/test/gain_group_test.cpp +++ b/host/test/gain_group_test.cpp @@ -52,7 +52,7 @@ class gain_element2{ public: gain_range_t get_range(void){ - return gain_range_t(-20, 10, float(0.1)); + return gain_range_t(-20, 10, 0.1); } float get_value(void){ @@ -94,17 +94,17 @@ static gain_group::sptr get_gain_group(size_t pri1 = 0, size_t pri2 = 0){ /*********************************************************************** * Test cases **********************************************************************/ -static const float tolerance = float(0.001); +static const double tolerance = 0.001; BOOST_AUTO_TEST_CASE(test_gain_group_overall){ gain_group::sptr gg = get_gain_group(); //test the overall stuff gg->set_value(80); - BOOST_CHECK_CLOSE(gg->get_value(), float(80), 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_CHECK_CLOSE(gg->get_value(), 80, tolerance); + BOOST_CHECK_CLOSE(gg->get_range().start(), -20, tolerance); + BOOST_CHECK_CLOSE(gg->get_range().stop(), 100, tolerance); + BOOST_CHECK_CLOSE(gg->get_range().step(), 0.1, tolerance); } BOOST_AUTO_TEST_CASE(test_gain_group_priority){ @@ -112,10 +112,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().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_CHECK_CLOSE(gg->get_value(), 80, tolerance); + BOOST_CHECK_CLOSE(gg->get_range().start(), -20, tolerance); + BOOST_CHECK_CLOSE(gg->get_range().stop(), 100, tolerance); + BOOST_CHECK_CLOSE(gg->get_range().step(), 0.1, tolerance); //test the the higher priority gain got filled first (gain 2) BOOST_CHECK_CLOSE(g2.get_value(), g2.get_range().stop(), tolerance); |