summaryrefslogtreecommitdiff
path: root/gr-blocks/python
diff options
context:
space:
mode:
authorJohnathan Corgan2012-06-18 12:28:48 -0700
committerJohnathan Corgan2012-06-19 09:57:22 -0700
commit24962cd24c623c6822733fed4c911a4adabbdd57 (patch)
treed7ca14d64f81bf5caef9f86d4287dbc45e5fa1c2 /gr-blocks/python
parent59f49f4663d5795adc7d7cc573d24c0747afad0f (diff)
downloadgnuradio-24962cd24c623c6822733fed4c911a4adabbdd57.tar.gz
gnuradio-24962cd24c623c6822733fed4c911a4adabbdd57.tar.bz2
gnuradio-24962cd24c623c6822733fed4c911a4adabbdd57.zip
blocks: added div_XX and sub_XX blocks
Diffstat (limited to 'gr-blocks/python')
-rwxr-xr-xgr-blocks/python/qa_add_mult_div_sub.py38
1 files changed, 10 insertions, 28 deletions
diff --git a/gr-blocks/python/qa_add_mult_div_sub.py b/gr-blocks/python/qa_add_mult_div_sub.py
index 05a3b2384..0aca03d3f 100755
--- a/gr-blocks/python/qa_add_mult_div_sub.py
+++ b/gr-blocks/python/qa_add_mult_div_sub.py
@@ -166,65 +166,47 @@ class test_add_mult_div_sub(gr_unittest.TestCase):
def test_multiply_const_ss(self):
src_data = (-1, 0, 1, 2, 3)
expected_result = (-5, 0, 5, 10, 15)
- op = gr.multiply_const_ss(5)
+ op = blocks_swig.multiply_const_ss(5)
self.help_ss((src_data,), expected_result, op)
def test_multiply_const_ii(self):
src_data = (-1, 0, 1, 2, 3)
expected_result = (-5, 0, 5, 10, 15)
- op = gr.multiply_const_ii(5)
+ op = blocks_swig.multiply_const_ii(5)
self.help_ii((src_data,), expected_result, op)
def test_multiply_const_ff(self):
src_data = (-1, 0, 1, 2, 3)
expected_result = (-5, 0, 5, 10, 15)
- op = gr.multiply_const_ff(5)
+ op = blocks_swig.multiply_const_ff(5)
self.help_ff((src_data,), expected_result, op)
def test_multiply_const_cc(self):
src_data = (-1-1j, 0+0j, 1+1j, 2+2j, 3+3j)
expected_result = (-5-5j, 0+0j, 5+5j, 10+10j, 15+15j)
- op = gr.multiply_const_cc(5)
+ op = blocks_swig.multiply_const_cc(5)
self.help_cc((src_data,), expected_result, op)
def test_multiply_const_cc2(self):
src_data = (-1-1j, 0+0j, 1+1j, 2+2j, 3+3j)
expected_result = (-3-7j, 0+0j, 3+7j, 6+14j, 9+21j)
- op = gr.multiply_const_cc(5+2j)
+ op = blocks_swig.multiply_const_cc(5+2j)
self.help_cc((src_data,), expected_result, op)
-
- """
- def test_sub_ii_1(self):
- src1_data = (1, 2, 3, 4, 5)
- expected_result = (-1, -2, -3, -4, -5)
- op = gr.sub_ii()
- self.help_ii((src1_data,),
- expected_result, op)
-
- def test_sub_ii_2(self):
+ def test_sub_ii(self):
src1_data = (1, 2, 3, 4, 5)
src2_data = (8, -3, 4, 8, 2)
expected_result = (-7, 5, -1, -4, 3)
- op = gr.sub_ii()
+ op = blocks_swig.sub_ii()
self.help_ii((src1_data, src2_data),
expected_result, op)
- def test_div_ff_1(self):
- src1_data = (1, 2, 4, -8)
- expected_result = (1, 0.5, 0.25, -.125)
- op = gr.divide_ff()
- self.help_ff((src1_data,),
- expected_result, op)
-
- def test_div_ff_2(self):
+ def test_div_ff(self):
src1_data = ( 5, 9, -15, 1024)
src2_data = (10, 3, -5, 64)
expected_result = (0.5, 3, 3, 16)
- op = gr.divide_ff()
- self.help_ff((src1_data, src2_data),
- expected_result, op)
- """
+ op = blocks_swig.divide_ff()
+ self.help_ff((src1_data, src2_data), expected_result, op)
if __name__ == '__main__':
gr_unittest.run(test_add_mult_div_sub, "test_add_mult_div_sub.xml")