summaryrefslogtreecommitdiff
path: root/gr-blocks/python
diff options
context:
space:
mode:
authorJohnathan Corgan2012-06-23 08:44:47 -0700
committerJohnathan Corgan2012-06-23 08:44:47 -0700
commited0dffa3c1a84a4b8f3201969896f61af39b86a3 (patch)
tree573cc257e81bf3c9353b5260c83cceaba1cebe73 /gr-blocks/python
parent11a702b94a43cac127c146654f5fc10415f2bb6e (diff)
downloadgnuradio-ed0dffa3c1a84a4b8f3201969896f61af39b86a3.tar.gz
gnuradio-ed0dffa3c1a84a4b8f3201969896f61af39b86a3.tar.bz2
gnuradio-ed0dffa3c1a84a4b8f3201969896f61af39b86a3.zip
blocks: added gr::blocks::complex_to_imag
Diffstat (limited to 'gr-blocks/python')
-rwxr-xr-xgr-blocks/python/qa_type_conversions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/gr-blocks/python/qa_type_conversions.py b/gr-blocks/python/qa_type_conversions.py
index 7c27a9c51..1faf83ad8 100755
--- a/gr-blocks/python/qa_type_conversions.py
+++ b/gr-blocks/python/qa_type_conversions.py
@@ -106,6 +106,16 @@ class test_type_conversions(gr_unittest.TestCase):
self.tb.run()
self.assertFloatTuplesAlmostEqual(expected_data, dst.data())
+ def test_complex_to_imag(self):
+ src_data = (1+2j, 3+4j, 5+6j, 7+8j, 9+10j)
+ expected_data = (2.0, 4.0, 6.0, 8.0, 10.0)
+ src = gr.vector_source_c(src_data)
+ op = blocks_swig.complex_to_imag()
+ dst = gr.vector_sink_f()
+ self.tb.connect(src, op, dst)
+ self.tb.run()
+ self.assertFloatTuplesAlmostEqual(expected_data, dst.data())
+
if __name__ == '__main__':
gr_unittest.run(test_type_conversions, "test_type_conversions.xml")