summaryrefslogtreecommitdiff
path: root/gr-howto-write-a-block/python/qa_howto.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-howto-write-a-block/python/qa_howto.py')
-rwxr-xr-xgr-howto-write-a-block/python/qa_howto.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/gr-howto-write-a-block/python/qa_howto.py b/gr-howto-write-a-block/python/qa_howto.py
index 7321941d5..5e62fc890 100755
--- a/gr-howto-write-a-block/python/qa_howto.py
+++ b/gr-howto-write-a-block/python/qa_howto.py
@@ -22,6 +22,7 @@
from gnuradio import gr, gr_unittest
import howto_swig
+from square3_ff import square3_ff
class qa_howto (gr_unittest.TestCase):
@@ -55,5 +56,17 @@ class qa_howto (gr_unittest.TestCase):
result_data = dst.data ()
self.assertFloatTuplesAlmostEqual (expected_result, result_data, 6)
+ def test_003_square3_ff (self):
+ src_data = (-3, 4, -5.5, 2, 3)
+ expected_result = (9, 16, 30.25, 4, 9)
+ src = gr.vector_source_f (src_data)
+ sqr = square3_ff ()
+ dst = gr.vector_sink_f ()
+ self.tb.connect (src, sqr)
+ self.tb.connect (sqr, dst)
+ self.tb.run ()
+ result_data = dst.data ()
+ self.assertFloatTuplesAlmostEqual (expected_result, result_data, 6)
+
if __name__ == '__main__':
gr_unittest.main ()