diff options
Diffstat (limited to 'gnuradio-core')
-rw-r--r-- | gnuradio-core/src/lib/gengen/gr_max_XX.cc.t | 2 | ||||
-rwxr-xr-x | gnuradio-core/src/python/gnuradio/gr/qa_max.py | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/gnuradio-core/src/lib/gengen/gr_max_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_max_XX.cc.t index 26c44f44e..ee88261f9 100644 --- a/gnuradio-core/src/lib/gengen/gr_max_XX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_max_XX.cc.t @@ -54,7 +54,7 @@ int for (int i=0; i<noutput_items; i++) { - @I_TYPE@ max = 0; + @I_TYPE@ max = ((@I_TYPE@ *) input_items[0])[i*d_vlen]; for (int j=0; j < (int) d_vlen; j++ ) { for (int k=0; k<ninputs; k++) { diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_max.py b/gnuradio-core/src/python/gnuradio/gr/qa_max.py index fdf118cd1..0171c93db 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_max.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_max.py @@ -50,6 +50,20 @@ class test_sig_source (gr_unittest.TestCase): result_data = dst.data() self.assertEqual(expected_result, result_data) + def test_002(self): + + src_data=(-100,-99,-98,-97,-96,-1) + expected_result = (float(max(src_data)), ) + + src = gr.vector_source_f(src_data) + s2v = gr.stream_to_vector(gr.sizeof_float, len(src_data)) + op = gr.max_ff( len(src_data) ) + dst = gr.vector_sink_f() + + self.tb.connect(src, s2v, op, dst) + self.tb.run() + result_data = dst.data() + self.assertEqual(expected_result, result_data) if __name__ == '__main__': gr_unittest.main () |