summaryrefslogtreecommitdiff
path: root/gr-digital/python
diff options
context:
space:
mode:
authorfengzhe29888 <fengzhe29888@gmail.com>2015-04-01 03:34:19 -0400
committerfengzhe29888 <fengzhe29888@gmail.com>2015-04-01 03:34:19 -0400
commitcc13ec5be58e1d18211649ddab98ca21d8c2ba3d (patch)
tree1d3e3ac48c2d11b4a3545895859cbe58cf906c3e /gr-digital/python
parent6168622dd0edfded121c031259ca062eab41b1c7 (diff)
digital: bug fixed in chunks_to_symbols that the callback functiion set_symbol_table didn't work with additonal qa_tests
Diffstat (limited to 'gr-digital/python')
-rwxr-xr-xgr-digital/python/digital/qa_chunks_to_symbols.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/gr-digital/python/digital/qa_chunks_to_symbols.py b/gr-digital/python/digital/qa_chunks_to_symbols.py
index d6a9566807..0d80f71d6c 100755
--- a/gr-digital/python/digital/qa_chunks_to_symbols.py
+++ b/gr-digital/python/digital/qa_chunks_to_symbols.py
@@ -136,6 +136,39 @@ class test_chunks_to_symbols(gr_unittest.TestCase):
actual_result = dst.data()
self.assertEqual(expected_result, actual_result)
+
+ def test_sf_callback(self):
+ constA = [-3, -1, 1, 3]
+ constB = [12, -12, 6, -6]
+ src_data = (0, 1, 2, 3, 3, 2, 1, 0)
+ expected_result=(12, -12, 6, -6, -6, 6, -12, 12)
+
+ src = blocks.vector_source_s(src_data, False, 1, "")
+ op = digital.chunks_to_symbols_sf(constA)
+ op.set_symbol_table(constB)
+ dst = blocks.vector_sink_f()
+ self.tb.connect(src, op)
+ self.tb.connect(op, dst)
+ self.tb.run()
+ actual_result = dst.data()
+ self.assertEqual(expected_result, actual_result)
+
+ def test_sc_callback(self):
+ constA = [-3.0+1j, -1.0-1j, 1.0+1j, 3-1j]
+ constB = [12.0+1j, -12.0-1j, 6.0+1j, -6-1j]
+ src_data = (0, 1, 2, 3, 3, 2, 1, 0)
+ expected_result=(12.0+1j, -12.0-1j, 6.0+1j, -6-1j, -6-1j, 6+1j, -12-1j, 12+1j)
+
+ src = blocks.vector_source_s(src_data, False, 1, "")
+ op = digital.chunks_to_symbols_sc(constA)
+ op.set_symbol_table(constB)
+ dst = blocks.vector_sink_c()
+ self.tb.connect(src, op)
+ self.tb.connect(op, dst)
+ self.tb.run()
+ actual_result = dst.data()
+ self.assertEqual(expected_result, actual_result)
+
def test_sf_tag(self):
constA = [-3.0, -1.0, 1.0, 3]
constB = [12.0, -12.0, 6.0, -6]