discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Testing PMT blocks


From: Dave NotTelling
Subject: [Discuss-gnuradio] Testing PMT blocks
Date: Tue, 7 Jun 2016 18:45:18 -0400

I would like to make some unit tests for a PMT only block I created, but I haven't been able to find any good examples aside from a StackOverflow post (http://stackoverflow.com/questions/36342285/testing-a-gnu-radio-message-accepting-block-with-post).  The hope was that I could simply access the message port of the block under test and shove PMT messages in there.  Is that even possible?  I tried making a custom block as outlined in https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/python/blocks/qa_python_message_passing.py with the slight tweak of having a method called 'send' in the producer that would send whatever PMT object you provide as an argument out to the output message port.  That fails with:

message_gen.send(pmt.intern('asdf'))
TypeError: unbound method send() must be called with message_gen instance as first argument (got swig_int_ptr instance instead)


Any tips to test a block like this?

Thanks!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]