aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-09-27 17:13:13 -0700
committerMartin Braun <martin.braun@ettus.com>2016-09-27 17:13:13 -0700
commita9c83aca8f95a408c06fbdf470f69b71514a5f46 (patch)
tree0ad7ad28f4084831f65db0e4738b788f9338ebf9 /host/tests
parentf70dd85daa8a6b9e1762c9339532027e40a67018 (diff)
parent102b03f59afdfd3bc633639a1a126bfdff57af45 (diff)
downloaduhd-a9c83aca8f95a408c06fbdf470f69b71514a5f46.tar.gz
uhd-a9c83aca8f95a408c06fbdf470f69b71514a5f46.tar.bz2
uhd-a9c83aca8f95a408c06fbdf470f69b71514a5f46.zip
Merge branch 'maint'
Diffstat (limited to 'host/tests')
-rw-r--r--host/tests/convert_test.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/host/tests/convert_test.cpp b/host/tests/convert_test.cpp
index 8d359d2e2..84e7480a6 100644
--- a/host/tests/convert_test.cpp
+++ b/host/tests/convert_test.cpp
@@ -76,8 +76,8 @@ static void test_convert_types_sc16(
//fill the input samples
std::vector<sc16_t> input(nsamps), output(nsamps);
BOOST_FOREACH(sc16_t &in, input) in = sc16_t(
- short(((std::rand()/double(RAND_MAX/2)) - 1)*32767/extra_div),
- short(((std::rand()/double(RAND_MAX/2)) - 1)*32767/extra_div)
+ short((float((std::rand())/(double(RAND_MAX)/2)) - 1)*32767/extra_div),
+ short((float((std::rand())/(double(RAND_MAX)/2)) - 1)*32767/extra_div)
);
//run the loopback and test
@@ -127,8 +127,8 @@ static void test_convert_types_for_floats(
//fill the input samples
std::vector<data_type> input(nsamps), output(nsamps);
BOOST_FOREACH(data_type &in, input) in = data_type(
- ((std::rand()/value_type(RAND_MAX/2)) - 1)*float(extra_scale),
- ((std::rand()/value_type(RAND_MAX/2)) - 1)*float(extra_scale)
+ ((std::rand()/(value_type(RAND_MAX)/2)) - 1)*float(extra_scale),
+ ((std::rand()/(value_type(RAND_MAX)/2)) - 1)*float(extra_scale)
);
//run the loopback and test