summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/python
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-core/src/python')
-rwxr-xr-xgnuradio-core/src/python/gnuradio/gr/qa_message.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_message.py b/gnuradio-core/src/python/gnuradio/gr/qa_message.py
index 6e85083bd..cb6c4c33c 100755
--- a/gnuradio-core/src/python/gnuradio/gr/qa_message.py
+++ b/gnuradio-core/src/python/gnuradio/gr/qa_message.py
@@ -99,6 +99,7 @@ class test_message (gr_unittest.TestCase):
self.assertEquals(input_data, dst.data())
def test_301(self):
+ # Use itemsize, limit constructor
src = gr.message_source(gr.sizeof_char)
dst = gr.vector_sink_b()
tb = gr.top_block()
@@ -111,6 +112,20 @@ class test_message (gr_unittest.TestCase):
tb.run()
self.assertEquals(tuple(map(ord, '0123456789')), dst.data())
+ def test_302(self):
+ # Use itemsize, msgq constructor
+ msgq = gr.msg_queue()
+ src = gr.message_source(gr.sizeof_char, msgq)
+ dst = gr.vector_sink_b()
+ tb = gr.top_block()
+ tb.connect(src, dst)
+ src.msgq().insert_tail(gr.message_from_string('01234'))
+ src.msgq().insert_tail(gr.message_from_string('5'))
+ src.msgq().insert_tail(gr.message_from_string(''))
+ src.msgq().insert_tail(gr.message_from_string('6789'))
+ src.msgq().insert_tail(gr.message(1)) # send EOF
+ tb.run()
+ self.assertEquals(tuple(map(ord, '0123456789')), dst.data())
if __name__ == '__main__':
gr_unittest.main ()