Updating all python QA programs in gnuradio-core to output XML files.
[debian/gnuradio] / gnuradio-core / src / python / gnuradio / gr / qa_single_pole_iir_cc.py
index a7889d177deeca2aee12b92d70999009f8896f1f..47b4948ba8abec443d7246267fa601bf3922379b 100755 (executable)
@@ -1,12 +1,12 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2006 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
 # GNU Radio is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
+# the Free Software Foundation; either version 3, or (at your option)
 # any later version.
 # 
 # GNU Radio is distributed in the hope that it will be useful,
@@ -16,8 +16,8 @@
 # 
 # You should have received a copy of the GNU General Public License
 # along with GNU Radio; see the file COPYING.  If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
 # 
 
 from gnuradio import gr, gr_unittest
@@ -25,10 +25,10 @@ from gnuradio import gr, gr_unittest
 class test_single_pole_iir_cc(gr_unittest.TestCase):
 
     def setUp (self):
-        self.fg = gr.flow_graph ()
+        self.tb = gr.top_block ()
 
     def tearDown (self):
-        self.fg = None
+        self.tb = None
 
     def test_001(self):
         src_data = (0+0j, 1000+1000j, 2000+2000j, 3000+3000j, 4000+4000j, 5000+5000j)
@@ -36,8 +36,8 @@ class test_single_pole_iir_cc(gr_unittest.TestCase):
         src = gr.vector_source_c(src_data)
         op = gr.single_pole_iir_filter_cc (1.0)
         dst = gr.vector_sink_c()
-        self.fg.connect (src, op, dst)
-        self.fg.run()
+        self.tb.connect (src, op, dst)
+        self.tb.run()
         result_data = dst.data()
         self.assertComplexTuplesAlmostEqual (expected_result, result_data)
 
@@ -47,8 +47,8 @@ class test_single_pole_iir_cc(gr_unittest.TestCase):
         src = gr.vector_source_c(src_data)
         op = gr.single_pole_iir_filter_cc (0.125)
         dst = gr.vector_sink_c()
-        self.fg.connect (src, op, dst)
-        self.fg.run()
+        self.tb.connect (src, op, dst)
+        self.tb.run()
         result_data = dst.data()
         self.assertComplexTuplesAlmostEqual (expected_result, result_data, 3)
 
@@ -61,12 +61,12 @@ class test_single_pole_iir_cc(gr_unittest.TestCase):
         op = gr.single_pole_iir_filter_cc (0.125, block_size)
         p2s = gr.parallel_to_serial(gr.sizeof_gr_complex, block_size)
         dst = gr.vector_sink_c()
-        self.fg.connect (src, s2p, op, p2s, dst)
-        self.fg.run()
+        self.tb.connect (src, s2p, op, p2s, dst)
+        self.tb.run()
         result_data = dst.data()
         self.assertComplexTuplesAlmostEqual (expected_result, result_data, 3)
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_single_pole_iir_cc, "test_single_pole_iir_cc.xml")