Revision 3c443c0b gnuradio-core/src/python/gnuradio/gr/qa_bin_statistics.py

b/gnuradio-core/src/python/gnuradio/gr/qa_bin_statistics.py
1 1
#!/usr/bin/env python
2 2
#
3
# Copyright 2006 Free Software Foundation, Inc.
3
# Copyright 2006,2007 Free Software Foundation, Inc.
4 4
# 
5 5
# This file is part of GNU Radio
6 6
# 
......
28 28
#print "pid =", os.getpid()
29 29
#raw_input("Attach gdb and press return...")
30 30

31
"""
32
Note: The QA tests below have been disabled by renaming them from test_*
33
to xtest_*.  See ticket:199 on http://gnuradio.org/trac/ticket/199
34
"""
31 35

32 36
class counter(gr.feval_dd):
33 37
    def __init__(self, step_size=1):
......
90 94
        self.data = struct.unpack('%df' % (self.vlen,), msg.to_string())
91 95

92 96

93
class test_bin_statistics(gr_unittest.TestCase):
97
class xtest_bin_statistics(gr_unittest.TestCase):
94 98

95 99
    def setUp(self):
96
        self.fg = gr.flow_graph ()
100
        self.tb = gr.top_block ()
97 101

98 102
    def tearDown(self):
99
        self.fg = None
103
        self.tb = None
100 104

101
    def test_001(self):
105
    def xtest_001(self):
102 106
        vlen = 4
103 107
        tune = counter(1)
104 108
        tune_delay = 0
......
122 126
        src = gr.vector_source_f(src_data, False)
123 127
        s2v = gr.stream_to_vector(gr.sizeof_float, vlen)
124 128
        stats = gr.bin_statistics_f(vlen, msgq, tune, tune_delay, dwell_delay)
125
        self.fg.connect(src, s2v, stats)
126
        self.fg.run()
129
        self.tb.connect(src, s2v, stats)
130
        self.tb.run()
127 131
        self.assertEqual(4, msgq.count())
128 132
        for i in range(4):
129 133
            m = parse_msg(msgq.delete_head())
130 134
            #print "m =", m.center_freq, m.data
131 135
            self.assertEqual(expected_results[vlen*i:vlen*i + vlen], m.data)
132 136

133
    def test_002(self):
137
    def xtest_002(self):
134 138
        vlen = 4
135 139
        tune = counter(1)
136 140
        tune_delay = 1
......
150 154
        src = gr.vector_source_f(src_data, False)
151 155
        s2v = gr.stream_to_vector(gr.sizeof_float, vlen)
152 156
        stats = gr.bin_statistics_f(vlen, msgq, tune, tune_delay, dwell_delay)
153
        self.fg.connect(src, s2v, stats)
154
        self.fg.run()
157
        self.tb.connect(src, s2v, stats)
158
        self.tb.run()
155 159
        self.assertEqual(1, msgq.count())
156 160
        for i in range(1):
157 161
            m = parse_msg(msgq.delete_head())
......
160 164

161 165

162 166

163
    def test_003(self):
167
    def xtest_003(self):
164 168
        vlen = 4
165 169
        tune = counter3(foobar3, 1)
166 170
        tune_delay = 1
......
180 184
        src = gr.vector_source_f(src_data, False)
181 185
        s2v = gr.stream_to_vector(gr.sizeof_float, vlen)
182 186
        stats = gr.bin_statistics_f(vlen, msgq, tune, tune_delay, dwell_delay)
183
        self.fg.connect(src, s2v, stats)
184
        self.fg.run()
187
        self.tb.connect(src, s2v, stats)
188
        self.tb.run()
185 189
        self.assertEqual(1, msgq.count())
186 190
        for i in range(1):
187 191
            m = parse_msg(msgq.delete_head())
......
193 197
        #print "foobar4: new_t =", new_t
194 198
        pass
195 199
        
196
    def test_004(self):
200
    def xtest_004(self):
197 201
        vlen = 4
198 202
        tune = counter4(self, 1)
199 203
        tune_delay = 1
......
213 217
        src = gr.vector_source_f(src_data, False)
214 218
        s2v = gr.stream_to_vector(gr.sizeof_float, vlen)
215 219
        stats = gr.bin_statistics_f(vlen, msgq, tune, tune_delay, dwell_delay)
216
        self.fg.connect(src, s2v, stats)
217
        self.fg.run()
220
        self.tb.connect(src, s2v, stats)
221
        self.tb.run()
218 222
        self.assertEqual(1, msgq.count())
219 223
        for i in range(1):
220 224
            m = parse_msg(msgq.delete_head())

Also available in: Unified diff