summaryrefslogtreecommitdiff
path: root/gnuradio-core
diff options
context:
space:
mode:
authorTom Rondeau2012-02-23 14:28:21 -0500
committerTom Rondeau2012-02-23 14:28:21 -0500
commite8d644872837f4cbfc05851710531b2ac5259806 (patch)
tree83c5c0165857b8152e304470f024819a74549c36 /gnuradio-core
parent5c6877db1b91ad6fafec9fce83bc7f9079493d39 (diff)
downloadgnuradio-e8d644872837f4cbfc05851710531b2ac5259806.tar.gz
gnuradio-e8d644872837f4cbfc05851710531b2ac5259806.tar.bz2
gnuradio-e8d644872837f4cbfc05851710531b2ac5259806.zip
volk: float to short conversion is consistent between archs and tail cases. Rounds to nearest number.
Diffstat (limited to 'gnuradio-core')
-rwxr-xr-xgnuradio-core/src/python/gnuradio/gr/qa_float_to_short.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_float_to_short.py b/gnuradio-core/src/python/gnuradio/gr/qa_float_to_short.py
index 926f1c08b..0d89a149c 100755
--- a/gnuradio-core/src/python/gnuradio/gr/qa_float_to_short.py
+++ b/gnuradio-core/src/python/gnuradio/gr/qa_float_to_short.py
@@ -34,10 +34,7 @@ class test_float_to_short (gr_unittest.TestCase):
def test_001(self):
src_data = (0.0, 1.1, 2.2, 3.3, 4.4, 5.5, -1.1, -2.2, -3.3, -4.4, -5.5)
- expected_result = [int(round(s)) for s in src_data]
-
- ### Volk results
- expected_result = [0, 1, 2, 3, 4, 6, -1, -2, -3, -4, -5]
+ expected_result = [0, 1, 2, 3, 4, 6, -1, -2, -3, -4, -6]
src = gr.vector_source_f(src_data)
op = gr.float_to_short()
@@ -71,7 +68,7 @@ class test_float_to_short (gr_unittest.TestCase):
scale = 2
vlen = 3
src_data = (0.0, 1.1, 2.2, 3.3, 4.4, 5.5, -1.1, -2.2, -3.3)
- expected_result = [0, 2, 4, 7, 9, 11, -2, -4, -6]
+ expected_result = [0, 2, 4, 7, 9, 11, -2, -4, -7]
src = gr.vector_source_f(src_data)
s2v = gr.stream_to_vector(gr.sizeof_float, vlen)
op = gr.float_to_short(vlen, scale)