aboutsummaryrefslogtreecommitdiffstats
path: root/host/test/tune_helper_test.cpp
diff options
context:
space:
mode:
authorPhilip Balister <philip@opensdr.com>2010-10-21 14:17:47 -0400
committerPhilip Balister <philip@opensdr.com>2010-10-21 14:17:47 -0400
commitc31c2d7ef8e4e02854fe51a8a3b8856649464918 (patch)
treed338268cbdecf21c78a2c77e6e7f95e6f669c4ee /host/test/tune_helper_test.cpp
parent3dc06cddaf0a0cf32f76be7077d1427ff4b71a7e (diff)
parent090b0dd0d38f23cd1d7c4c6a7b0317a6fdfe2b9b (diff)
downloaduhd-c31c2d7ef8e4e02854fe51a8a3b8856649464918.tar.gz
uhd-c31c2d7ef8e4e02854fe51a8a3b8856649464918.tar.bz2
uhd-c31c2d7ef8e4e02854fe51a8a3b8856649464918.zip
Merge branch 'usrp_e' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/test/tune_helper_test.cpp')
-rw-r--r--host/test/tune_helper_test.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/host/test/tune_helper_test.cpp b/host/test/tune_helper_test.cpp
index 570f47293..1ef4af330 100644
--- a/host/test/tune_helper_test.cpp
+++ b/host/test/tune_helper_test.cpp
@@ -99,7 +99,8 @@ public:
/* NOP */
}
private:
- void get(const wax::obj &key, wax::obj &val){
+ void get(const wax::obj &key_, wax::obj &val){
+ named_prop_t key = named_prop_t::extract(key_);
switch(key.as<dsp_prop_t>()){
case DSP_PROP_CODEC_RATE:
val = _codec_rate;
@@ -109,11 +110,16 @@ private:
val = _freq_shift;
return;
+ case DSP_PROP_FREQ_SHIFT_NAMES:
+ val = prop_names_t(1, "");
+ return;
+
default: UHD_THROW_PROP_GET_ERROR();
}
}
- void set(const wax::obj &key, const wax::obj &val){
+ void set(const wax::obj &key_, const wax::obj &val){
+ named_prop_t key = named_prop_t::extract(key_);
switch(key.as<dsp_prop_t>()){
case DSP_PROP_FREQ_SHIFT:
_freq_shift = val.as<double>();
@@ -136,12 +142,12 @@ BOOST_AUTO_TEST_CASE(test_tune_helper_rx){
dummy_dsp dsp(100e6);
std::cout << "Testing tune helper RX automatic LO offset" << std::endl;
- tune_result_t tr = tune_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 2.3451e9);
+ tune_result_t tr = tune_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 0, 2.3451e9);
std::cout << tr.to_pp_string() << std::endl;
BOOST_CHECK_CLOSE(tr.actual_inter_freq, 2.345e9, tolerance);
BOOST_CHECK_CLOSE(tr.actual_dsp_freq, -100e3, tolerance);
- double freq_derived = derive_freq_from_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link());
+ double freq_derived = derive_freq_from_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 0);
BOOST_CHECK_CLOSE(freq_derived, 2.3451e9, tolerance);
}
@@ -150,12 +156,12 @@ BOOST_AUTO_TEST_CASE(test_tune_helper_tx){
dummy_dsp dsp(100e6);
std::cout << "Testing tune helper TX automatic LO offset" << std::endl;
- tune_result_t tr = tune_tx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 2.3451e9);
+ tune_result_t tr = tune_tx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 0, 2.3451e9);
std::cout << tr.to_pp_string() << std::endl;
BOOST_CHECK_CLOSE(tr.actual_inter_freq, 2.345e9, tolerance);
BOOST_CHECK_CLOSE(tr.actual_dsp_freq, 100e3, tolerance);
- double freq_derived = derive_freq_from_tx_subdev_and_dsp(subdev.get_link(), dsp.get_link());
+ double freq_derived = derive_freq_from_tx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 0);
BOOST_CHECK_CLOSE(freq_derived, 2.3451e9, tolerance);
}
@@ -164,11 +170,11 @@ BOOST_AUTO_TEST_CASE(test_tune_helper_rx_nyquist){
dummy_dsp dsp(100e6);
std::cout << "Testing tune helper RX dummy basic board" << std::endl;
- tune_result_t tr = tune_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 55e6);
+ tune_result_t tr = tune_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 0, 55e6);
std::cout << tr.to_pp_string() << std::endl;
BOOST_CHECK_CLOSE(tr.actual_inter_freq, 0.0, tolerance);
BOOST_CHECK_CLOSE(tr.actual_dsp_freq, 45e6, tolerance);
- double freq_derived = derive_freq_from_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link());
+ double freq_derived = derive_freq_from_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 0);
BOOST_CHECK_CLOSE(freq_derived, -45e6, tolerance);
}