diff options
author | Johnathan Corgan | 2012-05-02 14:37:55 -0700 |
---|---|---|
committer | Johnathan Corgan | 2012-05-02 14:37:55 -0700 |
commit | ed8fbd7733d54b80c2bd13351500d0c2da187caf (patch) | |
tree | 7fab347708fd83bbecf58cf4703db5d29467da05 /gr-digital/python/qa_correlate_access_code.py | |
parent | 884c23efe954f34d15f7211c360e1475c65db9db (diff) | |
parent | 7fde258b1478c01cbe7559e7b2cd0f34e36cbe33 (diff) | |
download | gnuradio-ed8fbd7733d54b80c2bd13351500d0c2da187caf.tar.gz gnuradio-ed8fbd7733d54b80c2bd13351500d0c2da187caf.tar.bz2 gnuradio-ed8fbd7733d54b80c2bd13351500d0c2da187caf.zip |
Merge branch 'digital_moves'
Diffstat (limited to 'gr-digital/python/qa_correlate_access_code.py')
-rwxr-xr-x | gr-digital/python/qa_correlate_access_code.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/gr-digital/python/qa_correlate_access_code.py b/gr-digital/python/qa_correlate_access_code.py index 6b6f25051..96246dcfb 100755 --- a/gr-digital/python/qa_correlate_access_code.py +++ b/gr-digital/python/qa_correlate_access_code.py @@ -21,7 +21,7 @@ # from gnuradio import gr, gr_unittest -import digital_swig +import digital_swig as digital import math default_access_code = '\xAC\xDD\xA4\xE2\xF2\x8C\x20\xFC' @@ -53,7 +53,7 @@ class test_correlate_access_code(gr_unittest.TestCase): src_data = (1, 0, 1, 1, 1, 1, 0, 1, 1) + pad + (0,) * 7 expected_result = pad + (1, 0, 1, 1, 3, 1, 0, 1, 1, 2) + (0,) * 6 src = gr.vector_source_b (src_data) - op = digital_swig.correlate_access_code_bb("1011", 0) + op = digital.correlate_access_code_bb("1011", 0) dst = gr.vector_sink_b () self.tb.connect (src, op, dst) self.tb.run () @@ -70,13 +70,28 @@ class test_correlate_access_code(gr_unittest.TestCase): src_data = code + (1, 0, 1, 1) + pad expected_result = pad + code + (3, 0, 1, 1) src = gr.vector_source_b (src_data) - op = digital_swig.correlate_access_code_bb(access_code, 0) + op = digital.correlate_access_code_bb(access_code, 0) dst = gr.vector_sink_b () self.tb.connect (src, op, dst) self.tb.run () result_data = dst.data () self.assertEqual (expected_result, result_data) + def test_003(self): + code = tuple(string_to_1_0_list(default_access_code)) + access_code = to_1_0_string(code) + pad = (0,) * 64 + #print code + #print access_code + src_data = code + (1, 0, 1, 1) + pad + expected_result = code + (1, 0, 1, 1) + pad + src = gr.vector_source_b (src_data) + op = digital.correlate_access_code_tag_bb(access_code, 0, "test") + dst = gr.vector_sink_b () + self.tb.connect (src, op, dst) + self.tb.run () + result_data = dst.data () + self.assertEqual (expected_result, result_data) if __name__ == '__main__': |