diff options
author | Johnathan Corgan | 2012-06-23 08:32:59 -0700 |
---|---|---|
committer | Johnathan Corgan | 2012-06-23 08:32:59 -0700 |
commit | 11a702b94a43cac127c146654f5fc10415f2bb6e (patch) | |
tree | 8e923932cffdf67db1197e3435d88fbc350d42b8 /gr-blocks/python | |
parent | 6eb1447df04883af78ed78eb8449378e67d67bf6 (diff) | |
download | gnuradio-11a702b94a43cac127c146654f5fc10415f2bb6e.tar.gz gnuradio-11a702b94a43cac127c146654f5fc10415f2bb6e.tar.bz2 gnuradio-11a702b94a43cac127c146654f5fc10415f2bb6e.zip |
blocks: added gr::blocks::complex_to_real
Diffstat (limited to 'gr-blocks/python')
-rwxr-xr-x | gr-blocks/python/qa_type_conversions.py | 10 |
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 5d477eef1..7c27a9c51 100755 --- a/gr-blocks/python/qa_type_conversions.py +++ b/gr-blocks/python/qa_type_conversions.py @@ -96,6 +96,16 @@ class test_type_conversions(gr_unittest.TestCase): self.assertFloatTuplesAlmostEqual(expected_data1, dst1.data()) self.assertFloatTuplesAlmostEqual(expected_data2, dst2.data()) + def test_complex_to_real(self): + src_data = (1+2j, 3+4j, 5+6j, 7+8j, 9+10j) + expected_data = (1.0, 3.0, 5.0, 7.0, 9.0) + src = gr.vector_source_c(src_data) + op = blocks_swig.complex_to_real() + 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") |