summaryrefslogtreecommitdiff
path: root/gsm-tvoid/src/python/qa_gsm.py
blob: ccb332835c21ccd51af9a529c2eccfba58334890 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
#


from gnuradio import gr, gr_unittest
import gsm

class qa_gsm (gr_unittest.TestCase):

    def setUp (self):
        self.fg = gr.top_block ()

    def tearDown (self):
        self.fg = None

    def test_001_burst_cf (self):
#        src_data = map(complex,(-3, 4, -5.5, 2, 3))
        src_data = (-3, 4, -5.5, 2, 3)
        print src_data
        expected_result = (9, 16, 30.25, 4, 9)
        print expected_result
        src = gr.vector_source_c (src_data)
        burst = gsm.burst_cf ()
        dst = gr.vector_sink_f ()
        self.fg.connect (src, burst)
        self.fg.connect (burst, dst)
        self.fg.run ()
        result_data = dst.data ()
        self.assertFloatTuplesAlmostEqual (expected_result, result_data, 5)
        
if __name__ == '__main__':
    gr_unittest.main ()
personal git repositories of Harald Welte. Your mileage may vary