diff options
author | eb | 2006-10-24 21:03:11 +0000 |
---|---|---|
committer | eb | 2006-10-24 21:03:11 +0000 |
commit | 4a03552c34d5d400afb29b8bf90b41f8c5b08464 (patch) | |
tree | c8c9ee543f24102a7a8eeba2e68dd8a586cd1a0b /gnuradio-core/src/python | |
parent | 93366b0cc2b423e47ac21b261e3944096f25b53e (diff) | |
download | gnuradio-4a03552c34d5d400afb29b8bf90b41f8c5b08464.tar.gz gnuradio-4a03552c34d5d400afb29b8bf90b41f8c5b08464.tar.bz2 gnuradio-4a03552c34d5d400afb29b8bf90b41f8c5b08464.zip |
added void callback to feval family
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3847 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/python')
-rwxr-xr-x | gnuradio-core/src/python/gnuradio/gr/qa_feval.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_feval.py b/gnuradio-core/src/python/gnuradio/gr/qa_feval.py index 7afc5ec0e..f630e09aa 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_feval.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_feval.py @@ -34,6 +34,12 @@ class my_add2_cc(gr.feval_cc): def eval(self, x): return x + (2 - 2j) +class my_feval(gr.feval): + def __init__(self): + gr.feval.__init__(self) + self.fired = False + def eval(self): + self.fired = True class test_feval(gr_unittest.TestCase): @@ -87,6 +93,18 @@ class test_feval(gr_unittest.TestCase): actual_result = tuple([gr.feval_cc_example(f, x) for x in src_data]) self.assertEqual(expected_result, actual_result) + def test_void_1(self): + # this is all in python + f = my_feval() + f.eval() + self.assertEqual(True, f.fired) + + def test_void_2(self): + # this is python -> C++ -> python and back again + f = my_feval() + gr.feval_example(f) + self.assertEqual(True, f.fired) + if __name__ == '__main__': gr_unittest.main () |