summaryrefslogtreecommitdiffstats
path: root/host/tests/convert_test.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-11-14 22:20:23 -0800
committerJosh Blum <josh@joshknows.com>2011-11-14 22:20:23 -0800
commit5efb340050f457d7743a80b350c366b27c05fd61 (patch)
treeb22a5697e853fd369ff999e2c74fb6f7d937aa14 /host/tests/convert_test.cpp
parent3738641290f6cbff8fae2c2a4d10ba48469c17eb (diff)
parentaed619727e47bf2353164ac1788a6e3479b2fe16 (diff)
downloaduhd-5efb340050f457d7743a80b350c366b27c05fd61.tar.gz
uhd-5efb340050f457d7743a80b350c366b27c05fd61.tar.bz2
uhd-5efb340050f457d7743a80b350c366b27c05fd61.zip
Merge branch 'convert_work'
Diffstat (limited to 'host/tests/convert_test.cpp')
-rw-r--r--host/tests/convert_test.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/host/tests/convert_test.cpp b/host/tests/convert_test.cpp
index b63ff6752..1a5d30080 100644
--- a/host/tests/convert_test.cpp
+++ b/host/tests/convert_test.cpp
@@ -53,10 +53,14 @@ template <typename Range> static void loopback(
std::vector<void *> output0(1, &interm[0]), output1(1, &output[0]);
//convert to intermediate type
- convert::get_converter(in_id)(input0, output0, nsamps, 32767.);
+ convert::converter::sptr c0 = convert::get_converter(in_id)();
+ c0->set_scalar(32767.);
+ c0->conv(input0, output0, nsamps);
//convert back to host type
- convert::get_converter(out_id)(input1, output1, nsamps, 1/32767.);
+ convert::converter::sptr c1 = convert::get_converter(out_id)();
+ c1->set_scalar(1/32767.);
+ c1->conv(input1, output1, nsamps);
}
/***********************************************************************
@@ -216,10 +220,14 @@ BOOST_AUTO_TEST_CASE(test_convert_types_fc32_to_sc16){
std::vector<void *> output0(1, &interm[0]), output1(1, &output[0]);
//convert float to intermediate
- convert::get_converter(in_id)(input0, output0, nsamps, 32767.);
+ convert::converter::sptr c0 = convert::get_converter(in_id)();
+ c0->set_scalar(32767.);
+ c0->conv(input0, output0, nsamps);
//convert intermediate to short
- convert::get_converter(out_id)(input1, output1, nsamps, 1/32767.);
+ convert::converter::sptr c1 = convert::get_converter(out_id)();
+ c1->set_scalar(1/32767.);
+ c1->conv(input1, output1, nsamps);
//test that the inputs and outputs match
for (size_t i = 0; i < nsamps; i++){
@@ -257,10 +265,14 @@ BOOST_AUTO_TEST_CASE(test_convert_types_sc16_to_fc32){
std::vector<void *> output0(1, &interm[0]), output1(1, &output[0]);
//convert short to intermediate
- convert::get_converter(in_id)(input0, output0, nsamps, 32767.);
+ convert::converter::sptr c0 = convert::get_converter(in_id)();
+ c0->set_scalar(32767.);
+ c0->conv(input0, output0, nsamps);
//convert intermediate to float
- convert::get_converter(out_id)(input1, output1, nsamps, 1/32767.);
+ convert::converter::sptr c1 = convert::get_converter(out_id)();
+ c1->set_scalar(1/32767.);
+ c1->conv(input1, output1, nsamps);
//test that the inputs and outputs match
for (size_t i = 0; i < nsamps; i++){