From 5d69a524f81f234b3fbc41d49ba18d6f6886baba Mon Sep 17 00:00:00 2001 From: jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> Date: Thu, 3 Aug 2006 04:51:51 +0000 Subject: Houston, we have a trunk. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3122 221aa14e-8319-0410-a670-987f0aec2ac5 --- gr-howto-write-a-block/doc/qa_howto_1.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 gr-howto-write-a-block/doc/qa_howto_1.py (limited to 'gr-howto-write-a-block/doc/qa_howto_1.py') diff --git a/gr-howto-write-a-block/doc/qa_howto_1.py b/gr-howto-write-a-block/doc/qa_howto_1.py new file mode 100755 index 0000000000..aa84908d44 --- /dev/null +++ b/gr-howto-write-a-block/doc/qa_howto_1.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +from gnuradio import gr, gr_unittest +import howto + +class qa_howto (gr_unittest.TestCase): + + def setUp (self): + self.fg = gr.flow_graph () + + def tearDown (self): + self.fg = None + + def test_001_square_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 = howto.square_ff () + dst = gr.vector_sink_f () + self.fg.connect (src, sqr) + self.fg.connect (sqr, dst) + self.fg.run () + result_data = dst.data () + self.assertFloatTuplesAlmostEqual (expected_result, result_data, 6) + +if __name__ == '__main__': + gr_unittest.main () -- cgit v1.2.3