diff options
-rw-r--r-- | gnuradio-core/src/python/gnuradio/gr/qa_float_to_int.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_float_to_int.py b/gnuradio-core/src/python/gnuradio/gr/qa_float_to_int.py index 6eaf2e8f0..2f54d0329 100644 --- a/gnuradio-core/src/python/gnuradio/gr/qa_float_to_int.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_float_to_int.py @@ -44,6 +44,22 @@ class test_float_to_int (gr_unittest.TestCase): self.assertEqual(expected_result, result_data) + def test_002(self): + + src_data = ( 2147483647, 2147483648, 2200000000, + -2147483648, -2147483649, -2200000000) + expected_result = [2147483647, 2147483647, 2147483647, + -2147483648, -2147483648, -2147483648] + src = gr.vector_source_f(src_data) + op = gr.float_to_int() + dst = gr.vector_sink_i() + + self.tb.connect(src, op, dst) + self.tb.run() + result_data = list(dst.data()) + + self.assertEqual(expected_result, result_data) + if __name__ == '__main__': gr_unittest.run(test_float_to_int, "test_float_to_int.xml") |