diff options
Diffstat (limited to 'gnuradio-core/src/python')
-rwxr-xr-x | gnuradio-core/src/python/gnuradio/gr/qa_fft_filter.py | 24 | ||||
-rwxr-xr-x | gnuradio-core/src/python/gnuradio/gr/qa_noise.py | 12 |
2 files changed, 36 insertions, 0 deletions
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_fft_filter.py b/gnuradio-core/src/python/gnuradio/gr/qa_fft_filter.py index b3124ad29..f02f700a6 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_fft_filter.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_fft_filter.py @@ -273,6 +273,30 @@ class test_fft_filter(gr_unittest.TestCase): self.assert_fft_float_ok2(expected_result, result_data) + def test_fff_get0(self): + random.seed(0) + for i in xrange(25): + ntaps = int(random.uniform(2, 100)) + taps = make_random_float_tuple(ntaps) + + op = gr.fft_filter_fff(1, taps) + result_data = op.taps() + print result_data + + self.assertEqual(taps, result_data) + + def test_ccc_get0(self): + random.seed(0) + for i in xrange(25): + ntaps = int(random.uniform(2, 100)) + taps = make_random_complex_tuple(ntaps) + + op = gr.fft_filter_ccc(1, taps) + result_data = op.taps() + print result_data + + self.assertComplexTuplesAlmostEqual(taps, result_data, 4) + if __name__ == '__main__': gr_unittest.run(test_fft_filter, "test_fft_filter.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_noise.py b/gnuradio-core/src/python/gnuradio/gr/qa_noise.py index 4a575f5d6..d7750cfe2 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_noise.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_noise.py @@ -34,6 +34,18 @@ class test_noise_source(gr_unittest.TestCase): # Just confirm that we can instantiate a noise source op = gr.noise_source_f(gr.GR_GAUSSIAN, 10, 10) + def test_002(self): + # Test get methods + set_type = gr.GR_GAUSSIAN + set_ampl = 10 + op = gr.noise_source_f(set_type, set_ampl, 10) + get_type = op.type() + get_ampl = op.amplitude() + + self.assertEqual(get_type, set_type) + self.assertEqual(get_ampl, set_ampl) + + if __name__ == '__main__': gr_unittest.run(test_noise_source, "test_noise_source.xml") |