Checks to make sure XML path is writable before making the XML runner. Ignores it...
[debian/gnuradio] / gnuradio-core / src / python / gnuradio / gr / qa_stream_mux.py
index 086093a8b02063e36580019ab95fde9ccea07e40..7d6ddf81b9d3858cb113df9ff1fb7bec35c8bdbb 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2005 Free Software Foundation, Inc.
+# Copyright 2004,2005,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
 
 from gnuradio import gr, gr_unittest
 
-class test_head (gr_unittest.TestCase):
+class test_stream_mux (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 help_stream_2ff(self, N, stream_sizes):
         v0 = gr.vector_source_f(N*[1,], False)
@@ -38,10 +38,10 @@ class test_head (gr_unittest.TestCase):
 
         dst = gr.vector_sink_f ()
 
-        self.fg.connect (v0, (mux,0))
-        self.fg.connect (v1, (mux,1))
-        self.fg.connect (mux, dst)
-        self.fg.run ()
+        self.tb.connect (v0, (mux,0))
+        self.tb.connect (v1, (mux,1))
+        self.tb.connect (mux, dst)
+        self.tb.run ()
 
         return dst.data ()
         
@@ -57,10 +57,10 @@ class test_head (gr_unittest.TestCase):
 
         dst = gr.vector_sink_f ()
 
-        self.fg.connect (v0, (mux,0))
-        self.fg.connect (v1, (mux,1))
-        self.fg.connect (mux, dst)
-        self.fg.run ()
+        self.tb.connect (v0, (mux,0))
+        self.tb.connect (v1, (mux,1))
+        self.tb.connect (mux, dst)
+        self.tb.run ()
 
         return dst.data ()
         
@@ -94,7 +94,6 @@ class test_head (gr_unittest.TestCase):
                      9.0,  8.0,  7.0,  6.0,  5.0,  4.0,  3.0,  2.0,  1.0,  0.0)
         self.assertEqual (exp_data, result_data)
 
-
     def test_stream_2NM_ff(self):
         N = 40
         stream_sizes = [7, 9]
@@ -165,6 +164,5 @@ class test_head (gr_unittest.TestCase):
       
         self.assertEqual (exp_data, result_data)
 
-
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_stream_mux, "test_stream_mux.xml")