summaryrefslogtreecommitdiff
path: root/gr-blocks/python
diff options
context:
space:
mode:
authorJohnathan Corgan2012-06-22 16:58:50 -0700
committerJohnathan Corgan2012-06-22 16:58:50 -0700
commit75f11771a9ee4b2854297fdb2c9db5761bde1c45 (patch)
treecffe302da2c6b2154eebb146175e84bf9744cffc /gr-blocks/python
parent6e0626fd93b99eab2234fba79fc0174261ea67f4 (diff)
downloadgnuradio-75f11771a9ee4b2854297fdb2c9db5761bde1c45.tar.gz
gnuradio-75f11771a9ee4b2854297fdb2c9db5761bde1c45.tar.bz2
gnuradio-75f11771a9ee4b2854297fdb2c9db5761bde1c45.zip
blocks: added gr::blocks:char_to_short
Diffstat (limited to 'gr-blocks/python')
-rwxr-xr-xgr-blocks/python/qa_type_conversions.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/gr-blocks/python/qa_type_conversions.py b/gr-blocks/python/qa_type_conversions.py
index bc65a2781..ff2e5c609 100755
--- a/gr-blocks/python/qa_type_conversions.py
+++ b/gr-blocks/python/qa_type_conversions.py
@@ -51,5 +51,16 @@ class test_type_conversions(gr_unittest.TestCase):
self.tb.run()
self.assertFloatTuplesAlmostEqual(expected_data, dst.data())
+ def test_char_to_short(self):
+ src_data = (1, 2, 3, 4, 5)
+ expected_data = (256, 512, 768, 1024, 1280)
+ src = gr.vector_source_b(src_data)
+ op = blocks_swig.char_to_short()
+ dst = gr.vector_sink_s()
+ self.tb.connect(src, op, dst)
+ self.tb.run()
+ self.assertEqual(expected_data, dst.data())
+
+
if __name__ == '__main__':
gr_unittest.run(test_type_conversions, "test_type_conversions.xml")