diff options
author | Josh Blum <josh@joshknows.com> | 2010-03-15 17:00:04 +0000 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-03-15 17:00:04 +0000 |
commit | 1bfb556262d12740c71e68a2a071e6e67ed2b3e7 (patch) | |
tree | a081bfd3a61ccb42372a627be7b57ce19a3baa0d /host/test/wax_test.cpp | |
parent | 1b965831ae7588c7879d84de4e5fbd78ca614761 (diff) | |
parent | fc40ff2f1327d01c72c4d7dbc07a14e473251981 (diff) | |
download | uhd-1bfb556262d12740c71e68a2a071e6e67ed2b3e7.tar.gz uhd-1bfb556262d12740c71e68a2a071e6e67ed2b3e7.tar.bz2 uhd-1bfb556262d12740c71e68a2a071e6e67ed2b3e7.zip |
Merge branch 'master' of git@ettus.sourcerepo.com:ettus/uhd into u1e_uhd
Conflicts:
host/apps/CMakeLists.txt
host/lib/usrp/usrp2/usrp2_impl.cpp
Diffstat (limited to 'host/test/wax_test.cpp')
-rw-r--r-- | host/test/wax_test.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/host/test/wax_test.cpp b/host/test/wax_test.cpp index e5e1adc25..b793b2690 100644 --- a/host/test/wax_test.cpp +++ b/host/test/wax_test.cpp @@ -17,14 +17,15 @@ #include <boost/test/unit_test.hpp> #include <uhd/wax.hpp> +#include <iostream> enum opt_a_t{OPTION_A_0, OPTION_A_1}; enum opt_b_t{OPTION_B_0, OPTION_B_1}; BOOST_AUTO_TEST_CASE(test_enums){ wax::obj opta = OPTION_A_0; - BOOST_CHECK_THROW(wax::cast<opt_b_t>(opta), wax::bad_cast); - BOOST_CHECK_EQUAL(wax::cast<opt_a_t>(opta), OPTION_A_0); + BOOST_CHECK_THROW(opta.as<opt_b_t>(), wax::bad_cast); + BOOST_CHECK_EQUAL(opta.as<opt_a_t>(), OPTION_A_0); } /*********************************************************************** @@ -48,14 +49,14 @@ public: } void get(const wax::obj &key, wax::obj &value){ if (d_subs.size() == 0){ - value = d_nums[wax::cast<size_t>(key)]; + value = d_nums[key.as<size_t>()]; }else{ - value = d_subs[wax::cast<size_t>(key)].get_link(); + value = d_subs[key.as<size_t>()].get_link(); } } void set(const wax::obj &key, const wax::obj &value){ if (d_subs.size() == 0){ - d_nums[wax::cast<size_t>(key)] = wax::cast<float>(value); + d_nums[key.as<size_t>()] = value.as<float>(); }else{ throw std::runtime_error("cant set to a wax demo with sub demos"); } @@ -81,7 +82,7 @@ BOOST_AUTO_TEST_CASE(test_set_get){ float val = i * j * k + i + j + k; //std::cout << i << " " << j << " " << k << std::endl; wd[i][j][k] = val; - BOOST_CHECK_EQUAL(val, wax::cast<float>(wd[i][j][k])); + BOOST_CHECK_EQUAL(val, wd[i][j][k].as<float>()); } } } @@ -94,5 +95,5 @@ BOOST_AUTO_TEST_CASE(test_proxy){ std::cout << "assign proxy" << std::endl; wax::obj a = p[size_t(0)]; - BOOST_CHECK_EQUAL(wax::cast<float>(a), float(5)); + BOOST_CHECK_EQUAL(a.as<float>(), float(5)); } |