diff options
author | Josh Blum <josh@joshknows.com> | 2011-06-15 14:50:02 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-06-15 14:50:02 -0700 |
commit | 0cef788d3d34a298c975e32c488e800a5c65ccce (patch) | |
tree | 14b7f4242a28927b1701a73a3e8ec0df3fa04811 /host/tests/convert_test.cpp | |
parent | 7951170c6161d9266726ec19e8c009500cf11f75 (diff) | |
parent | 27f1622d439ceb787e7dada733d0eb82270c5532 (diff) | |
download | uhd-0cef788d3d34a298c975e32c488e800a5c65ccce.tar.gz uhd-0cef788d3d34a298c975e32c488e800a5c65ccce.tar.bz2 uhd-0cef788d3d34a298c975e32c488e800a5c65ccce.zip |
Merge branch 'next'
Diffstat (limited to 'host/tests/convert_test.cpp')
-rw-r--r-- | host/tests/convert_test.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/host/tests/convert_test.cpp b/host/tests/convert_test.cpp index d1c2b7625..d828ed64a 100644 --- a/host/tests/convert_test.cpp +++ b/host/tests/convert_test.cpp @@ -31,7 +31,7 @@ typedef std::complex<boost::int16_t> sc16_t; typedef std::complex<float> fc32_t; typedef std::complex<double> fc64_t; -#define MY_CHECK_CLOSE(a, b, f) if ((std::abs(a) > (f) and std::abs(b) > (f))) \ +#define MY_CHECK_CLOSE(a, b, f) if ((std::abs(a) > (f))) \ BOOST_CHECK_CLOSE_FRACTION(a, b, f) /*********************************************************************** @@ -55,12 +55,12 @@ template <typename Range> static void loopback( //convert to intermediate type convert::get_converter_cpu_to_otw( io_type, otw_type, input0.size(), output0.size() - )(input0, output0, nsamps); + )(input0, output0, nsamps, 32767.); //convert back to host type convert::get_converter_otw_to_cpu( io_type, otw_type, input1.size(), output1.size() - )(input1, output1, nsamps); + )(input1, output1, nsamps, 1/32767.); } /*********************************************************************** @@ -207,12 +207,12 @@ BOOST_AUTO_TEST_CASE(test_convert_types_fc32_to_sc16){ //convert float to intermediate convert::get_converter_cpu_to_otw( io_type_in, otw_type, input0.size(), output0.size() - )(input0, output0, nsamps); + )(input0, output0, nsamps, 32767.); //convert intermediate to short convert::get_converter_otw_to_cpu( io_type_out, otw_type, input1.size(), output1.size() - )(input1, output1, nsamps); + )(input1, output1, nsamps, 1/32767.); //test that the inputs and outputs match for (size_t i = 0; i < nsamps; i++){ @@ -247,12 +247,12 @@ BOOST_AUTO_TEST_CASE(test_convert_types_sc16_to_fc32){ //convert short to intermediate convert::get_converter_cpu_to_otw( io_type_in, otw_type, input0.size(), output0.size() - )(input0, output0, nsamps); + )(input0, output0, nsamps, 32767.); //convert intermediate to float convert::get_converter_otw_to_cpu( io_type_out, otw_type, input1.size(), output1.size() - )(input1, output1, nsamps); + )(input1, output1, nsamps, 1/32767.); //test that the inputs and outputs match for (size_t i = 0; i < nsamps; i++){ |