X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnuradio-core%2Fsrc%2Fpython%2Fgnuradio%2Fgr%2Fqa_feval.py;h=64bbe45ce7635c928ee1b47b9162243ff1ab5bd9;hb=ea29b08aeb54227e6628f655ccfdb96fe4d8c378;hp=b417f0aef86ee3a49568fc7e14d3c3a748fb47dd;hpb=09a1e803a9e6587c78d20cdf16891e5295874668;p=debian%2Fgnuradio diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_feval.py b/gnuradio-core/src/python/gnuradio/gr/qa_feval.py index b417f0ae..64bbe45c 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_feval.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_feval.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2006 Free Software Foundation, Inc. +# Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -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 ()