summaryrefslogtreecommitdiff
path: root/gr-analog/python
diff options
context:
space:
mode:
authorNicolas Cuervo <cuervonicolas@gmail.com>2019-11-11 21:52:33 +0100
committerMartin Braun <martin.braun@ettus.com>2020-01-02 12:55:48 -0800
commit28347befb47407d4dae9f4df32ccb1887cf24d67 (patch)
tree0197d9bfcecd7eaaba155f488d330797c710625a /gr-analog/python
parent8cf6939a00513a239db59489ae6cfac52f500ede (diff)
analog: fix test for byte signal source
Diffstat (limited to 'gr-analog/python')
-rw-r--r--gr-analog/python/analog/qa_sig_source.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gr-analog/python/analog/qa_sig_source.py b/gr-analog/python/analog/qa_sig_source.py
index 0f14ae46c8..b5acf750c2 100644
--- a/gr-analog/python/analog/qa_sig_source.py
+++ b/gr-analog/python/analog/qa_sig_source.py
@@ -69,7 +69,7 @@ class test_sig_source(gr_unittest.TestCase):
tb.run()
dst_data = dst1.data()
self.assertEqual(expected_result, dst_data)
-
+
def test_sine_f(self):
tb = self.tb
sqrt2 = math.sqrt(2) / 2
@@ -97,7 +97,9 @@ class test_sig_source(gr_unittest.TestCase):
tb.connect(op, dst1)
tb.run()
dst_data = dst1.data()
- self.assertFloatTuplesAlmostEqual(expected_result, dst_data)
+ # Let the python know we are dealing with signed int behind scenes
+ dst_data_signed = [b if b < 127 else (256 - b) * -1 for b in dst_data]
+ self.assertFloatTuplesAlmostEqual(expected_result, dst_data_signed)
def test_cosine_f(self):
tb = self.tb