summaryrefslogtreecommitdiff
path: root/gr-analog/python/analog/qa_sig_source.py
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2015-11-12 09:12:04 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2015-11-12 09:12:04 -0800
commit2d0b64bf031c16a8c0e41a2dd9f446baf0a88492 (patch)
tree4ee569c2f844c11c8e962ebbd3987740b9232147 /gr-analog/python/analog/qa_sig_source.py
parenta18e480c8c751247d510480f7d0fca7c73775472 (diff)
parent36231753f1621324700a7f5acf0867daec3dedf4 (diff)
Merge remote-tracking branch 'jdemel/analog-msg-port'
Diffstat (limited to 'gr-analog/python/analog/qa_sig_source.py')
-rwxr-xr-xgr-analog/python/analog/qa_sig_source.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/gr-analog/python/analog/qa_sig_source.py b/gr-analog/python/analog/qa_sig_source.py
index 5ee4f24af8..8d050fa72b 100755
--- a/gr-analog/python/analog/qa_sig_source.py
+++ b/gr-analog/python/analog/qa_sig_source.py
@@ -21,7 +21,7 @@
#
import math
-
+import pmt
from gnuradio import gr, gr_unittest, analog, blocks
class test_sig_source(gr_unittest.TestCase):
@@ -156,5 +156,19 @@ class test_sig_source(gr_unittest.TestCase):
dst_data = dst1.data()
self.assertFloatTuplesAlmostEqual(expected_result, dst_data, 5)
+ def test_freq_msg(self):
+ src = analog.sig_source_c(8, analog.GR_SIN_WAVE, 1.0, 1.0)
+ op = blocks.head(gr.sizeof_gr_complex, 9)
+ snk = blocks.vector_sink_c()
+ self.tb.connect(src, op, snk)
+ self.assertAlmostEqual(src.frequency(), 1.0)
+
+ frequency = 3.0
+ src._post(pmt.to_pmt('freq'), pmt.from_double(frequency))
+ self.tb.run()
+
+ self.assertAlmostEqual(src.frequency(), frequency)
+
+
if __name__ == '__main__':
gr_unittest.run(test_sig_source, "test_sig_source.xml")