diff options
author | Johnathan Corgan | 2012-07-02 09:13:13 -0700 |
---|---|---|
committer | Johnathan Corgan | 2012-07-02 09:13:13 -0700 |
commit | 025f323d9857715a31a1117693c5debd19393a46 (patch) | |
tree | 6a947bbb5d49cbe7b4a42201b696b5c3bdff5826 /gr-blocks/python | |
parent | cc085e128901a9f3e8bfcc45d1834a62d747726c (diff) | |
download | gnuradio-025f323d9857715a31a1117693c5debd19393a46.tar.gz gnuradio-025f323d9857715a31a1117693c5debd19393a46.tar.bz2 gnuradio-025f323d9857715a31a1117693c5debd19393a46.zip |
blocks: added gr::blocks::and_const_XX (bb ss ii)
Diffstat (limited to 'gr-blocks/python')
-rwxr-xr-x | gr-blocks/python/qa_boolean_operators.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gr-blocks/python/qa_boolean_operators.py b/gr-blocks/python/qa_boolean_operators.py index 5bd1e7550..8dad41a92 100755 --- a/gr-blocks/python/qa_boolean_operators.py +++ b/gr-blocks/python/qa_boolean_operators.py @@ -110,6 +110,39 @@ class test_boolean_operators (gr_unittest.TestCase): op = blocks_swig.and_ii () self.help_ii ((src1_data, src2_data), expected_result, op) + + def test_and_const_ss (self): + src_data = (1, 2, 3, 0x5004, 0x1150) + expected_result = (0, 2, 2, 0x5000, 0x1100) + src = gr.vector_source_s(src_data) + op = blocks_swig.and_const_ss (0x55AA) + dst = gr.vector_sink_s() + self.tb.connect(src, op, dst) + self.tb.run() + self.assertEqual(dst.data(), expected_result) + + def test_and_const_bb (self): + src_data = (1, 2, 3, 0x50, 0x11) + expected_result = (0, 2, 2, 0x00, 0x00) + src = gr.vector_source_b(src_data) + op = blocks_swig.and_const_bb (0xAA) + dst = gr.vector_sink_b() + self.tb.connect(src, op, dst) + self.tb.run() + self.assertEqual(dst.data(), expected_result) + + + def test_and_const_ii (self): + src_data = (1, 2, 3, 0x5004, 0x1150) + expected_result = (0, 2, 2, 0x5000, 0x1100) + src = gr.vector_source_i(src_data) + op = blocks_swig.and_const_ii (0x55AA) + dst = gr.vector_sink_i() + self.tb.connect(src, op, dst) + self.tb.run() + self.assertEqual(dst.data(), expected_result) + + """ def test_or_ss (self): src1_data = (1, 2, 3, 0x5004, 0x1150) |