From 28347befb47407d4dae9f4df32ccb1887cf24d67 Mon Sep 17 00:00:00 2001
From: Nicolas Cuervo <cuervonicolas@gmail.com>
Date: Mon, 11 Nov 2019 21:52:33 +0100
Subject: analog: fix test for byte signal source

---
 gr-analog/python/analog/qa_sig_source.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'gr-analog/python/analog/qa_sig_source.py')

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
-- 
cgit v1.2.3